Cannot login after PHP switch from PHP7.3 to PHP7.4

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
Operating system and version (eg, Ubuntu 20.04): CentOS7
Apache or nginx version (eg, Apache 2.4.25): Apache 2.4.6
PHP version (eg, 7.4): 7.3 - 7.4

The issue you are facing:

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

Steps to replicate it:

  1. Switch PHP7.3 to PHP7.4
  2. Login

The output of your Nextcloud log in Admin > Logging:

Cannot check

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

<?php
$CONFIG = array (
  'instanceid' => '',
  'passwordsalt' => '',
  'datadirectory' => '/var/www/clients/client1/web21/web/data',
  'dbtype' => 'mysql',
  'version' => '21.0.0.18',
  'dbname' => 'c1_cloud',
  'dbhost' => '127.0.0.1',
  'dbtableprefix' => 'oc_',
  'dbuser' => '',
  'dbpassword' => '',
  'installed' => true,
  'loglevel' => 0,
  'maintenance' => false,
  'theme' => '',
  'default_phone_region' => 'IT',
  'trusted_domains' => 
  array (
    0 => 'cloud.xefil.com',
  ),
  'share_folder' => '/Shared',
  'secret' => 'Ykc+au2FkuCy/+',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => 'localhost',
    'port' => 6379,
  ),
  'updater.release.channel' => 'beta',
  'overwrite.cli.url' => '',
  'app_install_overwrite' => 
  array (
    0 => 'calendar',
    1 => 'facerecognition',
  ),
  'mysql.utf8mb4' => true,
  'updater.secret' => '',
);

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

nothing interesting

Hello,
I’ve succesfully updated Nextcloud to V21 with PHP7.3 on ISPConfig with php-Fast-cgi. After switching to PHP7.4 I cannot login anymore.
Any suggestion on how to debug?
Thanks!

Simon

Please post some entrys from /path/to/nextcloud/data/nextcloud.log

Hello @devnull

Ok, switching to PHP7.4 (CGI/FastCGI), a phpinfo() page shows that’s correctly switched.
If I’m still logged in, I can continue to navigate the Nextcloud page and generate a support-page, which i post here:

## Server configuration detail

**Operating system:** Linux 3.10.0-957.21.3.el7.x86_64 #1 SMP Tue Jun 18 16:35:19 UTC 2019 x86_64

**Webserver:** Apache (cgi-fcgi)

**Database:** mysql 10.3.16

**PHP version:** 7.4.16

Modules loaded: Core, date, libxml, openssl, pcre, zlib, filter, hash, pcntl, readline, Reflection, SPL, session, standard, cgi-fcgi, bcmath, bz2, calendar, ctype, curl, dom, mbstring, fileinfo, ftp, gd, gettext, gmp, iconv, intl, json, exif, mysqlnd, PDO, Phar, posix, shmop, SimpleXML, soap, sockets, sqlite3, sysvmsg, sysvsem, sysvshm, tokenizer, xml, xmlwriter, xsl, mcrypt, mysqli, pdo_mysql, pdo_sqlite, xmlreader, xmlrpc, apcu, igbinary, imagick, msgpack, pdlib, uploadprogress, zip, redis, Zend OPcache

**Nextcloud version:** 21.0.0 - 21.0.0.18

**Updated from an older Nextcloud/ownCloud or fresh install:**

**Where did you install Nextcloud from:** unknown

<details><summary>Signing status</summary>

Array ( )

</details>

<details><summary>List of activated apps</summary>

