Problem/Motivation
I have a couple of sites with extreme issues after the 8.x-2.6 upgrade. In both cases after initially deploying and testing we did not experience any problems but over time we observed extremely high levels of new PHP errors.
I've had to downgrade to 8.x-2.5 for now and I'm still a little unclear on exact reproduction steps but I'm starting this issue for visibility.
Steps to reproduce
I'm not sure if this is 100% reproducible but the pattern for our sites seem to be:
- Attempt to load a page that tries to cache something too large for an memcache object.
- An error will be logged, but the page will load.
- Attempt to load the page again.
- Page load fails with dynamic page cache issues due to an incomplete cache object.
Example series of logs from one our sites:
Initial load:
MemcachedDriver::set() error key=41406a1b2cf2436dba1d3d1a845ea7da_%3Adynamic_page_cache%3A-response%3A%5Brequest_format%5D%3Dhtml%3A%5Broute%5D%3Dkcts9_content_services.roku.search_feed35786c7117b4e38d0f169239752ce71158266ae2f6e4aa230fbbb87bd699c0e3 error=[37]ITEM TOO BIG
Subsequent loads:
Warning: Drupal\dynamic_page_cache\EventSubscriber\DynamicPageCacheSubscriber::onRequest(): The script tried to access a property on an incomplete object. Please ensure that the class definition "Drupal\Core\Cache\CacheableResponse" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition in Drupal\dynamic_page_cache\EventSubscriber\DynamicPageCacheSubscriber->onRequest() (line 145 of /var/www/html/docroot/core/modules/dynamic_page_cache/src/EventSubscriber/DynamicPageCacheSubscriber.php)
#0 /var/www/html/docroot/core/includes/bootstrap.inc(166): _drupal_error_handler_real()
#1 /var/www/html/docroot/core/modules/dynamic_page_cache/src/EventSubscriber/DynamicPageCacheSubscriber.php(145): _drupal_error_handler()
#2 [internal function]: Drupal\dynamic_page_cache\EventSubscriber\DynamicPageCacheSubscriber->onRequest()
#3 /var/www/html/docroot/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(111): call_user_func()
#4 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(157): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch()
#5 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(76): Symfony\Component\HttpKernel\HttpKernel->handleRaw()
#6 /var/www/html/docroot/core/lib/Drupal/Core/StackMiddleware/Session.php(53): Symfony\Component\HttpKernel\HttpKernel->handle()
#7 /var/www/html/docroot/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle()
#8 /var/www/html/docroot/core/lib/Drupal/Core/StackMiddleware/ContentLength.php(28): Drupal\Core\StackMiddleware\KernelPreHandle->handle()
#9 /var/www/html/docroot/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\ContentLength->handle()
#10 /var/www/html/docroot/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass()
#11 /var/www/html/vendor/asm89/stack-cors/src/Cors.php(53): Drupal\page_cache\StackMiddleware\PageCache->handle()
#12 /var/www/html/docroot/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Asm89\Stack\Cors->handle()
#13 /var/www/html/docroot/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle()
#14 /var/www/html/docroot/core/lib/Drupal/Core/StackMiddleware/AjaxPageState.php(36): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle()
#15 /var/www/html/docroot/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(51): Drupal\Core\StackMiddleware\AjaxPageState->handle()
#16 /var/www/html/docroot/core/lib/Drupal/Core/DrupalKernel.php(741): Drupal\Core\StackMiddleware\StackedHttpKernel->handle()
#17 /var/www/html/docroot/index.php(19): Drupal\Core\DrupalKernel->handle()
#18 {main}
---
Error: Call to a member function set() on null in Drupal\dynamic_page_cache\EventSubscriber\DynamicPageCacheSubscriber->onRequest() (line 145 of /var/www/html/docroot/core/modules/dynamic_page_cache/src/EventSubscriber/DynamicPageCacheSubscriber.php).
#0 [internal function]: Drupal\dynamic_page_cache\EventSubscriber\DynamicPageCacheSubscriber->onRequest()
#1 /var/www/html/docroot/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(111): call_user_func()
#2 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(157): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch()
#3 /var/www/html/vendor/symfony/http-kernel/HttpKernel.php(76): Symfony\Component\HttpKernel\HttpKernel->handleRaw()
#4 /var/www/html/docroot/core/lib/Drupal/Core/StackMiddleware/Session.php(53): Symfony\Component\HttpKernel\HttpKernel->handle()
#5 /var/www/html/docroot/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(48): Drupal\Core\StackMiddleware\Session->handle()
#6 /var/www/html/docroot/core/lib/Drupal/Core/StackMiddleware/ContentLength.php(28): Drupal\Core\StackMiddleware\KernelPreHandle->handle()
#7 /var/www/html/docroot/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\ContentLength->handle()
#8 /var/www/html/docroot/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass()
#9 /var/www/html/vendor/asm89/stack-cors/src/Cors.php(53): Drupal\page_cache\StackMiddleware\PageCache->handle()
#10 /var/www/html/docroot/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Asm89\Stack\Cors->handle()
#11 /var/www/html/docroot/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle()
#12 /var/www/html/docroot/core/lib/Drupal/Core/StackMiddleware/AjaxPageState.php(36): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle()
#13 /var/www/html/docroot/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(51): Drupal\Core\StackMiddleware\AjaxPageState->handle()
#14 /var/www/html/docroot/core/lib/Drupal/Core/DrupalKernel.php(741): Drupal\Core\StackMiddleware\StackedHttpKernel->handle()
#15 /var/www/html/docroot/index.php(19): Drupal\Core\DrupalKernel->handle()
#16 {main}
Rebuilding the cache resolves the issue, but only until the too large cache is attempted again.
The issue goes away entirely when downgrading to 8.x-2.5.
Proposed resolution
None yet.
Remaining tasks
Determine what is causing the issue.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | 3462448-7.patch | 527 bytes | jrochate |
Issue fork memcache-3462448
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
stopopol commented+1
Comment #3
ippy commentedReporting similar issue, with certain blocks generating
MemcachedDriver::set() error ... ITEM TOO BIG.No other obvious related errors.Not true. See below.The content loads initially but a page refresh returns empty block.
Downgrade to 8.x-2.5 and the issue goes away.
...
A sharper-eyed colleague spotted this "chang[ing] view block cache from Search API (tag-based) to Search API (none), the error seems to have gone. I can view pages that caused memcache error and now get no error."
Corresponding Search API error follows:
TypeError: Drupal\search_api\Utility\QueryHelper::addResults(): Argument #1 ($results) must be of type Drupal\search_api\Query\ResultSetInterface, __PHP_Incomplete_Class given, called in /var/www/********/web/modules/contrib/search_api/src/Plugin/views/cache/SearchApiCachePluginTrait.php on line 186 in Drupal\search_api\Utility\QueryHelper->addResults() (line 86 of /var/www/********/web/modules/contrib/search_api/src/Utility/QueryHelper.php)#0 /var/www/********/web/modules/contrib/search_api/src/Plugin/views/cache/SearchApiCachePluginTrait.php(186): Drupal\search_api\Utility\QueryHelper->addResults() #1 /var/www/********/web/core/modules/views/src/ViewExecutable.php(1478): Drupal\search_api\Plugin\views\cache\SearchApiTagCache->cacheGet() #2 /var/www/********/web/modules/custom/********/src/Plugin/Block/********.php(58): Drupal\views\ViewExecutable->execute()Comment #4
jrochate commentedSame here, for example when listing users.
Comment #5
feyp commentedHad a similar issue with a cacheable response from a rest resource. I didn't try downgrading, but instead moved the dynamic page cache into redis for now.
Speculating that #3386779: Memcache performance issue from big (i.e. chunked) cache items might have introduced a regression?
Comment #6
jan kellermann commentedI looked at the commits and found this:
https://git.drupalcode.org/project/memcache/-/commit/cb11e23520860ee6a46...
Maybe this may cause missing or incomplete classes?
Comment #7
jrochate commentedThanks @jan! For me it doesn't break now, when listing users and in other places where I was having memcache's WSOD.
I'm sending a simple patch just to keep speed up people who would like to test it also.
Comment #10
jan kellermann commentedCreated fork and MR.
Comment #11
vselivanovThanks @jan! Patch #7 with this fix works for me.
I also had related 500 PHP errors when visiting views page:
And this one:
Comment #12
roam2345 commentedThis killed a few of our sites, patch in #7 works
Comment #13
shawn dearmond commentedThis affected our sites as well. Patch #7 fixes it.
Comment #16
japerryBah. linting is the bane of things. I've reverted it and committed. Will get a release out shortly.