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

hussainweb’s picture

I 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).

pounard’s picture

Oh I am sorry I didn't see this issue. I will investigate this right now.

pounard’s picture

Project: Redis » Persistent Login
Version: 7.x-3.7 » 7.x-1.x-dev

Actually 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:

require_once DRUPAL_ROOT . '/' . variable_get('path_inc', 'includes/path.inc');

And persistent_login module does in the _persistent_login_check() function:

require_once './includes/path.inc';

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.

  • gapple committed 9a52527 on 7.x-1.x
    Issue #2490898 by hussainweb, pounard, gapple: Fix error "Cannot...
gapple’s picture

Status: Active » Fixed

Thank 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

hussainweb’s picture

@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 ;)

gapple’s picture

I'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 ;)

pounard’s picture

Thank you very much gapple, it's a very nice surprise to see you fixing it so fast.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.