MFA not working after Nextcloud update

Hi everybody,

After a NextCloud automatic update, I have lost the GUI access because MFA is not working anymore. It always shows this message:

"Could not load at least one of your enabled two -factor auth methods . Please contact your admin."

As I still have admin CLI access I have tried:

  • Using the backup codes, but none of them works.
  • Creating another admin account and generating from GUI the backup codes, but none of them neither work.

Server logs shows the following messages in every logon attempt:

|Error|core|two-factor auth provider ‘twofactor_nextcloud_notification’ failed to load||2022-01-18T12:39:10+0100|
|Error|core|1 two-factor auth providers failed to load||2022-01-18T12:39:10+0100|

Result of twofactorauth:state

Enabled providers:
- backup_codes
- twofactor_nextcloud_notification
Disabled providers:
- totp
- u2f

Any idea? Is there any way to generate a single backup code from CLI? Have tried the following:

./occ twofactorauth:admin:generate-code username

But getting this output

There are no commands defined in the “twofactorauth:admin” namespace.

  • Did you mean this?*
  •  twofactorauth*