WSOD while sending headers, probably Cache-related
-
16-02-2021 - |
Frage
I have a very strange problem with a fresh Drupal install: On some pages, I receive a WSOD with ERR_EMPTY_RESPONSE
:
It happens for instance when on admin/config/development/performance
I click Clear all caches. (But also other pages are affected – for instance the Layout Builder page of a Node type.)
Interestingly, I could isolate the bug down here: If in vendor/symfony/http-foundation/Response.php::sendHeaders()
I tweak the code so that it unsets a lot of the headers to be sent (actually, all of them but X-Generator
and X-Frame-Options
), the error disappears.
...
$headers = $this->headers->allPreserveCaseWithoutCookies();
unset($headers['Cache-Control']);
unset($headers['Content-language']);
unset($headers['Date']);
unset($headers['X-Drupal-Dynamic-Cache']);
unset($headers['X-UA-Compatible']);
unset($headers['X-Content-Type-Options']);
unset($headers['Expires']);
unset($headers['Vary']);
foreach ($headers as $name => $values) {
...
Based on the headers I unset, it seems that it is a caching-related problem. (However, Caching is switched off, Browser and proxy cache maximum age is set to <no caching>
.)
My setup:
- installed Drupal 8.7.5 via composer
- on my local machine, a MacBook Pro with macOS High Sierra
- installed via Homebrew
- PHP 7.3
- Apache 2.4
- MySQL 5.7.24
Any idea what the problem might be?
Edit: Regarding Apache error logs: I first had no entries there but now I debugged again and saw such one:
[core:notice] [pid 92592] AH00052: child pid 98466 exit signal Bus error (10)
Googling gave the suggestion to apc_clear_cache();
but it's not available in PHP7. So I ran opcache-reset().
Result: Problem is still there, now already when opening the page admin/config/development/performance
.
Now the error logs say:
[core:notice] [pid 7428] AH00052: child pid 7446 exit signal Segmentation fault
Google suggests this is likely caused by a syntax error in php.ini
or some included extension there. Thus I have taken out all extensions, including
zend_extension=/usr/local/opt/php/lib/php/20180731/opcache.so
but the problem remains.
Edit 2: Here's the output of my php -i
(It uses the same php.ini
file as phpinfo()
in localhost). https://pastebin.com/ppvCpPA6
Lösung
Now I could solve it myself. My Apache error logs did show
AH00052: child pid 7363 exit signal Segmentation fault (11)
so it must have been a problem with the Apache config.
I took the opportunity to reinstall Apache and configure it with FCGI/FPM according to this and now the problem is gone.
Andere Tipps
I have same issue with set debug mode when run
drupal smo dev
Problem will gone If I set to prod mode
drupal smo prod
After sometime debug I found problem because cache tag header. And I change
http.response.debug_cacheability_headers: true
to
http.response.debug_cacheability_headers: false
It's working again.