Session Fails to Start

29/07/2018


In my drupal site, it has been working fine for a while, but recently users have not been able to log in to the site (including me as admin). I am seeing the following error in my php logs:

[28-Jul-2018 20:07:02 UTC] Uncaught PHP Exception RuntimeException: "Failed to start the session" at (webroot)/vendor/symfony/http-foundation/Session/Storage/NativeSessionStorage.php line 145

I went to look at the code and i see it corresponds with the following lines:

    if (!session_start()) {
        throw new RuntimeException('Failed to start the session');
    }

I have tried clearing the sessions tables as well as the cache using core/rebuild.php and nothing seems to be working. Another note for this I had to add this line temporarily

$settings['rebuild_access'] = TRUE;

in my settings.php to get it to work also, because the token generator script was throwing another error like below:

[28-Jul-2018 20:39:01 UTC] PHP Fatal error:  Uncaught ArgumentCountError: Too few arguments to function DrupalCoreSiteSettings::initialize(), 1 passed in (webroot)/core/scripts/rebuild_token_calculator.sh on line 22 and exactly 3 expected in (webroot)/core/lib/Drupal/Core/Site/Settings.php:108

Not sure if this is related to the main error or not, but thought it may be worth mentioning.

قالب وردپرس