crontab (supercron) is failing to run with this error

Fatal error: Call to a member function increment() on a non-object in
...../sites/all/modules/memcache/memcache.inc on
line 262

CommentFileSizeAuthor
#9 995758-d6.patch537 bytesvalthebald

Comments

jeremy’s picture

Status: Active » Postponed (maintainer needs more info)

What version of the memcache module are you using? You've assigned this against 6.x-1.x-dev, but the latest version of the has only one increment on line 297. Perhaps try updating to the latest snapshot?

alfthecat’s picture

I'm having the same issue. Using version 1.7 of Memcache.

I found this post that removed the error from the hosts page but cron is failing to run. When I trigger it, the error returns:
Fatal error: Call to a member function increment() on a non-object in /home/[...]/public_html/sites/all/modules/memcache/memcache.inc on line 262

I'm using a pressflowed instance of Drupal 6.19

ghankstef’s picture

Version: 6.x-1.x-dev » 6.x-1.7

Just to provide a little more info - I am also seeing this when running pressflow 6.20, memcache 6.x-1.7 , or even memcache 6.x-1.8 and ubercart and the error occurs right at the moment of completing a transaction.

I also get it with pressflow 6.20 and memcache 6.x-1.7 while running `drush cc all` or `drush updatedb` from the command line.

Downgrading to memcache 6.x-1.6 seems to take care of the issue.

alfthecat’s picture

Hi ghankstef, thanks for that info, I'll try downgrading to 1.6!

igorik’s picture

Priority: Normal » Critical

Downgrade to 1.6. fix the error, thanks for this.

ryan_courtnage’s picture

Title: cron » PHP Fatal error: Call to a member function increment() on a non-object
Version: 6.x-1.7 » 6.x-1.8

duplicated with 6.x-1.8. Clearing cache on Drupal's "performance" page also causes the problem.

PHP Fatal error:  Call to a member function increment() on a non-object in /var/www/drupal/sites/all/modules/memcache/memcache.inc on line 298, referer: http://drupal.domain.org/admin/settings/performance

using memcached-1.4.5-1.el5 on CentOS 5.5

brunodbo’s picture

Similar problem here with version 6.x-1.8 of memcache module (when doing a 'drush cc all' or emptying the cache on /admin/settings/performance):

PHP Fatal error:  Call to a member function increment() on a non-object in /home/bruno/workspace/dewemo/www/sites/all/modules/contrib/memcache/memcache.inc on line 298

*But* I only get it when adding 'cache_page' => 'none' to the memcache_bins array.

So this works fine:

$conf['memcache_servers'] = array(
  '127.0.0.1:11211' => 'default',
);

$conf['memcache_bins'] = array(
  'cache' => 'default',
  // Any bin that goes to 'none' will fall through to database caching.
  'cache_form' => 'none',
);

While this doesn't (throws the PHP error when clearing the cache, as mentioned above:

$conf['memcache_servers'] = array(
  '127.0.0.1:11211' => 'default',
);

$conf['memcache_bins'] = array(
  'cache' => 'default',
  // Any bin that goes to 'none' will fall through to database caching.
  'cache_form' => 'none',
  'cache_page' => 'none',
);

ps: Misspelling 'cache_page' => 'none' as 'cache_pages' => 'none' also works, that's how I found out :)

brunodbo’s picture

Version: 6.x-1.8 » 6.x-1.x-dev
Status: Postponed (maintainer needs more info) » Active

This is still an issue in the latest dev snapshot (error happens on line 297 there though).

valthebald’s picture

StatusFileSize
new537 bytes

Quick patch (against 6.x-1.8)

valthebald’s picture

Status: Active » Needs review
catch’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev
Status: Needs review » Patch (to be ported)

This looks like a sensible check to me, wondering if we should consider logging when dmemcache_object() fails, but the patch in itself is fine. Committed to 6.x-1.x, this may need commit to 7.x as well.

valthebald’s picture

Sorry for late reply:
I think that watchdogging this kind of failure is the right thing to do.

catch’s picture

Status: Patch (to be ported) » Fixed

This doesn't really apply to the 7.x branch, marking fixed.

Status: Fixed » Closed (fixed)

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