After install this module I got this error
"PHP Fatal error: Call to a member function get() on null in /opt/bitnami/apps/drupal/htdocs/core/lib/Drupal/Core/Cache/CacheCollector.php on line 327".

Please how to fix it ?
Thanks

Comments

anjjriit created an issue. See original summary.

erik frèrejean’s picture

That particular isssue is caused by the fact that Drupal\advagg\State\File (and Aggregates as well) overrides Drupal\Core\State\State and uses that to write to the cache. However the File/Aggregates do not set the cache the drupal State expects. I've attempted to pass these services through, which resolve this specific issue.

However then you'll run into the fact that the File service use the $cache property of Drupal\Core\State\State as array rather then the cache object it is.

Anonymous’s picture

Priority: Normal » Major

This issue also occurs during my update to the latest 8.3.0-rc1 version. After disabling all advagg modules the site started to work again. Maybe we must investigate here a little bit deeper why this happen.

I will increase the priority, because it looks like the module is unusable at the moment. Maybe others can confirm this behavior.

erik frèrejean’s picture

The issue itself appears to be introduced in thiscommit. Which changed the state system to extend Drupal\Core\Cache\CacheCollector, and that changed the behaviour of the internal $cache property.

nickdickinsonwilde’s picture

Status: Active » Postponed

ah an 8.3.x change. I'll make sure to get a fix out by the end of the month.

wim leers’s picture

Note that 8.3.0 RC1 is already out. So people are already testing their sites with 8.3.

nickdickinsonwilde’s picture

