After upgrade to 23.0.0 - "Two-Factor TOTP Provider" cannot be installed - can't login :(

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face: is for home/non-enterprise users. If you’re running a business, paid support can be accessed via 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:


Or for longer, use three backticks above and below the code snippet:


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

The issue you are facing:
After an upgrade to 23.0.0, I cannot login to my server. I “had” TOTP enabled, and post upgrade, I was presented with the backup code page. Problem is, my backup codes won’t work! Yes, they’re the right codes.

When using occ to check things out, I noticed that TOTP is disabled. When trying to re-enable it, I got this message: App "Two-Factor TOTP Provider" cannot be installed because it is not compatible with this version of the server.

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

Steps to replicate it:

  1. Go to NC login page
  2. Try to login
  3. Fail to login

The output of your Nextcloud log in Admin > Logging:

{"reqId":"someid","level":3,"time":"2021-11-30T22:21:48+00:00","remoteAddr":"","user":"kz6fittycent","app":"core","method":"GET","url":"/index.php/login/selectchallenge?redirect_url=/index.php/csrftoken","message":"1 two-factor auth providers failed to load","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36","version":""}

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

$CONFIG = array (
  'instanceid' => 'blah',
  'passwordsalt' => 'blah',
  'secret' => 'blah,
  'trusted_domains' => 
  array (
    0 => '',
  'datadirectory' => '/data/goes/here/',
  'dbtype' => 'mysql',
  'version' => '',
  'overwrite.cli.url' => '',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nc_dudesdb',
  'dbpassword' => 'supersecurepasswordhomeslice',
  'trashbin_retention_obligation' => 'auto',
  'installed' => true,
  'maintenance' => false,
  'theme' => '',
  'default_phone_region' => 'ISO 3166-2:US',
  0 => 'output_buffering = Off',
  'loglevel' => 2,
  'mail_smtpmode' => 'smtp',
  'mail_sendmailmode' => 'smtp',
  'mail_from_address' => 'email.user',
  'mail_domain' => '',
  'mail_smtpsecure' => 'ssl',
  'mail_smtphost' => '',
  'mail_smtpport' => '465',
  'mail_smtpauth' => 1,
  'mail_smtpauthtype' => 'LOGIN',
  'mail_smtpname' => '',
  'mail_smtppassword' => 'superdupersecurepassword',
  'app_install_overwrite' => 
  array (
    0 => 'flowupload',
  'twofactor_enforced' => 'false',
  'twofactor_enforced_groups' => 
  array (
  'twofactor_enforced_excluded_groups' => 
  array (

The output of your Apache/nginx/system log in /var/log/____: - - [30/Nov/2021:16:49:04 -0600] "POST /index.php/login/challenge/backup_codes?redirect_url=/index.php/apps/files/ HTTP/1.1" 303 1429 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36"

I have tried disabling the TOTP application, but can’t since it’s already disabled. I am not sure how to proceed safely. Any ideas?

I can’t disable TOTP, can’t “remove” TOTP, because it’s already gone, can’t install TOTP, literally stuck. UGH.

Does anyone know of a working override? I’ve been throughout this forum and the internet and I’m not finding anything that’s worked. Even dumped the db tables per: TOTP after occ disable and finally enable not working - #10 by oled

Tried 'twofactor_enforced' => 'false', in my config.php and no good.

I’ve deleted the apps altogether, my backup codes never worked anyway. I’ve created a new admin user via occ, thinking I might be able to do some trickery, but I’m really stuck.

twofactorauth:cleanup doesn’t work, had my hopes up for this one…

BTW, there were no errors during the upgrade. NONE.

Had the same issue and made - fortunately - a snapshot of my v22 before. Disabling enforcement of 2FA for all users via occ didn’t succeed either so I reverted the snapshot, disabled the app and 2FA-logins with v22 and then upgraded to Nextcloud Hub II again.

Now waiting for the app to be updated so the I can re-enable it again - for now, it’s just a workaround but going without 2FA isn’t a good workaround anyway :wink: !

1 Like

I have this issue today. You can try this (it help for me):

  • login as root admin in web
  • go to “Apps” section
  • find “TOTP” and click “Enable untrusted app”
  • then find “TOTP” again and click “Enable”

After these steps, I still use TOTP to log in to my Nextcloud 23. Hope this help you!

1 Like

Unfortunately, I can’t get it enabled @petrikoz. It throws a big yellow banner and fails to enable, stating it’s incompatible with my version of NC.

Version 6.2.0 fixed the issue - updating the app before upgrading to Nextcloud Hub II can be a way to avoid this problem. Thanks for the fast fix , @ChristophWurst and team!

Bildschirmfoto 2021-12-01 um 18.57.50



TYVM ALL. Happy day!

Steps I had to take:

  1. Restored db backup
  2. Re-enabled TOTP
  3. Logged in
  4. Shouted for joy!
1 Like