Sessions expire unexpected

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): 20.0.10
Operating system and version (eg, Ubuntu 20.04): Linux dd44234 5.4.0-74
Apache or nginx version (eg, Apache 2.4.25): Apache 2
PHP version (eg, 7.4): 7.4.19

The issue you are facing:
Sessions expire unexpected, so after logging into my account, I’m automatically logged out after a random (the least time was about 10 minutes, the maximum is a few hours) time. Most of the time I’m using the rainloop mail app.
Also the calDAV clients (iPhone, iPad) ask for the account password repeatedly, I’m not sure if both problems are connected to each other. The calDAV accounts are configured with app-passwords, so I’m quite confused why the password seems to be rejected after a while (see screenshot).

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

Steps to replicate it:

  1. Logging into my account (user + pw, submit form, [sometimes do that twice, I don’t know why], entering OTP (2FA)
  2. Open rainloop app
  3. Wait
  4. Update mail list
  5. Either I’m being logged out (mail list displays an error) or not
    5a. When I’m in the Admin > Logging section, I’m getting logged out and redirected to the login page

The logging entries (Login failed) are quite weird because the login credentials are stored in the browser (I’m using Edge most of the time). Interesting: When I’m automatically redirected to the login page, the font of the login details seems to be “unformated”, but when I click into one of the both fields, the font is getting formated (see screenshots)

The output of your Nextcloud log in Admin > Logging:

Info	no app in context	Deprecated event type for OCP\Authentication\TwoFactorAuth\IProvider::success: Symfony\Component\EventDispatcher\GenericEvent is used		2021-07-07T08:48:02+0200
Warning	core	Login failed: 'stefan' (Remote IP: '213.52.102.79')		2021-07-07T08:45:56+0200
Info	no app in context	Deprecated event type for OCP\Authentication\TwoFactorAuth\IProvider::success: Symfony\Component\EventDispatcher\GenericEvent is used		2021-07-07T08:40:00+0200
Warning	core	Login failed: 'stefan' (Remote IP: '213.52.102.79')		2021-07-07T08:15:57+0200
Info	no app in context	Deprecated event type for OCP\Authentication\TwoFactorAuth\IProvider::success: Symfony\Component\EventDispatcher\GenericEvent is used		2021-07-07T08:09:57+0200
Info	nextbackup	nextbackup removed backup 1625378701		2021-07-07T07:35:03+0200
Info	nextbackup	nextbackup created a backup to '/www/htdocs/XXXXX/XXXXX.com/cloud/STATIC_DATA_DIR/ownbackup/1625636101'		2021-07-07T07:35:03+0200
Info	nextbackup	nextbackup removed backup 1625367001		2021-07-07T04:25:03+0200
Info	nextbackup	nextbackup created a backup to '/www/htdocs/XXXXX/XXXXX.com/cloud/STATIC_DATA_DIR/ownbackup/1625624702'		2021-07-07T04:25:03+0200
Info	no app in context	Deprecated event type for {"[object] (OCP\SabrePluginEvent)":{"*statusCode":200,"*message":"","*server":{"[object] (OCA\DAV\Connector\Sabre\Server)":{"tree":"[object] (OCA\DAV\Connector\Sabre\ObjectTree)","*baseUri":"/remote.php/webdav/","httpResponse":"[object] (Sabre\HTTP\Response)","httpRequest":"[object] (Sabre\HTTP\Request)","sapi":"[object] (Sabre\HTTP\Sapi)","*plugins":[],"transactionType":null,"protectedProperties":{"...":"Over 20 items, aborting normalization"},"debugExceptions":false,"resourceTypeMapping":[],"enablePropfindDepthInfinity":true,"xml":"[object] (Sabre\DAV\Xml\Service)","*listeners":{"...":"Over 20 items, aborting normalization"},"*wildcardListeners":[],"*listenerIndex":[],"*logger":null}},"Symfony\Contracts\EventDispatcher\EventpropagationStopped":false}}: null		2021-07-07T03:04:40+0200
Info	no app in context	Deprecated event type for {"[object] (OCP\SabrePluginEvent)":{"*statusCode":200,"*message":"","*server":{"[object] (OCA\DAV\Connector\Sabre\Server)":{"tree":"[object] (OCA\DAV\Connector\Sabre\ObjectTree)","*baseUri":"/remote.php/webdav/","httpResponse":"[object] (Sabre\HTTP\Response)","httpRequest":"[object] (Sabre\HTTP\Request)","sapi":"[object] (Sabre\HTTP\Sapi)","*plugins":[],"transactionType":null,"protectedProperties":{"...":"Over 20 items, aborting normalization"},"debugExceptions":false,"resourceTypeMapping":[],"enablePropfindDepthInfinity":true,"xml":"[object] (Sabre\DAV\Xml\Service)","*listeners":{"...":"Over 20 items, aborting normalization"},"*wildcardListeners":[],"*listenerIndex":[],"*logger":null}},"Symfony\Contracts\EventDispatcher\EventpropagationStopped":false}}: null		2021-07-07T03:04:39+0200
Info	no app in context	Deprecated event type for {"[object] (OCP\SabrePluginEvent)":{"*statusCode":200,"*message":"","*server":{"[object] (OCA\DAV\Connector\Sabre\Server)":{"tree":"[object] (OCA\DAV\Connector\Sabre\ObjectTree)","*baseUri":"/remote.php/webdav/","httpResponse":"[object] (Sabre\HTTP\Response)","httpRequest":"[object] (Sabre\HTTP\Request)","sapi":"[object] (Sabre\HTTP\Sapi)","*plugins":[],"transactionType":null,"protectedProperties":{"...":"Over 20 items, aborting normalization"},"debugExceptions":false,"resourceTypeMapping":[],"enablePropfindDepthInfinity":true,"xml":"[object] (Sabre\DAV\Xml\Service)","*listeners":{"...":"Over 20 items, aborting normalization"},"*wildcardListeners":[],"*listenerIndex":[],"*logger":null}},"Symfony\Contracts\EventDispatcher\EventpropagationStopped":false}}: null		2021-07-07T03:04:38+0200
Info	nextbackup	nextbackup removed backup 1625355601		2021-07-07T01:15:03+0200
Info	nextbackup	nextbackup created a backup to '/www/htdocs/XXXXX/XXXXX.com/cloud/STATIC_DATA_DIR/ownbackup/1625613301'		2021-07-07T01:15:03+0200
Info	no app in context	Deprecated event type for {"[object] (OCP\SabrePluginEvent)":{"*statusCode":200,"*message":"","*server":{"[object] (OCA\DAV\Connector\Sabre\Server)":{"tree":"[object] (OCA\DAV\Connector\Sabre\ObjectTree)","*baseUri":"/remote.php/webdav/","httpResponse":"[object] (Sabre\HTTP\Response)","httpRequest":"[object] (Sabre\HTTP\Request)","sapi":"[object] (Sabre\HTTP\Sapi)","*plugins":[],"transactionType":null,"protectedProperties":{"...":"Over 20 items, aborting normalization"},"debugExceptions":false,"resourceTypeMapping":[],"enablePropfindDepthInfinity":true,"xml":"[object] (Sabre\DAV\Xml\Service)","*listeners":{"...":"Over 20 items, aborting normalization"},"*wildcardListeners":[],"*listenerIndex":[],"*logger":null}},"Symfony\Contracts\EventDispatcher\EventpropagationStopped":false}}: null		2021-07-07T01:00:00+0200
Info	nextbackup	nextbackup removed backup 1625344201		2021-07-06T22:05:02+0200
Info	nextbackup	nextbackup created a backup to '/www/htdocs/XXXXX/XXXXX.com/cloud/STATIC_DATA_DIR/ownbackup/1625601901'		2021-07-06T22:05:02+0200
Info	nextbackup	nextbackup removed backup 1625332801		2021-07-06T18:55:03+0200
Info	nextbackup	nextbackup created a backup to '/www/htdocs/XXXXX/XXXXX.com/cloud/STATIC_DATA_DIR/ownbackup/1625590501'		2021-07-06T18:55:03+0200
Info	suspicious_login	OCA\SuspiciousLogin\Exception\InsufficientDataException: Insufficient data: Not enough data for the specified maximum age		2021-07-06T17:40:01+0200
Warning	core	Login failed: 'stefan' (Remote IP: '213.52.102.79')		2021-07-06T17:06:00+0200
Info	no app in context	Deprecated event type for OCP\Authentication\TwoFactorAuth\IProvider::success: Symfony\Component\EventDispatcher\GenericEvent is used		2021-07-06T16:59:56+0200
Warning	core	Renewing session token failed		2021-07-06T16:52:24+0200
Warning	core	Login failed: 'stefan' (Remote IP: '213.52.102.79')		2021-07-06T16:52:23+0200
Info	nextbackup	nextbackup removed backup 1625321401		2021-07-06T16:20:02+0200
Info	nextbackup	nextbackup created a backup to '/www/htdocs/XXXXX/XXXXX.com/cloud/STATIC_DATA_DIR/ownbackup/1625581201'		2021-07-06T16:20:02+0200

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

<?php
$CONFIG = array (
  'instanceid' => 'XXXXX',
  'passwordsalt' => 'XXXXX',
  'secret' => 'XXXXX',
  'trusted_domains' => 
  array (
    0 => 'update.cloud.XXXXX.com',
    1 => 'cloud.XXXXX.com',
  ),
  'datadirectory' => '/www/htdocs/XXXXX/XXXXX/cloud/STATIC_DATA_DIR',
  'overwrite.cli.url' => 'https://cloud.XXXXX.com',
  'overwriteprotocol' => 'https',
  'dbtype' => 'mysql',
  'version' => '20.0.10.1',
  'dbname' => 'XXXXX',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'XXXXX',
  'dbuser' => 'XXXXX',
  'dbpassword' => 'XXXXX',
  'logtimezone' => 'UTC',
  'installed' => true,
  'imap_host' => 'XXXXX.com',
  'imap_inHost' => 'XXXXX.XXXXX.com',
  'imap_inPort' => 143,
  'imap_inSSL' => 'tls',
  'imap_outHost' => 'XXXXX.XXXXX.com',
  'imap_outPort' => 587,
  'imap_outSSL' => 'tls',
  'imap_ud_host' => 'https://ud.XXXXX.com',
  'user_backends' => 
  array (
    0 => 
    array (
      'class' => 'OC_User_IMAP_wUD',
      'arguments' => 
      array (
        0 => '{XXXXX.XXXXX.com:993/imap/ssl}',
      ),
    ),
  ),
  'appstore.experimental.enabled' => true,
  'maintenance' => false,
  'theme' => '',
  'loglevel' => 0,
  'updater.release.channel' => 'stable',
  'mail_from_address' => 'admin',
  'mail_smtpmode' => 'sendmail',
  'mail_domain' => 'cloud.XXXXX.com',
  'tempdirectory' => '/www/htdocs/XXXXX/XXXXX.com/cloud/STATIC_DATA_DIR/tmp',
  'mail_sendmailmode' => 'pipe',
  'app_install_overwrite' => 
  array (
    0 => 'mail',
    1 => 'occweb',
  ),
  'twofactor_enforced' => 'true',
  'twofactor_enforced_groups' => 
  array (
    0 => 'XXXXX',
    1 => 'XXXXX',
  ),
  'session_lifefime' => 86400, //24x60x60
  'session_keepalive' => true,
  'twofactor_enforced_excluded_groups' => 
  array (
  ),
  'lost_password_link' => 'disabled',
  'simpleSignUpLink.shown' => false,
);

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

No logs

sc_00
sc_01
sc_02