Recently I had to downgrade a simpleSAML installation from 2.1 to 2.0 for php compatibility reasons. We are running it on an Ubuntu 22 server using Apache2 and mysql for session storage. I copied all the config files and metadata from the old installation to the new one, so there has been no changes to the config between versions. Now when I go to mysite.com/simplesaml/admin to try and log into the admin console, I get an error page saying State Information Lost. Here is a copy of the backtrace:
SimpleSAML\Error\NoState: NOSTATEBacktrace:6 src/SimpleSAML/Auth/State.php:302 (SimpleSAML\Auth\State::loadState)5 modules/core/src/Controller/Login.php:116 (SimpleSAML\Module\core\Controller\Login::loginuserpass)4 vendor/symfony/http-kernel/HttpKernel.php:163 (Symfony\Component\HttpKernel\HttpKernel::handleRaw)3 vendor/symfony/http-kernel/HttpKernel.php:75 (Symfony\Component\HttpKernel\HttpKernel::handle)2 vendor/symfony/http-kernel/Kernel.php:202 (Symfony\Component\HttpKernel\Kernel::handle)1 src/SimpleSAML/Module.php:234 (SimpleSAML\Module::process)0 public/module.php:17 (N/A)
And then the error logs:
May 17 11:29:28 simplesamlphp DEBUG [de887928eb] Session: 'admin' not valid because we are not authenticated.May 17 11:29:28 simplesamlphp DEBUG [de887928eb] Session: 'login-admin' not valid because we are not authenticated.May 17 11:29:28 simplesamlphp DEBUG [de887928eb] Saved state: '_2b9d472295cf32790012325d0b0618651866e7fd23'May 17 11:29:28 simplesamlphp DEBUG [49a50f26d1] Loading state: '_2b9d472295cf32790012325d0b0618651866e7fd23'May 17 11:29:28 simplesamlphp ERROR [49a50f26d1] SimpleSAML\Error\NoState: NOSTATEMay 17 11:29:28 simplesamlphp ERROR [49a50f26d1] BacktraceMay 17 11:29:28 simplesamlphp ERROR [49a50f26d1] 6 /var/simplesamlphp/src/SimpleSAML/Auth/State.php:302 (SimpleSAML\Auth\State::loadState)May 17 11:29:28 simplesamlphp ERROR [49a50f26d1] 5 /var/simplesamlphp/modules/core/src/Controller/Login.php:116 (SimpleSAML\Module\core\Controller\Login::loginuserpass)May 17 11:29:28 simplesamlphp ERROR [49a50f26d1] 4 /var/simplesamlphp/vendor/symfony/http-kernel/HttpKernel.php:163 (Symfony\Component\HttpKernel\HttpKernel::handleRaw)May 17 11:29:28 simplesamlphp ERROR [49a50f26d1] 3 /var/simplesamlphp/vendor/symfony/http-kernel/HttpKernel.php:75 (Symfony\Component\HttpKernel\HttpKernel::handle)May 17 11:29:28 simplesamlphp ERROR [49a50f26d1] 2 /var/simplesamlphp/vendor/symfony/http-kernel/Kernel.php:202 (Symfony\Component\HttpKernel\Kernel::handle)May 17 11:29:28 simplesamlphp ERROR [49a50f26d1] 1 /var/simplesamlphp/src/SimpleSAML/Module.php:234 (SimpleSAML\Module::process)May 17 11:29:28 simplesamlphp ERROR [49a50f26d1] 0 /var/simplesamlphp/public/module.php:17 (N/A)May 17 11:29:28 simplesamlphp ERROR [49a50f26d1] Error report with id e57ceed9 generated.May 17 11:29:28 simplesamlphp DEBUG [49a50f26d1] Localization: load domain 'messages' at '/var/simplesamlphp/locales'May 17 11:29:28 simplesamlphp DEBUG [49a50f26d1] Trying langpath for 'en' as '/var/simplesamlphp/locales/en/LC_MESSAGES/'May 17 11:29:28 simplesamlphp DEBUG [49a50f26d1] Localization: load domain 'core' at '/var/simplesamlphp/modules/core/locales'May 17 11:29:28 simplesamlphp DEBUG [49a50f26d1] Trying langpath for 'en' as '/var/simplesamlphp/modules/core/locales/en/LC_MESSAGES/'
Whenever I try to visit the page again, I can see a new entry in the session database, so I know the application should be able to access the session data, but I have no idea what else could be going on here. Anyone else have any ideas?
I have tried clearing cookies, clearing session data, deleting the php session directory, changing store.type to phpsessions, none of which has made any difference. This is pretty frustrating given it was working fine with simplesaml 2.1 with the exact same configuration.