```
Enabled:
 - accessibility: 1.7.0
 - activity: 2.14.3
 - calendar: 2.1.3
 - cloud_federation_api: 1.4.0
 - comments: 1.11.0
 - contacts: 3.4.3
 - contactsinteraction: 1.2.0
 - dashboard: 7.1.0
 - dav: 1.17.1
 - deck: 1.3.1
 - federatedfilesharing: 1.11.0
 - federation: 1.11.0
 - files: 1.16.0
 - files_external: 1.12.0
 - files_pdfviewer: 2.1.0
 - files_rightclick: 1.0.0
 - files_sharing: 1.13.1
 - files_trashbin: 1.11.0
 - files_versions: 1.14.0
 - files_videoplayer: 1.10.0
 - firstrunwizard: 2.10.0
 - logreader: 2.6.0
 - lookup_server_connector: 1.9.0
 - maps: 0.1.8
 - metadata: 0.13.0
 - nextcloud_announcements: 1.10.0
 - notifications: 2.9.0
 - oauth2: 1.9.0
 - password_policy: 1.11.0
 - photos: 1.3.0
 - privacy: 1.5.0
 - provisioning_api: 1.11.0
 - recommendations: 1.0.0
 - serverinfo: 1.11.0
 - settings: 1.3.0
 - sharebymail: 1.11.0
 - support: 1.4.0
 - survey_client: 1.9.0
 - systemtags: 1.11.0
 - tasks: 0.13.6
 - text: 3.2.0
 - theming: 1.12.0
 - twofactor_backupcodes: 1.10.0
 - updatenotification: 1.11.0
 - user_status: 1.1.1
 - viewer: 1.5.0
 - weather_status: 1.1.0
 - workflowengine: 2.3.0
Disabled:
 - admin_audit
 - bruteforcesettings
 - encryption
 - facerecognition
 - spreed
 - unsplash
 - user_ldap

```

</details>

<details><summary>Configuration (config/config.php)</summary>

```
{
    "instanceid": "***REMOVED SENSITIVE VALUE***",
    "passwordsalt": "***REMOVED SENSITIVE VALUE***",
    "datadirectory": "***REMOVED SENSITIVE VALUE***",
    "dbtype": "mysql",
    "version": "21.0.0.18",
    "dbname": "***REMOVED SENSITIVE VALUE***",
    "dbhost": "***REMOVED SENSITIVE VALUE***",
    "dbtableprefix": "oc_",
    "dbuser": "***REMOVED SENSITIVE VALUE***",
    "dbpassword": "***REMOVED SENSITIVE VALUE***",
    "installed": true,
    "loglevel": 0,
    "maintenance": false,
    "theme": "",
    "default_phone_region": "IT",
    "trusted_domains": [
        "***REMOVED SENSITIVE VALUE***"
    ],
    "share_folder": "\/Shared",
    "secret": "***REMOVED SENSITIVE VALUE***",
    "memcache.local": "\\OC\\Memcache\\APCu",
    "memcache.locking": "\\OC\\Memcache\\Redis",
    "redis": {
        "host": "***REMOVED SENSITIVE VALUE***",
        "port": 6379
    },
    "updater.release.channel": "beta",
    "overwrite.cli.url": "https:\/\/***REMOVED SENSITIVE VALUE***",
    "app_install_overwrite": [
        "calendar",
        "facerecognition"
    ],
    "mysql.utf8mb4": true,
    "updater.secret": "***REMOVED SENSITIVE VALUE***"
}
</details>
```

BTW if I try to logout and login back, I cannot login anymore:

{"reqId":"YFB50bdsL0Ttc9CKv-JrmwAAAAA","level":0,"time":"2021-03-16T09:26:41+00:00","remoteAddr":"MY-IP","user":"--","app":"contacts","method":"POST","url":"/index.php/login","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.82 Safari/537.36","version":"21.0.0.18"}
{"reqId":"YFB50bdsL0Ttc9CKv-JrmwAAAAA","level":0,"time":"2021-03-16T09:26:41+00:00","remoteAddr":"MY-IP","user":"--","app":"files_external","method":"POST","url":"/index.php/login","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.82 Safari/537.36","version":"21.0.0.18"}
{"reqId":"YFB50bdsL0Ttc9CKv-JrmwAAAAA","level":0,"time":"2021-03-16T09:26:41+00:00","remoteAddr":"MY-IP","user":"--","app":"files_sharing","method":"POST","url":"/index.php/login","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.82 Safari/537.36","version":"21.0.0.18"}
{"reqId":"YFB50bdsL0Ttc9CKv-JrmwAAAAA","level":0,"time":"2021-03-16T09:26:41+00:00","remoteAddr":"MY-IP","user":"--","app":"maps","method":"POST","url":"/index.php/login","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.82 Safari/537.36","version":"21.0.0.18"}
{"reqId":"YFB50bdsL0Ttc9CKv-JrmwAAAAA","level":0,"time":"2021-03-16T09:26:41+00:00","remoteAddr":"MY-IP","user":"--","app":"metadata","method":"POST","url":"/index.php/login","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.82 Safari/537.36","version":"21.0.0.18"}
{"reqId":"YFB50bdsL0Ttc9CKv-JrmwAAAAA","level":2,"time":"2021-03-16T09:26:42+00:00","remoteAddr":"MY-IP","user":"--","app":"no app in context","method":"POST","url":"/index.php/login","message":"Login failed: xefil (Remote IP: MY-IP)","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.82 Safari/537.36","version":"21.0.0.18"}
{"reqId":"YFB50bdsL0Ttc9CKv-JrmwAAAAA","level":1,"time":"2021-03-16T09:26:42+00:00","remoteAddr":"MY-IP","user":"--","app":"core","method":"POST","url":"/index.php/login","message":"Bruteforce attempt from \"MY-IP\" detected for action \"login\".","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.82 Safari/537.36","version":"21.0.0.18"}
{"reqId":"YFB50rdsL0Ttc9CKv-JrnAAAAAA","level":0,"time":"2021-03-16T09:26:42+00:00","remoteAddr":"MY-IP","user":"--","app":"contacts","method":"GET","url":"/index.php/login?user=xefil&direct=1","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.82 Safari/537.36","version":"21.0.0.18"}
{"reqId":"YFB50rdsL0Ttc9CKv-JrnAAAAAA","level":0,"time":"2021-03-16T09:26:42+00:00","remoteAddr":"MY-IP","user":"--","app":"files_external","method":"GET","url":"/index.php/login?user=xefil&direct=1","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.82 Safari/537.36","version":"21.0.0.18"}
{"reqId":"YFB50rdsL0Ttc9CKv-JrnAAAAAA","level":0,"time":"2021-03-16T09:26:42+00:00","remoteAddr":"MY-IP","user":"--","app":"files_sharing","method":"GET","url":"/index.php/login?user=xefil&direct=1","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.82 Safari/537.36","version":"21.0.0.18"}
{"reqId":"YFB50rdsL0Ttc9CKv-JrnAAAAAA","level":0,"time":"2021-03-16T09:26:42+00:00","remoteAddr":"MY-IP","user":"--","app":"maps","method":"GET","url":"/index.php/login?user=xefil&direct=1","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.82 Safari/537.36","version":"21.0.0.18"}
{"reqId":"YFB50rdsL0Ttc9CKv-JrnAAAAAA","level":0,"time":"2021-03-16T09:26:42+00:00","remoteAddr":"MY-IP","user":"--","app":"metadata","method":"GET","url":"/index.php/login?user=xefil&direct=1","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.82 Safari/537.36","version":"21.0.0.18"}
{"reqId":"YFB50rdsL0Ttc9CKv-JrnQAAAAA","level":0,"time":"2021-03-16T09:26:42+00:00","remoteAddr":"MY-IP","user":"--","app":"contacts","method":"GET","url":"/cron.php","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.82 Safari/537.36","version":"21.0.0.18"}
{"reqId":"YFB50rdsL0Ttc9CKv-JrnQAAAAA","level":0,"time":"2021-03-16T09:26:42+00:00","remoteAddr":"MY-IP","user":"--","app":"files_external","method":"GET","url":"/cron.php","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.82 Safari/537.36","version":"21.0.0.18"}
{"reqId":"YFB50rdsL0Ttc9CKv-JrnQAAAAA","level":0,"time":"2021-03-16T09:26:42+00:00","remoteAddr":"MY-IP","user":"--","app":"files_sharing","method":"GET","url":"/cron.php","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.82 Safari/537.36","version":"21.0.0.18"}
{"reqId":"YFB50rdsL0Ttc9CKv-JrnQAAAAA","level":0,"time":"2021-03-16T09:26:42+00:00","remoteAddr":"MY-IP","user":"--","app":"maps","method":"GET","url":"/cron.php","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.82 Safari/537.36","version":"21.0.0.18"}
{"reqId":"YFB50rdsL0Ttc9CKv-JrnQAAAAA","level":0,"time":"2021-03-16T09:26:42+00:00","remoteAddr":"MY-IP","user":"--","app":"metadata","method":"GET","url":"/cron.php","message":"/appinfo/app.php is deprecated, use \\OCP\\AppFramework\\Bootstrap\\IBootstrap on the application class instead.","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.82 Safari/537.36","version":"21.0.0.18"}
{"reqId":"YFB50rdsL0Ttc9CKv-JrnQAAAAA","level":0,"time":"2021-03-16T09:26:42+00:00","remoteAddr":"MY-IP","user":"--","app":"cron","method":"GET","url":"/cron.php","message":"Run OCA\\DAV\\BackgroundJob\\UploadCleanup job with ID 1583","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.82 Safari/537.36","version":"21.0.0.18"}
{"reqId":"YFB50rdsL0Ttc9CKv-JrnQAAAAA","level":0,"time":"2021-03-16T09:26:42+00:00","remoteAddr":"MY-IP","user":"--","app":"cron","method":"GET","url":"/cron.php","message":"Finished OCA\\DAV\\BackgroundJob\\UploadCleanup job with ID 1583 in 0 seconds","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.82 Safari/537.36","version":"21.0.0.18"}