Yeah I know... but I've been busy; last 3 branches I've been testing beta releases or even branch but not this one :(

dom.’s picture

Hi !
I did update my site to 8.3.x-rc1 for testing and ran into this "CacheCollector" issue. Since I did not know what to do with my site (no page working, no drush module uninstalling module working, no update.php working) I had to find a workaround fast to continue my dev.

In case it helps someone, here is a simple two lines to add patch. IT IS NOT INTENDED to be a solution: the issue origin is not fixed, just symptoms are shutdown.

bradjones1’s picture

Status: Postponed » Needs review
StatusFileSize
new3.97 KB

Here's a stab at matching the changes in the aforementioned State class changes in 8.3.

Status: Needs review » Needs work

The last submitted patch, 9: 2850263-drupal-8.3compatibility-9.patch, failed testing.

bradjones1’s picture

Status: Needs work » Needs review
StatusFileSize
new6.56 KB

Let's try this again.

Status: Needs review » Needs work

The last submitted patch, 11: 2850263-drupal-8.3compatibility-11.patch, failed testing.

bradjones1’s picture

Status: Needs work » Needs review

Looking for a maintainer's help here... the testbot errors don't seem to be necessarily related to these changes?

nickdickinsonwilde’s picture

I'll take a look later today or tomorrow. I should have been more clear in comment #5 that I was planning on refactoring this area a bit.
Most likely the errors are that those changes for compatibility are against core 8.3.x whereas the test was running against 8.2.x

bradjones1’s picture

Copy that. I just queued a custom testbot run against 8.3. I didn't do any refactoring, just tried to match the new API, so hopefully that gets folks up and going in the meantime while you work on broader changes.

catch’s picture

Status: Needs review » Reviewed & tested by the community

The 8.3.x test came back green, this was just reported against the core queue after 8.3.0 release so moving to RTBC.

tanc’s picture

Also confirmed the patch is working for me after updated to Drupal core 8.3.0

j.b’s picture

Patch #11 work with latest 8.3.0 Drupal

cn_jakub_novak’s picture

tried 2850263-drupal-8.3compatibility-11.patch against 1adff58b97cdd402f9ba899300100823d5436308 (dev-2.x).
Drupal version: 8.3.0-rc2
I get:
Fatal error: Maximum execution time of 30 seconds exceeded in /var/www/html/docroot/core/lib/Drupal/Core/StreamWrapper/LocalStream.php on line 134

kmajzlik’s picture

Here is my backtrace on 8.3.0

Fatal error: Maximum execution time of 30 seconds exceeded in /Users/majzlik/www/drupal/lightning/docroot/core/lib/Drupal/Core/StreamWrapper/LocalStream.php on line 134
Call Stack
#	Time	Memory	Function	Location
1	0.0006	367504	{main}( )	.../index.php:0
2	0.0274	2417792	Drupal\Core\DrupalKernel->handle( )	.../index.php:19
3	0.0643	5310200	Stack\StackedHttpKernel->handle( )	.../DrupalKernel.php:656
4	0.0643	5310200	Drupal\Core\StackMiddleware\NegotiationMiddleware->handle( )	.../StackedHttpKernel.php:23
5	0.0643	5310232	Drupal\webprofiler\StackMiddleware\WebprofilerMiddleware->handle( )	.../NegotiationMiddleware.php:50
6	0.0647	5328272	Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle( )	.../WebprofilerMiddleware.php:38
7	0.0647	5328272	Drupal\Core\StackMiddleware\KernelPreHandle->handle( )	.../ReverseProxyMiddleware.php:47
8	0.1255	10959688	Drupal\Core\StackMiddleware\Session->handle( )	.../KernelPreHandle.php:47
9	0.1358	11360896	Symfony\Component\HttpKernel\HttpKernel->handle( )	.../Session.php:57
10	0.1358	11361312	Symfony\Component\HttpKernel\HttpKernel->handleRaw( )	.../HttpKernel.php:64
11	2.6807	59272840	Symfony\Component\HttpKernel\HttpKernel->filterResponse( )	.../HttpKernel.php:166
12	2.6823	59277416	Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher->dispatch( )	.../HttpKernel.php:184
13	2.6928	59595432	Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch( )	.../TraceableEventDispatcher.php:140
14	2.6933	59603488	Symfony\Component\EventDispatcher\Debug\WrappedListener->__invoke( )	.../ContainerAwareEventDispatcher.php:111
15	2.6934	59604016	call_user_func:{/Users/majzlik/www/drupal/lightning/vendor/symfony/event-dispatcher/Debug/WrappedListener.php:61} ( )	.../WrappedListener.php:61
16	2.6934	59604016	Drupal\Core\EventSubscriber\HtmlResponseSubscriber->onRespond( )	.../WrappedListener.php:61
17	2.6934	59604016	Drupal\Core\Render\HtmlResponseAttachmentsProcessor->processAttachments( )	.../HtmlResponseSubscriber.php:45
18	2.7719	60172456	Drupal\advagg\Render\HtmlResponseAttachmentsProcessor->processAssetLibraries( )	.../HtmlResponseAttachmentsProcessor.php:161
19	2.7720	60174064	Drupal\advagg\Asset\AssetResolver->getCssAssets( )	.../HtmlResponseAttachmentsProcessor.php:39
20	2.9118	60662952	Drupal\advagg\State\Files->getMultiple( )	.../AssetResolver.php:133
21	3.3363	61701664	Drupal\advagg\State\Files->scanFile( )	.../Files.php:205
22	3.3370	61718936	Drupal\advagg\State\Files->splitCssFile( )	.../Files.php:138
23	33.3016	68273376	Drupal\advagg\State\Files->createSubfile( )	.../Files.php:466
24	33.3018	68273688	file_unmanaged_save_data( )	.../Files.php:506
25	33.3023	68273728	file_unmanaged_move( )	.../file.inc:962
26	33.3038	68273856	drupal_chmod( )	.../file.inc:660
27	33.3038	68273856	Drupal\Core\File\FileSystem->chmod( )	.../file.inc:1108
28	33.3038	68273856	is_dir ( )	.../FileSystem.php:86
29	33.3038	68274104	Drupal\Core\StreamWrapper\LocalStream->url_stat( )	.../FileSystem.php:86
30	33.3038	68274104	Drupal\Core\StreamWrapper\LocalStream->getLocalPath( )	.../LocalStream.php:497
31	33.3040	68274232	realpath ( )	.../LocalStream.php:134
matas.k’s picture

8.3.0 is official release and advagg crashed all sites updating core from 8.2.7. Browser wsod error: The website encountered an unexpected error. Please try again later.

nginx error.log:

017/04/13 19:15:15 [error] 1596#1596: *282 FastCGI sent in stderr: "PHP message: Error: Call to a member function get() on array in /var/www/d8.site.com/htdocs/core/lib/Drupal/Core/Cache/CacheCollector.php on line 327 #0 /var/www/d8.site.com/htdocs/core/lib/Drupal/Core/Cache/CacheCollector.php(162): Drupal\Core\Cache\CacheCollector->lazyLoadCache()
#1 /var/www/d8.site.com/htdocs/core/lib/Drupal/Core/State/State.php(70): Drupal\Core\Cache\CacheCollector->set('core/themes/sta...', Array)
#2 /var/www/d8.site.com/htdocs/modules/advagg/src/State/Files.php(139): Drupal\Core\State\State->set('core/themes/sta...', Array)
#3 /var/www/d8.site.com/htdocs/modules/advagg/src/State/Files.php(202): Drupal\advagg\State\Files->scanFile('core/themes/sta...')
#4 /var/www/d8.site.com/htdocs/modules/advagg/src/Asset/AssetResolver.php(133): Drupal\advagg\State\Files->getMultiple(Array)
#5 /var/www/d8.site.com/htdocs/modules/advagg/src/Render/HtmlResponseAttachmentsProcessor.php(39): Drupal\advagg\Asset\AssetResolver->getCssAssets(Object(Drupal\Core\Asset\AttachedAss" while reading response header from upstream, client: myip, server: d8.site.com, request: "GET /admin/reports/status HTTP/2.0", upstream: "fastcgi://unix:/var/run/php/php7.0-fpm.sock:", host: "d8.site.com", referrer: "https://d8.site.com/admin/reports/status"

Disabling module via drush recovers the website.

jaypan’s picture

#11 Works for me as well on 8.3.0.

beautifulmind’s picture

The patch in #11 did not work. So, I uninstalled the advagg module. That worked.

agoradesign’s picture

Priority: Major » Critical

I've changed the priority. If this ain't critical, I don't what else could be.

@beautifulmind: it would be interesting for the maintainer as well for the rest of us, what exactly did not work in the patch. Did you get the same or a different error?

mikeytown2’s picture

Looking into this. Issue is with src/State/Files.php. Will be working on a patch that works with 8.2 and 8.3.

Fatal error: Maximum function nesting level of '500' reached, aborting! in core\lib\Drupal\Core\Config\Config.php on line 84
Call Stack
#	Time	Memory	Function	Location
1	0.0010	356848	{main}( )	...\index.php:0
2	0.0090	383992	Drupal\Core\DrupalKernel->handle( )	...\index.php:19
3	0.0370	1175784	Stack\StackedHttpKernel->handle( )	...\DrupalKernel.php:652
4	0.0370	1175784	Drupal\Core\StackMiddleware\NegotiationMiddleware->handle( )	...\StackedHttpKernel.php:23
5	0.0370	1175784	Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle( )	...\NegotiationMiddleware.php:50
6	0.0370	1175784	Drupal\page_cache\StackMiddleware\PageCache->handle( )	...\ReverseProxyMiddleware.php:47
7	0.0380	1177704	Drupal\page_cache\StackMiddleware\PageCache->pass( )	...\PageCache.php:78
8	0.0380	1177704	Drupal\Core\StackMiddleware\KernelPreHandle->handle( )	...\PageCache.php:99
9	0.0570	1359928	Drupal\Core\StackMiddleware\Session->handle( )	...\KernelPreHandle.php:47
10	0.0670	1452392	Symfony\Component\HttpKernel\HttpKernel->handle( )	...\Session.php:57
11	0.0670	1452696	Symfony\Component\HttpKernel\HttpKernel->handleRaw( )	...\HttpKernel.php:64
12	2.7832	10380400	Symfony\Component\HttpKernel\HttpKernel->filterResponse( )	...\HttpKernel.php:166
13	2.7842	10381344	Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch( )	...\HttpKernel.php:184
14	2.7882	10393080	Drupal\Core\EventSubscriber\HtmlResponseSubscriber->onRespond( )	...\ContainerAwareEventDispatcher.php:111
15	2.7882	10393080	Drupal\Core\Render\HtmlResponseAttachmentsProcessor->processAttachments( )	...\HtmlResponseSubscriber.php:45
16	2.8332	10579240	Drupal\advagg\Render\HtmlResponseAttachmentsProcessor->processAssetLibraries( )	...\HtmlResponseAttachmentsProcessor.php:161
17	2.8332	10579856	Drupal\advagg\Asset\AssetResolver->getCssAssets( )	...\HtmlResponseAttachmentsProcessor.php:39
18	3.0592	10881544	Drupal\advagg\State\Files->getMultiple( )	...\AssetResolver.php:133
19	3.0592	10881544	Drupal\Core\State\State->get( )	...\Files.php:160
20	3.0592	10881816	Drupal\advagg\State\Files->getMultiple( )	...\State.php:40
21	3.0592	10881816	Drupal\Core\State\State->get( )	...\Files.php:160
22	3.0592	10882088	Drupal\advagg\State\Files->getMultiple( )	...\State.php:40
23	3.0592	10882088	Drupal\Core\State\State->get( )	...\Files.php:160
24	3.0592	10882360	Drupal\advagg\State\Files->getMultiple( )	...\State.php:40
25	3.0592	10882360	Drupal\Core\State\State->get( )	...\Files.php:160
26	3.0592	10882632	Drupal\advagg\State\Files->getMultiple( )	...\State.php:40
27	3.0592	10882632	Drupal\Core\State\State->get( )	...\Files.php:160
...
mikeytown2’s picture

Status: Reviewed & tested by the community » Needs review
StatusFileSize
new7.01 KB

Issue is with the getMultiple method. Renamed to getMultiples and the patch works on 8.2. Will see what the testbot thinks.

Status: Needs review » Needs work

The last submitted patch, 26: 2850263-drupal-8.3compatibility-26.patch, failed testing.

mikeytown2’s picture

Status: Needs work » Needs review
StatusFileSize
new6.93 KB
mikeytown2’s picture

StatusFileSize
new7.1 KB

Getting somewhere... fails on 8.3 now.

mikeytown2’s picture

StatusFileSize
new7.09 KB
mikeytown2’s picture

Here's the change from the patch in #11

Added this to the class.

  /**
   * {@inheritdoc}
   */
  public function get($key, $default = NULL) {
    if (version_compare(\Drupal::VERSION, '8.3.0') >= 0) {
      return parent::get($key, $default);
    }
    $values = parent::getMultiple(array($key));
    return isset($values[$key]) ? $values[$key] : $default;
  }
mikeytown2’s picture

StatusFileSize
new7.04 KB

If someone more knowledgeable can step in and say why this is currently needed that would be great.

mikeytown2’s picture

@vibrasphere
That is a bug that is 1/2 fixed in D7 version of advagg.
#2852487: advagg_split_css_file() can lead to infinite loop; issue with large css files.
and
#2866766: Reordering of css selectors
Once that's fixed in D7 I'll get a patch for D8.

beautifulmind’s picture

@agoradesign, thank you for checking.

Yes, the issue still persist. I already disabled the module and does not have the error log any more. But it has something to do with some parameters in the patched file(s). I will wait till a working solution is available.

jaypan’s picture

Yes, the issue still persist. I already disabled the module and does not have the error log any more. But it has something to do with some parameters in the patched file(s). I will wait till a working solution is available.

Your problem appears to be different than what the rest of us are facing, as the patch has solved the problem for the rest of us. As such, you will be more likely to get assistance if you post your specific error, to give people something to work with. At the moment, the amount of information we have on your issues is too minimal to make it likely that anyone will be able to fix the problem.

bradjones1’s picture

Catch RTBC'd this but the status has since changed... really this should be an 8.3.x patch and then be backported if necessary. I'd change the status back, but it's my patch :-)

catch’s picture

8.2.x is no-longer supported - everyone should be updating to 8.3.x, so I'm not sure it's necessary to make the patch here backwards compatible with 8.2.x at all - maybe just add an explicit core dependency for > 8.3.0 to ensure people don't update advagg early?

Compatibility with both versions is really useful before a minor release actually comes out, but less so at this point.

dakwamine’s picture

The 2850263-drupal-8.3compatibility-32.patch works on 8.3.0. But the script snippet from #31 was unneeded:

  1. Original site is 8.2.7.
  2. composer update => core goes 8.3.0
  3. Applies the patch 2850263-drupal-8.3compatibility-32.patch.
  4. drush updb
  5. Testing: => The site doesn't crash.
  6. Commented the public function get(...) from the src/State/Files.php file. => The site doesn't crash.

  • mikeytown2 committed 0c5ed1a on 8.x-2.x
    Issue #2850263 by mikeytown2, bradjones1, Dom.: PHP Fatal error on...
mikeytown2’s picture

Status: Needs review » Fixed

Committed #32 with extra documentation about the 8.2 vs 8.3 changes. Looks like I forgot to select bradjones1 as the author when committing; sorry about that :/

agoradesign’s picture

Great to see this problem solved.. when do you plan to publish a new release?

d.fisher’s picture

Second the above. Great to see this issue fixed but any ETA on getting it in to a stable release?

kmajzlik’s picture

Please create new stable release ASAP. Drupal 8.3 is now stable and 8.2 is not supported.

scm6079’s picture

I'll add to the voices that are very much so looking for a stable release of advagg that is Drupal 8.3.x compatible. Any updates on a release? Is there something that my development team(s) or I can do to help the process?

cparkner01’s picture

Also awaiting a new release

rtackett’s picture

Another user awaiting a stable release.

@mikeytown2 , any update?

mikeytown2’s picture

Next day or 2. Doing some clean up of the code before releasing. Testing of the latest dev would be good to know.

nanobyt3’s picture

Sounds good. I am waiting for a stable release too.

sam152’s picture

Ran into this today. A stable release would be great.

sam152’s picture

Thank you @mikeytown2!

d.fisher’s picture

Amazing. On behalf of everyone thanks for all the hard work on this!!

beautifulmind’s picture

Finally, it is here!!!

Thank you!

Status: Fixed » Closed (fixed)

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