Passwords not working after upgrade to 21 ALSO OCC reset not working or email reset

Nextcloud version _(eg, 21
Operating system and version cent os 7
nginx
PHP version PHP 7.3.31

The issue you are facing:

After updating to version 21, admin and all passwords are not working. after attempting a reset via OCC:

sudo -u nginx php occ user:resetpassword scottnzuk
Enter a new password:
Confirm the new password:
Successfully reset password for scottnzuk

Login still fails.

Reset via email that has also worked in past also says:
Couldn’t send reset email. Please contact your administrator.

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

Ive tried to run all of the below, no luck

db:add-missing-columns Add missing optional columns to the database tables
db:add-missing-indices Add missing indices to the database tables
db:add-missing-primary-keys Add missing primary keys to the database tables

maintenance:repair
files:scan --all
integrity:check-core - no errors

It looks like alot users had this issue in past, I have spend afew hours on google but still no luck.

I have also updated the DB from 5.7 to 8 using:

$> sudo yum-config-manager --disable mysql57-community
$> sudo yum-config-manager --enable mysql80-community

And YUM update after nextcloud updated without error.

Below is the error log watch when I try to reset via email that would usually work;

^X^C[root@digibid_nextcloud nextcloud]# sudo -u nginx php occ log:watch
Debug core OC\AppFramework\Middleware\Security\Exceptions\CrossSiteRequestForgeryException: CSRF check failed at 2021-09-30T23:31:14+00:00
…/Middleware/Security/SecurityMiddleware.php line 181

                          0. .../MiddlewareDispatcher.php line 98
                             OC\AppFramework\Middleware\Security\SecurityMiddleware->beforeController(
                               OC\Core\Controller\LostController {},
                               "email"
                             )
                          1. .../AppFramework/Http/Dispatcher.php line 119
                             OC\AppFramework\Middleware\MiddlewareDispatcher->beforeController(OC\Core\Controller\LostController {}, "email")
                          2. lib/private/AppFramework/App.php line 157
                             OC\AppFramework\Http\Dispatcher->dispatch(OC\Core\Controller\LostController {}, "email")
                          3. lib/private/Route/Router.php line 302
                             OC\AppFramework\App::main(
                               "OC\\Core\\Controller\\LostController",
                               "email",
                               OC\AppFramework\DependencyInjection\DIContainer {},
                               {_route:"core.lost.email"}
                             )
                          4. lib/base.php line 993
                             OC\Route\Router->match("\/lostpassword\/email")
                          5. index.php line 37
                             OC::handleRequest(

                             )

And here is error when I try to login with what should be working login account:
Debug core OC\AppFramework\Middleware\Security\Exceptions\NotLoggedInException: Current user is not logged in at 2021-09-30T23:32:42+00:00
…/Middleware/Security/SecurityMiddleware.php line 143

                          0. .../MiddlewareDispatcher.php line 98
                             OC\AppFramework\Middleware\Security\SecurityMiddleware->beforeController(
                               OCA\Files\Controller\ViewController {},
                               "index"
                             )
                          1. .../AppFramework/Http/Dispatcher.php line 119
                             OC\AppFramework\Middleware\MiddlewareDispatcher->beforeController(OCA\Files\Controller\ViewController {}, "index")
                          2. lib/private/AppFramework/App.php line 157
                             OC\AppFramework\Http\Dispatcher->dispatch(OCA\Files\Controller\ViewController {}, "index")
                          3. lib/private/Route/Router.php line 302
                             OC\AppFramework\App::main(
                               "OCA\\Files\\Controller\\ViewController",
                               "index",
                               OC\AppFramework\DependencyInjection\DIContainer {},
                               {_route:"files.view.index"}
                             )
                          4. lib/base.php line 993
                             OC\Route\Router->match("\/apps\/files\/")
                          5. index.php line 37
                             OC::handleRequest(

                             )

when type in email and password is no error messages on the website just blinks and drops you back to login page.

Before the upgrade i disabled all apps I could I do recall there was one called password or passwords I wonder if this has done something?

Urgently trying to fix this as its live site and I can roll back to the backup but update should work. I feel this is a system bug :frowning:

Another entry from log:

Debug cron Finished OC\Log\Rotate job with ID 20 in 0 seconds 2021-09-30T23:35:01+00:00

Debug cron Run OC\Log\Rotate job with ID 20 2021-09-30T23:35:01+00:00

Debug cron Finished OC\Authentication\Token\DefaultTokenCleanupJob job with ID 19 in 0 seconds 2021-09-30T23:35:01+00:00

Debug cron Invalidating remembered session tokens older than 2021-09-15T23:35:01+00:00 2021-09-30T23:35:01+00:00

Debug cron Invalidating session tokens older than 2021-09-29T23:35:01+00:00 2021-09-30T23:35:01+00:00

Debug cron Invalidating remembered session tokens older than 2021-09-15T23:35:01+00:00 2021-09-30T23:35:01+00:00

Debug cron Invalidating session tokens older than 2021-09-29T23:35:01+00:00 2021-09-30T23:35:01+00:00

Debug cron Run OC\Authentication\Token\DefaultTokenCleanupJob job with ID 19 2021-09-30T23:35:01+00:00

Debug core OC\AppFramework\Middleware\Security\Exceptions\NotLoggedInException: Current user is not logged in at 2021-09-30T23:38:14+00:00
…/Middleware/Security/SecurityMiddleware.php line 143

                          0. .../MiddlewareDispatcher.php line 98
                             OC\AppFramework\Middleware\Security\SecurityMiddleware->beforeController(
                               OCA\Notifications\Controller\Endpoi ... {},
                               "listNotifications"
                             )
                          1. .../AppFramework/Http/Dispatcher.php line 119
                             OC\AppFramework\Middleware\MiddlewareDispatcher->beforeController(
                               OCA\Notifications\Controller\EndpointContr ... {},
                               "listNotifications"
                             )
                          2. lib/private/AppFramework/App.php line 157
                             OC\AppFramework\Http\Dispatcher->dispatch(OCA\Notifications\Controller\EndpointController {}, "listNotifications")
                          3. lib/private/Route/Router.php line 302
                             OC\AppFramework\App::main(
                               "OCA\\Notifications\\Controller\\EndpointController",
                               "listNotifications",
                               OC\AppFramework\DependencyInjection\DIContainer {},
                               {apiVersion:"v2",_route:"ocs.notifications.Endpoint.listNotifications"}
                             )
                          4. ocs/v1.php line 63
                             OC\Route\Router->match("\/ocsapp\/apps\/notifications\/api\/v2\/notifications")
                          5. ocs/v2.php line 24
                             require_once("\/var\/www\/nextcloud\/ocs\/v1.php")