TOTP Ignored. TOTP window not displayed. No issue logging on


I have recently migrated the my NC installation to new hardware. This went surprisingly easy. I’ve setup a LAMP environment consisting out of CentOS 7.4.1708/PHP72/MariaDB10.2.14.

Now Nextcloud has been update to 13.0.0 prior to the update. At this point TOTP worked as expected.

After the move TOTP stopped working. To be more precise: TOTP is not showing when I login. Nor is it logging any messages in the logging. I login with my user and thus I’m logged in. Where I would expect the TOTP window.

TOTP is simply ignored.

All Apps are up to date. I even upgraded to 13.0.1 just to see if the issue was in 13.0.0.

As the logging is not showing any errors for TOTP, I recon it could be some compatibility issue with PHP perhaps.

Does anybody else having this problem?


I noticed in previous updates of Nextcloud that TOTP gets always deactivated during the update process and needs to be re-enabled afterwards manually. So have you checked, if the app is still enabled?

If not the disabled app is the root cause, could you check the user settings for TOTP. Maybe the user needs to re-enable that feature due to any issue during the DB migration.

Hi Schmu,

Yes it is enabled.
Just now I even reinstalled TOTP.

After scanning the new QR code, verifying it and do a logout/login, I’m not presented with the TOTP window.

[update] Tried another TOTP app. Still no go. I’m still able to activate TOTP, but after relogin I’m not presented with a code request.

[update 2] I’ve created a test user under which I enabled TOTP. And this works as expected. Looks like the problem is my admin user.

I ran a app check today:

sudo -u apache php ./occ app:check-code twofactor_totp
Database schema error: Name of table dbprefixtwofactor_totp_secrets is too long (22), max. 27 characters (21 characters for tables with autoincrement) + dbprefix allowed
App is not compliant

Looks like it’s unable to read the correct prefix for the database.
Is there any way I can correct this?

If nothing else works… you could deactivate/remove the totp app from the apps section of your NC instance, then remove the totp tables from your NC database and re-install the totp app.

1 Like

Hi budy,

Well tried this as well now. Unfortunately this did not work either.
Steps taken:

  • Removed totp app
  • Removed totp_backupcodes and totp_secrets tables.
  • Installed and enabled totp app
  • checked for new tables of secret. Good.
  • Enabled totp for my admin, scanned the QR code and verified it.
  • Logout and in again and was not presented the TOTP code. It just logged in.

Is there a way to keep the data and do a new clean install?
So like install a complete new instance of Nextcloud.
Followed by a move of the existing data into the new user data/user/files directory.
I reckon after the data is copied into the right directory i need to issue a ./occ files:scan

I really still think, that a re-install shouldn’t be necessary, since the twofactor app is almost self-contained, just as all of the other supplemental apps for NC.

There is the DB which could be a culprit in a NC instance, but the app code usually is not. Before starting to think about moving your data onto a new install, I’d suggest ti just download the current NC installer for your current NC version and just copy over the config.php.

This will provide you with a almost new install, with all your current data.

:grimacing: I already did a new install. Rsynced the old data over per user and ran a files:scan to make it visible within the nc. This worked like a charm. Then I installed the totp and set it up. Logout and login and Bingo! All is good again. It also solved one of my other problems I saw under " Security and setup warnings ". Geus my install was a little more buggy then I thought.

Thanks for thinking along here. Very much appreciated.

1 Like