Internal Server Error on New User First Login

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): 24.0.3 - 24.0.3.2 SNAP EC2
Operating system and version (eg, Ubuntu 20.04): Ubuntu 20.04
Apache or nginx version (eg, Apache 2.4.25): Apache (fpm-fcgi)
PHP version (eg, 7.4): 8.0.21

The issue:
Every Time i create a new user and then do the first login, I get the blue internal server error window.
When i try the login again, without any changes, i will get a successful login and no errors afterwards.
This super annoying because I have to login into every user when i create one.

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

Steps to replicate it:

  1. Create new User
  2. Do the first login
  3. get Internal Server Error
  4. Repeat login
  5. Error is gone

The output of your Nextcloud log in Admin > Logging:

Error	index	Exception: file_exists(): Argument #1 ($filename) must be of type string, array given in file '/snap/nextcloud/31222/htdocs/lib/private/legacy/OC_Util.php' line 191
/snap/nextcloud/31222/htdocs/lib/private/AppFramework/App.php - line 172:

OC\AppFramework\Http\Dispatcher->dispatch()

/snap/nextcloud/31222/htdocs/lib/private/Route/Router.php - line 298:

OC\AppFramework\App::main()

/snap/nextcloud/31222/htdocs/lib/base.php - line 1023:

OC\Route\Router->match()

/snap/nextcloud/31222/htdocs/index.php - line 36:

OC::handleRequest()

Caused by TypeError: file_exists(): Argument #1 ($filename) must be of type string, array given
/snap/nextcloud/31222/htdocs/lib/private/legacy/OC_Util.php - line 191:

file_exists()

/snap/nextcloud/31222/htdocs/lib/private/User/Session.php - line 550:

OC_Util::copySkeleton()

/snap/nextcloud/31222/htdocs/lib/private/User/Session.php - line 403:

OC\User\Session->prepareUserLogin()

/snap/nextcloud/31222/htdocs/lib/private/Authentication/Login/CompleteLoginCommand.php - line 44:

OC\User\Session->completeLogin("*** sensiti ... *")

/snap/nextcloud/31222/htdocs/lib/private/Authentication/Login/ALoginCommand.php - line 40:

OC\Authentication\Login\CompleteLoginCommand->process()

/snap/nextcloud/31222/htdocs/lib/private/Authentication/Login/LoggedInCheckCommand.php - line 60:

OC\Authentication\Login\ALoginCommand->processNextOrFinishSuccessfully()

/snap/nextcloud/31222/htdocs/lib/private/Authentication/Login/ALoginCommand.php - line 40:

OC\Authentication\Login\LoggedInCheckCommand->process()

/snap/nextcloud/31222/htdocs/lib/private/Authentication/Login/EmailLoginCommand.php - line 58:

OC\Authentication\Login\ALoginCommand->processNextOrFinishSuccessfully()

/snap/nextcloud/31222/htdocs/lib/private/Authentication/Login/ALoginCommand.php - line 40:

OC\Authentication\Login\EmailLoginCommand->process()

/snap/nextcloud/31222/htdocs/lib/private/Authentication/Login/UidLoginCommand.php - line 54:

OC\Authentication\Login\ALoginCommand->processNextOrFinishSuccessfully()

/snap/nextcloud/31222/htdocs/lib/private/Authentication/Login/ALoginCommand.php - line 40:

OC\Authentication\Login\UidLoginCommand->process()

/snap/nextcloud/31222/htdocs/lib/private/Authentication/Login/UserDisabledCheckCommand.php - line 58:

OC\Authentication\Login\ALoginCommand->processNextOrFinishSuccessfully()

/snap/nextcloud/31222/htdocs/lib/private/Authentication/Login/ALoginCommand.php - line 40:

OC\Authentication\Login\UserDisabledCheckCommand->process()

/snap/nextcloud/31222/htdocs/lib/private/Authentication/Login/PreLoginHookCommand.php - line 53:

