When user is not logged in, some redirects fail and the user gets the message:
"The website encountered an unexpected error. Please try again later."

The logs show:
"Error: Call to a member function getTimestamp() on null in Drupal\page_cache\StackMiddleware\PageCache->storeResponse() (line 262 of /public_html/core/modules/page_cache/src/StackMiddleware/PageCache.php) "

I'm wondering if this is related to this issue - https://www.drupal.org/node/2573807 - though the fact that that is still open after two years would tend to suggest that it's not considered critical.

Comments

gmaxwelled created an issue. See original summary.

gmaxwelled’s picture

Re-saving the redirect as a 307 seems to resolve the issue. I still get the problem with 301s.

paulkittredge’s picture

For what it's worth, I've turned off page caching (not an ideal long-term solution) and that seems to fix it. But I'd love to see a fix too! Note that this only seems to be a problem on Drupal 8.4 sites; I have a Drupal 8.3.7 site where I can't replicate this problem.

danthorne’s picture

Changing the redirect to a 307 got around it for me.

0xl337’s picture

It's happening to me too. Since the migration to 8.4.0, I have the same 500 Error.

wim leers’s picture

wim leers’s picture

Status: Active » Postponed (maintainer needs more info)
Issue tags: +Needs steps to reproduce
darkstartom’s picture

I'm getting the same error after upgrading to Drupal 8.4. I wasn't getting it on 8.3.4.

freelock’s picture

Same as DarkstarTom -- after upgrading to 8.4, we started seeing this on some pages with an active redirect. The latest patch on #2573807 fixed the issue for us -- patch applied with an offset of 25 lines.

robertoguzman’s picture

Hi freelock, would you like to provide the link to patch #2573807

Thank you

wim leers’s picture

Status: Postponed (maintainer needs more info) » Closed (duplicate)

#2573807: Fatal error: Call to a member function getTimestamp() was just committed to Drupal core 8.4 and 8.5!

Christophe Bourgois’s picture

Update to Drupal core 8.4.2 worked for me, the patch #2573807 in included
Thanks !