I apologize for the vague report, but hoping maybe someone else has run into this and can help me narrow down the issue. As it stands the only way I can get my site back to a working state is to manually edit the exported config, and re-install/re-import.
I have a block page variant on a simple path, no contexts provided. The views blocks can be added and viewed no problem, but returning to the config and deleting a block prompts the Ajax call to fail with an error, and more worrisome, every subsequent page request to the site - even to pages not managed by page manager, return a 500 error. The stack trace looks like the attached, which appears to get recursive, but hopefully contains enough information to help track down where this is occurring. It appears like an issue with views caching, but the problem only occurs, as far as I can tell, when interacting with the views block instance via page manager.
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | stack-trace.png | 241.36 KB | hussainweb |
| page_manager_error.txt | 42.12 KB | bradjones1 |
Comments
Comment #2
dkarso commentedI have this bug too when adding a view block to the page variant. I updated the title to be more specific. I have this problem only with the following module set.
page_manager 8.x-1.0-alpha23+13-dev
panels 8.x-3.0-beta4+45-dev
ctools 8.x-3.0-alpha26+4-dev
page_manager dev needs ctools dev and panels dev because of various functionality and bug fixes. The page variant is a panel variant type so we can use custom layouts.
This bug is quite a blocker for using page_manager with views.
The page variant keeps running the functions jotted down below. Turning opcache off does nothing but turning APC OFF does help "fix" it. But turning apc off is not an option. We run PHP 5.6 on Centos 7
Comment #3
dkarso commentedIt seems the error is consistent when using a Panels variant type. If you use the PageBlockDisplayVariant (Block page variant type) shipped with page_manager variant you can add view blocks. I suspect it has something to do with the cache redirects check in the PageBlockDisplayVariant::buildRegions and the cache dependency. Can someone confirm this? I can't seem to get a handle on this.
Comment #4
weri commentedI have the same problem, but only when I apply the patch #25 from #2759479: Proof of concept: Replace uasort() with dedicated stable-sort-by-weight functions, where possible.
Comment #5
br0kenThis is connected for any cache backend, except of
cache.backend.memorybecause it's not "true" cache. WhenfastServiceNamevariable ofDrupal\Core\Cache\ChainedFastBackendFactoryclass contains name of "true" cache service then data will be serialized before setting to cache. Then, during reading from cache, data will unserializing and some of__wakeup()methods will lead to recursion. Now we need to know which data going to cache and is there potential recursions.Comment #6
mu5a5hi commentedI am seeing the same behavior.
It's on a Pantheon dev site (nginx)
Using these modules/versions:
Drupal core 8.1.9
ctools 8.x-3.0-alpha27
Page Manager 8.x-1.0-alpha24
Panels 8.x-3.0-beta4+47-dev (2016-Aug-21)
On my local copy with no caching the problem seems to go away.
Comment #7
ultimikeFollowing up on @mu5a5hi's comment above, we're building a D8 site using the latest (-dev) versions of all the relevant Panels-related modules.
We were able to create several Panels variants using menu blocks and custom blocks without any issues.
It was only when we created a new Views block display and tried to add that to a new Panels variant did this issue rear its ugly head.
The local environment works fine (using Acquia Dev Desktop with the following configured in development.services.yml:
Our shared development environment is on Pantheon, and trying to create the same Panels variant results in an 502 Bad Gateway (nginx) error. So, this seems to fit the profile for what others are seeing.
We also tested this on a fresh Drupal 8 install with the same versions of all the related modules and saw the exact same behavior.
-mike
Comment #8
br0ken@mu5a5hi's, @ultimike as I said, an error will appear every time when you will use any cache: APC, Database, other one - does not matter. By default it'll be
apc, but if you are not have it installed (as PHP extension), then you'll not have troubles.Comment #9
hussainwebI am facing the same problem. On debugging, I found the recursion when calling apcu_fetch on cid '
views:row'. Now,apcu_fetchunserializes the data itself and hence, I cannot figure out the serialized string except the fragment that causes recursion in unserializingViewExecutableagain. The serialized string being called onViewExecutable::unserializeis something like this:This sets up the recursion again in
ViewExecutable::initHandlers()which again tries to fetch cid 'views:row' from cache and so on.I figure something sets the whole view executable object when trying to save the view but I couldn't figure that out. I hope this helps someone take the next step.
Comment #10
hussainwebIn case it helps, I have attached the stack trace with calls and some annotations.
Comment #11
br0ken@hussainweb, I have fixed the problem after your research! Wait for a patch with tests from me.
Comment #12
hussainweb@BR0kEN, awesome! Please share what caused it. I tried to find an object in that array in vain.
Comment #13
br0kenDamn, I was wrong. I didn't fix it. :( But have additional debugging notes now:
\Drupal\views\ViewExecutable
\Drupal\views\Plugin\views\display\DisplayPluginBase
Everything starts from
\Drupal\views\ViewExecutable::unserialize(). Then we go to\Drupal\views\ViewExecutable::_initHandler()many times in the loop. From there's we goes to\Drupal\views\Plugin\views\display\DisplayPluginBase::getHandlers(). There'sViews::handlerManager($handler_type)->getHandler($info, $override)which hang the process because of processing the same item many times.Then, if we replace old implementation of
\Drupal\views\ViewsData::get()bywe will pass the
$handler = Views::handlerManager($handler_type)->getHandler($info, $override)condition inside of\Drupal\views\Plugin\views\display\DisplayPluginBase::getHandlers(), but will stop on$handler->init($this->view, $this, $info);.Currently, I've did two hacking approaches to solve this:
Disabling fast cache backend at all
Implement service provider in one of custom modules. Like so:
Use static cache to prevent recursion
protected static $done = [];property for\Drupal\views\Plugin\views\display\DisplayPluginBaseclass.if ($handler = Views::handlerManager($handler_type)->getHandler($info, $override)) {byif (empty(static::$done[$type][$id]) && $handler = Views::handlerManager($handler_type)->getHandler($info, $override)) {static::$done[$type][$id] = TRUE;above the$handler->init($this->view, $this, $info);The first approach - quite dramatically and require more resources since part of cache will be disabled.
Second one - is very temporary. We need to figure out why the same data processes so many times.
Comment #14
benjy commentedHave you tried #2831521: Avoid unserialization of blockPluginCollection in BlockDisplayVariant - I had to import a clean database but it worked for me.