Problem/Motivation
On my site which receives a reasonable amount of traffic, I see this error message in NewRelic once in a while.
Cannot redeclare drupal_path_initialize() (previously declared in /var/www/zeninfosys/zen/includes/path.inc:18)
It also gives a stack trace.
in _drupal_bootstrap_full called at /.../includes/common.inc (5194)
in _drupal_bootstrap_full called at /.../includes/bootstrap.inc (2262)
in drupal_bootstrap called at /.../sites/all/modules/contrib/persistent_login/persistent_login.module (377)
in _persistent_login_check called at /.../sites/all/modules/contrib/persistent_login/persistent_login.module (43)
in persistent_login_boot called at ? (?)
in call_user_func_array called at /.../includes/module.inc (866)
in module_invoke called at /.../includes/bootstrap.inc (1091)
in bootstrap_invoke_all called at /.../includes/bootstrap.inc (2510)
in _drupal_bootstrap_page_header called at /.../includes/bootstrap.inc (2253)
in drupal_bootstrap called at /.../index.php (20)
Now, I am not 100% certain that it is the redis module's fault here, but I see this only after I started using redis. This could also be an issue with Drupal core or persistent_login (as seen in stack trace), but that is pure speculation.
Proposed resolution
Analyze the cause and fix the problem.
Remaining tasks
- Analyze the cause.
- Fix the error.
Comments
Comment #1
hussainwebI am marking this as major because I suspect this causes failures in other parts of the site as well, such as images not loading (image styles).
Comment #2
pounardOh I am sorry I didn't see this issue. I will investigate this right now.
Comment #3
pounardActually this is not a bug of the Redis module, but of the persistent_login module.
Core does this during bootstrap to load the path.inc file:
And persistent_login module does in the _persistent_login_check() function:
Because those are two different files, when Drupal will be bootstrapped fully, it will attempt to load the Redis module file which will redefine the functions, then boom.
Comment #5
gappleThank you for the issue report and finding the cause of the error.
I've committed a change to 7.x-1.x-dev to use the same require_once statement as is used elsewhere in core. Let me know if you still encounter any problems
Comment #6
hussainweb@pounard, @gapple: Thanks for the fixes! I will switch to the dev branch and test it out. BTW, when do you think you will create a release with this? It could be time for beta2 ;)
Comment #7
gappleI've got some more time this week to finish running through the issue queue, and will probably wrap up the week with a new release.
Given the current stability and usage, I'll probably call it RC1 ;)
Comment #8
pounardThank you very much gapple, it's a very nice surprise to see you fixing it so fast.