- Issue created by @alexharries
- 🇬🇧United Kingdom jrsouth
Just chipping in because I've just hit what appears to be the same (or very similar) problem after a beta2 to beta3 upgrade. We have redis in our stack too.
All requests coming via the site's default CloudFlare-cached route return the
fromRequest() must be an instance
500 error, but a separate route to the same Drupal instance without CloudFlare caching works as expected.(I imagine it's simply that the non-cached traffic doesn't trigger the module code, and therefore doesn't raise the error, but thought it was worth noting that the site can successfully handle requests with the module active and configured.)
For now I've disabled
cloudflare
andcloudflarepurger
via drush, and the site is working normally via the default route ― though obviously I'd prefer to have those modules enabled!I'm in the very early stages of diagnosing this, will add more as I learn more.
- 🇬🇧United Kingdom jrsouth
For our site this seems to be directly related to "Restore Client IP" setting.
Switching that option off (which is fine for our purposes, even desirable) resulted in a working site via the main route, proxied by Cloudflare.
I'm therefore able to move on from this issue for now, but I'll keep an eye out, and am happy to help diagnose if there are any questions.
- 🇬🇧United Kingdom alexharries
I can confirm this is a problem with "Restore client IP address".
Will update the issue title and description accordingly.
- 🇨🇦Canada brunodbo
I ran into this as well. For anyone else hitting this, you can disable the "Restore Client IP Address" option with
drush config:set cloudflare.settings client_ip_restore_enabled 0
. That made requests cached by Cloudflare work again for me. - 🇺🇸United States Albert Volkman
Seeing this in the 2.0.x branch as well. Bumping up so we can fix it there first.
- 🇺🇸United States Albert Volkman
This looks similar- https://www.drupal.org/project/drupal/issues/3243387 🐛 Argument 1 passed to Drupal\Core\Routing\RequestContext::fromRequest() must be an instance of Symfony\Component\HttpFoundation\Request, null given Closed: cannot reproduce
- 🇮🇪Ireland frankdesign
Just wondering is anyone has figured this one out. I am seeing this issues with Drupal 10.4 and Cloudflare 2.0.0-beta1. As soon as I enable "Restore Client IP Address", the entire site goes down. The only way to resolve is to use Drush to uninstall the module.