I had a Similar issue in the past on another server which was related to permissions to sessions folder of PHP. I’ve tried different ways to solve, but cannot figure out how/where to look this time.

Ideas?

Thanks!

Simon

hello, any news or suggestions on how debug?

I had the same issue here on my side. Because php 7.3 reaches eol in december this is very annoying. (it’s the only app which still used php 7.3 on the server all other php apps use php7.4 or 8.0)

My Setup looks similar to this from xefil.

  • Centos 7
  • Nextcloud 21.0.05, but had this issue already on 20.x some months ago.
  • Apache 2.4.6
  • PHP 7.4.25 (cli / php-fpm)

My config file:

<?php
$CONFIG = array (
  'instanceid' => '',
  'passwordsalt' => '',
  'secret' => '',
  'trusted_domains' =>
  array (
    0 => 'cloud.xxx.xx',
  ),
  'datadirectory' => '/www/xxx/cloud.xxx.xx/data/nas',
  'overwrite.cli.url' => 'https://cloud.xxx.xx',
  'dbtype' => 'mysql',
  'version' => '21.0.5.1',
  'dbname' => 'xx_cloud',
  'dbhost' => 'x.x.x.x',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'xx_cloud',
  'dbpassword' => '',
  'installed' => true,
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'memcache.distributed' => '\\OC\\Memcache\\Memcached',
  'memcached_servers' =>
  array (
    0 =>
    array (
      0 => 'localhost',
      1 => 11211,
    ),
  ),
  'mail_smtpmode' => 'smtp',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_from_address' => 'xx',
  'mail_domain' => 'xxx.xx',
  'mail_smtphost' => 'x.x.x.x',
  'mail_smtpport' => '25',
  'maintenance' => false,
  'htaccess.RewriteBase' => '/',
  'theme' => '',
  'default_phone_region' => 'CH',
  'loglevel' => 0,
  'app_install_overwrite' =>
  array (
    0 => 'keeweb',
  ),
  'encryption.legacy_format_support' => false,
  'encryption.key_storage_migrated' => false,
  'trashbin_retention_obligation' => '30, 60',
  'mysql.utf8mb4' => true,
  'updater.secret' => '',
);

In the nextcloud.log is nothing which looks like an error (only some IBootstrap depricated warnings of some apps). In the audit.log their is logged an login attempt with an error which looks like someone typed an invalid password (because also the bruteforce db table receive an antry) Also the error.log of apache don’t display anything. First i think perhaps mod_security2.c coul’d be a problem, but after disabling it for nextcloud vhost in apache2 their was nothing changed.

Hello @Beleggrodion ,
I’ve ended updating to php8 and fastcgi (I’m using ISPConfig on a CentOS7) and this allowed me to accomplish the upgrade.
Cheers, Simon