When accessing page ***/admin/reports/memcache

I got the following warnings and notices:

Notice: Undefined variable: stats in dmemcache_stats() (line 243 of /***/sites/all/modules/contrib/memcache/dmemcache.inc).
Warning: Invalid argument supplied for foreach() in dmemcache_stats() (line 243 of /***/sites/all/modules/contrib/memcache/dmemcache.inc).
Notice: Undefined variable: stats in dmemcache_stats() (line 262 of /***/sites/all/modules/contrib/memcache/dmemcache.inc).
There are no statistics being reported for this bin.

Drupal 7.8

Comments

Refineo’s picture

Status: Active » Closed (cannot reproduce)

It works fine now without doing anything specific. I don't know what was the reason for this error.

socialnicheguru’s picture

Version: 7.x-0.1 » 7.x-1.x-dev
Status: Closed (cannot reproduce) » Active

I have the same errors

Notice: Undefined variable: stats in dmemcache_stats() (line 244 of /var/aegir/platforms/7/modules/all/memcache/dmemcache.inc).
Warning: Invalid argument supplied for foreach() in dmemcache_stats() (line 244 of /var/aegir/platforms/7/modules/all/memcache/dmemcache.inc).
Notice: Undefined variable: stats in dmemcache_stats() (line 263 of /var/aegir/platforms/7/modules/all/memcache/dmemcache.inc).
There are no statistics being reported for this bin.

is there a bin that is not being utalized or configured since I am getting that error.

fayedrupal’s picture

At settings.php of your drupal site ( normally at /sites/default/settings.php )

This is the foreach() error you may set wrongly in settings.php , if you use more than one memcache you need to specify the array of memcache instances, if you use only one memcache and as a default localhost:11211 you no need to set the ['memcache_servers']

$conf['cache_backends'][] = 'sites/all/modules/memcache/memcache.inc';
$conf['cache_default_class'] = 'MemCacheDrupal';
$conf['cache_class_cache_form'] = 'DrupalDatabaseCache';

for 2 memcached instances example:

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

$conf['memcache_bins'] = array(
'cache' => 'default',
'cache_page' => 'pages'
);

AWS Elasti Cache example:
$conf['memcache_servers'] = array(
'mycache.xxxxx.0001.euw1.cache.amazonaws.com:11211' => 'default',
'mycache.xxxxx.0002.euw1.cache.amazonaws.com:11211' => 'pages'
);

$conf['memcache_bins'] = array(
'cache' => 'default',
'cache_page' => 'pages'
);
see http://drupal.org/node/1131468 for more memcached instances setting

remember to set your security rules in iptables to prevent hack via memcached instance

This is my first comment in drupal, hope you like it.

markpavlitski’s picture

Status: Active » Fixed

Marking as fixed, please feel free to re-open if the feedback above hasn't resolved the issue.

Status: Fixed » Closed (fixed)

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