I got the following errors when enabling the memcache extenstion:

Notice: Trying to get property of non-object in /var/www/html/abonnee/modules/memcache/src/MemcacheBackend.php on line 105

Warning: Creating default object from empty value in /var/www/html/abonnee/modules/memcache/src/MemcacheBackend.php on line 123

Notice: Undefined property: stdClass::$checksum in /var/www/html/abonnee/modules/memcache/src/MemcacheBackend.php on line 168

Notice: Undefined property: stdClass::$tags in /var/www/html/abonnee/modules/memcache/src/MemcacheBackend.php on line 168

Catchable fatal error: Argument 2 passed to Drupal\Core\Cache\DatabaseCacheTagsChecksum::isValid() must be of the type array, null given, called in /var/www/html/abonnee/modules/memcache/src/MemcacheBackend.php on line 168 and defined in /var/www/html/abonnee/core/lib/Drupal/Core/Cache/DatabaseCacheTagsChecksum.php on line 97

I applied the patch that solves the issues. I'm not sure if it is the right way to solve it but it works.

Comments

h3rj4n created an issue. See original summary.

h3rj4n’s picture

StatusFileSize
new929 bytes

And the patch.

damiankloip’s picture

Hmm, sorry. I can't replicate this. You just enabled the module and that was it? If memcache doesn't have the key it should not return an item at all AFAIK, not an empty item with FALSE in. Can you post a debug of what is in $results before the error?

damiankloip’s picture

Status: Needs review » Postponed (maintainer needs more info)
vurt’s picture

StatusFileSize
new5.91 KB

I got this error too, and the patch fixes it.

It happens for example when I run "drush cr". I have devel and webprofiler modules (among others) enabled - maybe you can reproduce it with this information.

I have attached the error message with stack trace.

jcnventura’s picture

Status: Postponed (maintainer needs more info) » Reviewed & tested by the community

Indeed, this patch also fixed my 'drush cr'.

@damiankloip, in reply to your question in #3, the value of $result is NULL in those cases where a Fatal error is triggered, requiring this patch to not do so.

The second part of this patch where the $cache->tags are set to an empty array do not seem to be needed once the "is_object($result)" condition is added. If you call $this->valid with $result = NULL, then setting the tags to an empty array does avoid a warning, but I don't think it's necessary.

jcnventura’s picture

Status: Reviewed & tested by the community » Needs work

Setting to needs work, since as I said in #6, the second half of the patch may not be necessary.

jcnventura’s picture

Related issue solved the problem almost the same way as the first half of the patch. But the is_object test is probably better.

jcnventura’s picture

Status: Needs work » Needs review
StatusFileSize
new562 bytes
damiankloip’s picture

Sorry, I am still not seeing this as being the correct fix. I think if we are getting completely empty items, they should be filtered out. Are you using Memcache or Memcached ?

aspilicious’s picture

I'm experiencing the same issue, using memcached.

vurt’s picture

Without the patch I cannot use the module. I am using memcached too.

googletorp’s picture

Could we please get the patch committed, module is 100% useless in current release which this patch fixes. Rolling out a new release after patch has been applied would help a lot of people.

jphautin’s picture

Hello,

Just create a fresh installation with drupal 8.1.8. This is the only (and first) module installed (with memcached) in version 8.x-2.0-alpha1.
Same issue on line 105 of MemcacheBackend.php.
Using same solution to make module usable by applying same modification on line 105 (is 102 in the patch for dev version).

regards,

damiankloip’s picture

StatusFileSize
new503 bytes

Can you test this patch please.

vurt’s picture

This patch also works fine for me, thanks!

tim_dj’s picture

patch #15 works perfect for me

googletorp’s picture

Status: Needs review » Reviewed & tested by the community
cameron tod’s picture

Memcache caused instant WSODs for me without this patch. I applied it and memcache now appears to work perfectly. +1

damiankloip’s picture

Thank you all, going to merge this now and just create a new release.

It seems to only be Memcached that people see issues.

  • damiankloip committed 20bcb68 on 8.x-2.x
    Issue #2674884 by damiankloip, jcnventura, h3rj4n, vurt: Array exception...
damiankloip’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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