I'm getting the following error when running update.php after updating a module:

Fatal error: Cannot redeclare dmemcache_set() (previously declared in /etc/drupal7/all/modules/memcache/dmemcache.inc:40) in /etc/drupal7/xxxxxxx.yyyyyy.local/modules/memcache/dmemcache.inc on line 84

The update screen goes white with the above error message shown at the top. Back-arrow can sometimes fix the problem....the update script seems to run to completion.

The system is CentOS 6.6 with everything up to date. PECL Memcache 3.0.8.

Comments

jeremy’s picture

It sounds like you may have configured memcache incorrectly in settings.php. Please review the README.txt that comes with the module and make sure that's how you configured settings.php. If you're not sure, post the applicable section of your settings.php here.

lostchord’s picture

This is new behaviour after several months of use, but user error is something I'm good at :-)

Here is the settings section:

/**
 * Memcache configuration
 */
$conf['cache_backends'][] = 'sites/all/modules/memcache/memcache.inc';
$conf['cache_default_class'] = 'MemCacheDrupal';
$conf['cache_class_cache_form'] = 'DrupalDatabaseCache';
jeremy’s picture

That configuration should be correct.

Do you have any other modules enabled relating to caching? Do you modify these or any other cache variables elsewhere in your settings.php?

Does this happen every time you run update.php, or just for a specific module? Are you able to duplicate it repeatedly?

What version of the memcache module were you using prior to upgrading to 7.x-1.4? It's possible you have corrupt data in your cache from an earlier version, and simply restarting the memcache daemon one time could fix this...

lostchord’s picture

Previous version was 1.3.

I am also using APC, settings are:

/**
 * Add APC Caching.
 */
$conf['cache_backends'][] = 'sites/all/modules/apc/drupal_apc_cache.inc';
$conf['cache_class_cache'] = 'DrupalAPCCache';
$conf['cache_class_cache_bootstrap'] = 'DrupalAPCCache';

I updated Rules at the same time as Memcache and I've had some quirky behaviour with rules and memcache in another environment....so this is what I have tried so far:

  • I've bounced the box and tried again with the same error.
  • Clearing all caches is giving me a 500 error.
  • Disabling various Rules related modules is generating 500 errors...but they look like they are disabled.
  • Error is still present after all this.
  • Disabling Memcache proceeds without error.
  • Update script now runs.

Will reverting to 1.3 be of any interest?

Edit: The 500 errors in the apache error log are basically the same as the original error and an attempt to re-enable memcache generates this error.

jeremy’s picture

Can you test disabling APC (remove it from settings.php and restart Apache), does that solve the problem?

And yes, if you're able to try w/ 1.3 to see if that solves the problem, that's another useful data point.

Currently I'm unable to duplicate, so it's difficult to debug. The more detail we can collect the better, best is if I can find a consistent way to duplicate.

So this happens every time you run update.php? Or it happened until a certain update ran?

lostchord’s picture

I will see if I can get some more information over the coming weekend. I'm using CentOS and the EPEL distribution of Drupal as a starting point.

It started with the last batch of updates I applied which included Memcache and (amongst others) Rules. No problems before that. Now it happens all the time.

I did not snapshot the VM before applying the updates - it's R&D rather than production - but I will roll-back all the applied updates and uninstall the modules and then re-apply them up to the point before the last batch of updates.

I'm only highlighting Rules because I had some other issues when I first installed it in another environment with Memcache and APC enabled. The install white-screened, cannot recall the actual errors at the time, and I eventually solved by by turning off ALL cache related features, installing Rules, then turning things on again.

If I can find something that can reproduce it from scratch I will post details here.

jeremy’s picture

Thanks @lostchord, that's very helpful.

jeremy’s picture

Status: Active » Closed (cannot reproduce)

Unable to replicate; no further data -- closing.