Login passwords fail after upgrade to Fedora 35, php 8 and nextcloud 20 or 21+

Nextcloud version (eg, 20.0.5): 21.0.7
Operating system and version (eg, Ubuntu 20.04): Fedora 35
Apache or nginx version (eg, Apache 2.4.25): Apache
PHP version (eg, 7.4): 8.0.13

The issue you are facing:
I just upgraded my Fedora 33 system that has been running Nextcloud 19.0.13.1 on an isolated home network for a long time to Fedora 35 with php 8.0.13. I did not update Nextcloud prior to upgrading Fedora, so I discovered the issue with the php version 8 after completing the Fedora update. Following some instructions I found, I was able to install a parallel version of php (7.4 from the remi repository) and was able to successfully upgrade my Nextcloud installation to 20.0.14 via command line using php74 and occ. Upon restarting httpd and loading the nextcloud login page, I attempted to login as usual, but the password was not accepted (wrong password). I tried other users with the same result. I then used the command line to upgrade further to nextcloud 21.0.7, which also upgraded successfully but gave the same result upon trying to log in, and eventually a message about multiple invalid logins. I attempted to login from the machine that hosts Nextcloud on two browsers and also from an Android phone app.
I then restored the database from my backup and tried again, but the result was the same. I’m not sure how to troubleshoot this situation–any advice on how to proceed would be greatly appreciated.

Thanks,

Kevin

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

Steps to replicate it:

  1. Upgrade Fedora from 33 to 35, including php version from 7.4 to 8.0.13
  2. Manually upgrade Nextcloud to a version that supports php 8
  3. Attempt to log in

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

<?php
$CONFIG = array (
  'instanceid' => 'ocwdgetw0xnj',
  'passwordsalt' => 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
  'secret' => 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
  'trusted_domains' => 
  array (
    0 => '192.168.1.11',
  ),
  'datadirectory' => '/home/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '21.0.7.0',
  'overwrite.cli.url' => 'http://192.168.1.11/nextcloud',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'oc_ncadmin7',
  'dbpassword' => 'xxxxxxxxxxxxxxxxxxxxxx',
  'installed' => true,
  'maintenance' => false,
  'theme' => '',
  'loglevel' => 2,
);