Internal Servererror - Failed to create (read) session ID

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 20.0.5): 21.0.3.1
Operating system and version (eg, Ubuntu 20.04): Linux 4.19.0-23-amd64 x86_64- Running in Docker on a UCS Server
Apache or nginx version (eg, Apache 2.4.25): replace me
PHP version (eg, 7.4): 7.4.3

The issue you are facing:

Is this the first time you’ve seen this error? (Y/N): N

Steps to replicate it:

The output of your Nextcloud log in Admin > Logging:

{"reqId":"RS3TjpwG9Rne2OC4H2ch","level":3,"time":"2023-07-18T06:43:03+00:00","remoteAddr":"87.79.70.206","user":"--","app":"index","method":"POST","url":"/nextcloud/login","message":{"Exception":"ErrorException","Message":"Failed to create(read) session ID: files (path: /var/lib/php/sessions)","Code":0,"Trace":[{"file":"/var/www/html/lib/private/Session/Internal.php","line":139,"function":"trapError","class":"OC\\Session\\Internal","type":"->"},{"file":"/var/www/html/lib/private/Session/CryptoSessionData.php","line":161,"function":"regenerateId","class":"OC\\Session\\Internal","type":"->"},{"file":"/var/www/html/lib/private/User/Session.php","line":386,"function":"regenerateId","class":"OC\\Session\\CryptoSessionData","type":"->"},{"file":"/var/www/html/lib/private/Authentication/Login/CompleteLoginCommand.php","line":44,"function":"completeLogin","class":"OC\\User\\Session","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/lib/private/Authentication/Login/ALoginCommand.php","line":40,"function":"process","class":"OC\\Authentication\\Login\\CompleteLoginCommand","type":"->"},{"file":"/var/www/html/lib/private/Authentication/Login/LoggedInCheckCommand.php","line":60,"function":"processNextOrFinishSuccessfully","class":"OC\\Authentication\\Login\\ALoginCommand","type":"->"},{"file":"/var/www/html/lib/private/Authentication/Login/ALoginCommand.php","line":40,"function":"process","class":"OC\\Authentication\\Login\\LoggedInCheckCommand","type":"->"},{"file":"/var/www/html/lib/private/Authentication/Login/EmailLoginCommand.php","line":58,"function":"processNextOrFinishSuccessfully","class":"OC\\Authentication\\Login\\ALoginCommand","type":"->"},{"file":"/var/www/html/lib/private/Authentication/Login/ALoginCommand.php","line":40,"function":"process","class":"OC\\Authentication\\Login\\EmailLoginCommand","type":"->"},{"file":"/var/www/html/lib/private/Authentication/Login/UidLoginCommand.php","line":54,"function":"processNextOrFinishSuccessfully","class":"OC\\Authentication\\Login\\ALoginCommand","type":"->"},{"file":"/var/www/html/lib/private/Authentication/Login/ALoginCommand.php","line":40,"function":"process","class":"OC\\Authentication\\Login\\UidLoginCommand","type":"->"},{"file":"/var/www/html/lib/private/Authentication/Login/UserDisabledCheckCommand.php","line":58,"function":"processNextOrFinishSuccessfully","class":"OC\\Authentication\\Login\\ALoginCommand","type":"->"},{"file":"/var/www/html/lib/private/Authentication/Login/ALoginCommand.php","line":40,"function":"process","class":"OC\\Authentication\\Login\\UserDisabledCheckCommand","type":"->"},{"file":"/var/www/html/lib/private/Authentication/Login/PreLoginHookCommand.php","line":53,"function":"processNextOrFinishSuccessfully","class":"OC\\Authentication\\Login\\ALoginCommand","type":"->"},{"file":"/var/www/html/lib/private/Authentication/Login/Chain.php","line":108,"function":"process","class":"OC\\Authentication\\Login\\PreLoginHookCommand","type":"->"},{"file":"/var/www/html/core/Controller/LoginController.php","line":310,"function":"process","class":"OC\\Authentication\\Login\\Chain","type":"->"},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":218,"function":"tryLogin","class":"OC\\Core\\Controller\\LoginController","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":127,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/html/lib/private/AppFramework/App.php","line":157,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/var/www/html/lib/private/Route/Router.php","line":302,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/var/www/html/lib/base.php","line":993,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/var/www/html/index.php","line":37,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/html/lib/private/Session/Internal.php","Line":185,"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36","version":"21.0.3.1"}

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'passwordsalt' => '************',
  'secret' => '************,
  'trusted_domains' => 
  array (
    0 => '************',
    1 => '************',
  ),
  'datadirectory' => '/var/lib/univention-appcenter/apps/nextcloud/data/nextcloud-data',
  'dbtype' => 'pgsql',
  'version' => '21.0.3.1',
  'overwrite.cli.url' => '************',
  'dbname' => 'nextcloud',
  'dbhost' => '************',
  'dbport' => '5432',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'nextcloud',
  'dbpassword' => '************',
  'installed' => true,
  'instanceid' => 'ocbmgogx7l7c',
  'updatechecker' => 'false',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'overwriteprotocol' => 'https',
  'overwritewbroot' => '/nextcloud',
  'htaccess.RewriteBase' => '/nextcloud',
  'ldapIgnoreNamingRules' => false,
  'ldapProviderFactory' => 'OCA\\User_LDAP\\LDAPProviderFactory',
  'trusted_proxies' => 
  array (
    0 => '************',
  ),
  'loglevel' => 2,
  'maintenance' => false,
  'memcache.distributed' => '\\OC\\Memcache\\APCu',
);

Output errors in nextcloud.log in /var/www/ or as admin user in top right menu, filtering for errors. Use a pastebin service if necessary.

{“reqId”:“RS3TjpwG9Rne2OC4H2ch”,“level”:3,“time”:“2023-07-18T06:43:03+00:00”,“remoteAddr”:“87.79.70.206”,“user”:“–”,“app”:“index”,“method”:“POST”,“url”:“/nextcloud/login”,“message”:{“Exception”:“ErrorException”,“Message”:“Failed to create(read) session ID: files (path: /var/lib/php/sessions)”,“Code”:0,“Trace”:[{“file”:“/var/www/html/lib/private/Session/Internal.php”,“line”:139,“function”:“trapError”,“class”:“OC\Session\Internal”,“type”:“->”},{“file”:“/var/www/html/lib/private/Session/CryptoSessionData.php”,“line”:161,“function”:“regenerateId”,“class”:“OC\Session\Internal”,“type”:“->”},{“file”:“/var/www/html/lib/private/User/Session.php”,“line”:386,“function”:“regenerateId”,“class”:“OC\Session\CryptoSessionData”,“type”:“->”},{“file”:“/var/www/html/lib/private/Authentication/Login/CompleteLoginCommand.php”,“line”:44,“function”:“completeLogin”,“class”:“OC\User\Session”,“type”:“->”,“args”:[“*** sensitive parameters replaced “]},{“file”:”/var/www/html/lib/private/Authentication/Login/ALoginCommand.php",“line”:40,“function”:“process”,“class”:“OC\Authentication\Login\CompleteLoginCommand”,“type”:“->”},{“file”:“/var/www/html/lib/private/Authentication/Login/LoggedInCheckCommand.php”,“line”:60,“function”:“processNextOrFinishSuccessfully”,“class”:“OC\Authentication\Login\ALoginCommand”,“type”:“->”},{“file”:“/var/www/html/lib/private/Authentication/Login/ALoginCommand.php”,“line”:40,“function”:“process”,“class”:“OC\Authentication\Login\LoggedInCheckCommand”,“type”:“->”},{“file”:“/var/www/html/lib/private/Authentication/Login/EmailLoginCommand.php”,“line”:58,“function”:“processNextOrFinishSuccessfully”,“class”:“OC\Authentication\Login\ALoginCommand”,“type”:“->”},{“file”:“/var/www/html/lib/private/Authentication/Login/ALoginCommand.php”,“line”:40,“function”:“process”,“class”:“OC\Authentication\Login\EmailLoginCommand”,“type”:“->”},{“file”:“/var/www/html/lib/private/Authentication/Login/UidLoginCommand.php”,“line”:54,“function”:“processNextOrFinishSuccessfully”,“class”:“OC\Authentication\Login\ALoginCommand”,“type”:“->”},{“file”:“/var/www/html/lib/private/Authentication/Login/ALoginCommand.php”,“line”:40,“function”:“process”,“class”:“OC\Authentication\Login\UidLoginCommand”,“type”:“->”},{“file”:“/var/www/html/lib/private/Authentication/Login/UserDisabledCheckCommand.php”,“line”:58,“function”:“processNextOrFinishSuccessfully”,“class”:“OC\Authentication\Login\ALoginCommand”,“type”:“->”},{“file”:“/var/www/html/lib/private/Authentication/Login/ALoginCommand.php”,“line”:40,“function”:“process”,“class”:“OC\Authentication\Login\UserDisabledCheckCommand”,“type”:“->”},{“file”:“/var/www/html/lib/private/Authentication/Login/PreLoginHookCommand.php”,“line”:53,“function”:“processNextOrFinishSuccessfully”,“class”:“OC\Authentication\Login\ALoginCommand”,“type”:“->”},{“file”:“/var/www/html/lib/private/Authentication/Login/Chain.php”,“line”:108,“function”:“process”,“class”:“OC\Authentication\Login\PreLoginHookCommand”,“type”:“->”},{“file”:“/var/www/html/core/Controller/LoginController.php”,“line”:310,“function”:“process”,“class”:“OC\Authentication\Login\Chain”,“type”:“->”},{“file”:“/var/www/html/lib/private/AppFramework/Http/Dispatcher.php”,“line”:218,“function”:“tryLogin”,“class”:“OC\Core\Controller\LoginController”,“type”:“->”,“args”:[" sensitive parameters replaced ***”]},{“file”:“/var/www/html/lib/private/AppFramework/Http/Dispatcher.php”,“line”:127,“function”:“executeController”,“class”:“OC\AppFramework\Http\Dispatcher”,“type”:“->”},{“file”:“/var/www/html/lib/private/AppFramework/App.php”,“line”:157,“function”:“dispatch”,“class”:“OC\AppFramework\Http\Dispatcher”,“type”:“->”},{“file”:“/var/www/html/lib/private/Route/Router.php”,“line”:302,“function”:“main”,“class”:“OC\AppFramework\App”,“type”:“::”},{“file”:“/var/www/html/lib/base.php”,“line”:993,“function”:“match”,“class”:“OC\Route\Router”,“type”:“->”},{“file”:“/var/www/html/index.php”,“line”:37,“function”:“handleRequest”,“class”:“OC”,“type”:“::”}],“File”:“/var/www/html/lib/private/Session/Internal.php”,“Line”:185,“CustomMessage”:“–”},“userAgent”:“Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36”,“version”:“21.0.3.1”}



Any ideas to fix the issue?

Hi @D941x99 -

That’s a really really old version of NC. Is this an existing installation that just hasn’t been upgraded in a LONG time or is that a new installation you’re attempting?

Anyhow…

This path doesn’t exist or is unreadable or unwritable for some reason. It’s where PHP in your environment is (apparently) set up to keep session data (which is critical).

I’m not familiar with the UCS stuff, other than having run across it mentioned a few times. Doesn’t it have its own support channel or something? I ask because my understand is it’s turnkey environment or something. Some of the conventional solutions might not be appropriate for it.