OC\Authentication\Login\ALoginCommand->processNextOrFinishSuccessfully()

/snap/nextcloud/31222/htdocs/lib/private/Authentication/Login/Chain.php - line 108:

OC\Authentication\Login\PreLoginHookCommand->process()

/snap/nextcloud/31222/htdocs/core/Controller/LoginController.php - line 329:

OC\Authentication\Login\Chain->process()

/snap/nextcloud/31222/htdocs/lib/private/AppFramework/Http/Dispatcher.php - line 225:

OC\Core\Controller\LoginController->tryLogin("*** sensiti ... *")

/snap/nextcloud/31222/htdocs/lib/private/AppFramework/Http/Dispatcher.php - line 133:

OC\AppFramework\Http\Dispatcher->executeController()

/snap/nextcloud/31222/htdocs/lib/private/AppFramework/App.php - line 172:

OC\AppFramework\Http\Dispatcher->dispatch()

/snap/nextcloud/31222/htdocs/lib/private/Route/Router.php - line 298:

OC\AppFramework\App::main()

/snap/nextcloud/31222/htdocs/lib/base.php - line 1023:

OC\Route\Router->match()

/snap/nextcloud/31222/htdocs/index.php - line 36:

OC::handleRequest()

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

{
    "apps_paths": [
        {
            "path": "\/snap\/nextcloud\/current\/htdocs\/apps",
            "url": "\/apps",
            "writable": false
        },
        {
            "path": "\/var\/snap\/nextcloud\/current\/nextcloud\/extra-apps",
            "url": "\/extra-apps",
            "writable": true
        }
    ],
    "supportedDatabases": [
        "mysql"
    ],
    "memcache.locking": "\\OC\\Memcache\\Redis",
    "memcache.local": "\\OC\\Memcache\\Redis",
    "redis": {
        "host": "***REMOVED SENSITIVE VALUE***",
        "port": 0
    },
    "passwordsalt": "***REMOVED SENSITIVE VALUE***",
    "secret": "***REMOVED SENSITIVE VALUE***",
    "trusted_domains": [
        "localhost",
        "***REMOVED SENSITIVE VALUE***"
    ],
    "datadirectory": "***REMOVED SENSITIVE VALUE***",
    "dbtype": "mysql",
    "version": "24.0.3.2",
    "overwrite.cli.url": "***REMOVED SENSITIVE VALUE***",
    "dbname": "***REMOVED SENSITIVE VALUE***",
    "dbhost": "***REMOVED SENSITIVE VALUE***",
    "dbport": "",
    "dbtableprefix": "oc_",
    "mysql.utf8mb4": true,
    "dbuser": "***REMOVED SENSITIVE VALUE***",
    "dbpassword": "***REMOVED SENSITIVE VALUE***",
    "installed": true,
    "instanceid": "***REMOVED SENSITIVE VALUE***",
    "mail_smtpmode": "smtp",
    "mail_sendmailmode": "smtp",
    "mail_from_address": "***REMOVED SENSITIVE VALUE***",
    "mail_domain": "***REMOVED SENSITIVE VALUE***",
    "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
    "mail_smtpport": "587",
    "mail_smtpauth": 1,
    "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
    "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
    "mail_smtpsecure": "tls",
    "maintenance": false,
    "mail_smtpauthtype": "LOGIN",
    "loglevel": 2,
    "encryption.legacy_format_support": true,
    "encryption.key_storage_migrated": false,
    "twofactor_enforced": "true",
    "twofactor_enforced_groups": [
        "2FA"
    ],
    "twofactor_enforced_excluded_groups": [],
    "skeletondirectory": {
        "": ""
    },
    "remember_login_cookie_lifetime": 0,
    "session_lifetime": 3600,
    "session_keepalive": false
}

The output of your Apache/nginx/system log in /var/log/____:

cant find the logs in the snap package

PASTE HERE


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.

PASTE HERE