grav: Undefined index: samesite
I got used to Grav updates being so seamless that this one surprised me a lot. Right after I clicked upgrade from version 1.6.28 to 1.6.29 it threw this error:
Server Error
Sorry, something went terribly wrong!
E_NOTICE - Undefined index: samesite
For further details please review your logs/ folder, or enable displaying of errors in your system configuration.
This is in the logs:
[2020-12-04 07:34:21] grav.CRITICAL: Undefined index: samesite - Trace: #0 system/src/Grav/Common/Debugger.php(352): Whoops\Run->handleError(8, 'Undefined index...', '/var/www/johnli...', 221) #1 system/src/Grav/Framework/Session/Session.php(221): Grav\Common\Debugger->deprecatedErrorHandler(8, 'Undefined index...', '/var/www/johnli...', 221, Array) #2 system/src/Grav/Common/Session.php(38): Grav\Framework\Session\Session->start() #3 system/src/Grav/Common/Processors/InitializeProcessor.php(69): Grav\Common\Session->init() #4 system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php(45): Grav\Common\Processors\InitializeProcessor->process(Object(Nyholm\Psr7\ServerRequest), Object(Grav\Framework\RequestHandler\RequestHandler)) #5 system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php(57): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest)) #6 system/src/Grav/Common/Processors/DebuggerProcessor.php(27): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest)) #7 system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php(45): Grav\Common\Processors\DebuggerProcessor->process(Object(Nyholm\Psr7\ServerRequest), Object(Grav\Framework\RequestHandler\RequestHandler)) #8 system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php(57): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest)) #9 system/src/Grav/Common/Processors/ErrorsProcessor.php(27): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest)) #10 system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php(45): Grav\Common\Processors\ErrorsProcessor->process(Object(Nyholm\Psr7\ServerRequest), Object(Grav\Framework\RequestHandler\RequestHandler)) #11 system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php(57): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest)) #12 system/src/Grav/Common/Processors/LoggerProcessor.php(48): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest)) #13 system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php(45): Grav\Common\Processors\LoggerProcessor->process(Object(Nyholm\Psr7\ServerRequest), Object(Grav\Framework\RequestHandler\RequestHandler)) #14 system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php(57): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest)) #15 system/src/Grav/Common/Processors/ConfigurationProcessor.php(49): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest)) #16 system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php(45): Grav\Common\Processors\ConfigurationProcessor->process(Object(Nyholm\Psr7\ServerRequest), Object(Grav\Framework\RequestHandler\RequestHandler)) #17 system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php(57): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest)) #18 system/src/Grav/Common/Grav.php(272): Grav\Framework\RequestHandler\RequestHandler->handle(Object(Nyholm\Psr7\ServerRequest)) #19 index.php(54): Grav\Common\Grav->process() #20 {main} [] []
It’s related to https://github.com/getgrav/grav/pull/3063/files#diff-8395517ec427cbc98337890b3f77e0e6ddb3c2f34c6f03ecea9dccffacaee108R221
I can load the frontend of my page when I clear cookies. But if I click on some link I get the error again. Administration is not usable. My site is down. 🔥
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 17 (6 by maintainers)
The new build should be there already and upgrade should be working again.
What comes to Grav, it will only support officially maintained versions of PHP. If you’re not willing to upgrade our OS every couple of years, you shouldn’t be using Grav. Upgrading Ubuntu to the latest stable is really easy and many service providers support installing multiple (and latest) versions of PHP out of the box. Some servers even give the possibility to choose the version of PHP per site. We are soon going to be updating the next development version of Grav 2.0 to require either PHP 7.4 or 8.0, depending what the estimated release cycle will be.
Also, it is really easy to just copy Grav to a new server…
@escopecz https://wiki.ubuntu.com/SecurityTeam/FAQ https://askubuntu.com/questions/1275384/ubuntu-18-04-lts-and-php-7-2-security-support-eol these are some link relative to Ubuntu LTS, but other Linux distributions have similar policies for their LTS versions.
Quick fix for those of you in broken state:
replace the
system/src/Grav/Framework/Session/Session.phpwith this file:https://raw.githubusercontent.com/getgrav/grav/develop/system/src/Grav/Framework/Session/Session.php
@ConteZero you should not want to upgrade PHP version only for Grav. The right reason is to upgrade to PHP 7.3 because 7.2 won’t get any security fixes anymore. See https://www.php.net/supported-versions.php