TwoFactorEmail issue prevents login after Upgrade to Nextcloud 31.0.0

I just ugraded to NC 31.0.0 via the web updater.
It left the app “TwoFactorEmail” enabled, even though it is not compatible with this server version.

As a result, every user with 2FA enabled was not able to login.
The server log showed
“Could not load two-factor auth provider OCA\TwoFactorEmail\Provider\Email”

Since the admin account was also 2FA enabled, I had to login with ssh and disable the app manually:
sudo -u www-data php occ app:disable twofactor_email

I hope this helps other users with the same issue.
Twofactor_email seems not supported anymore.

Cheers
Torsten

2 Likes

WHY??? twofactoremail supports nothing newer than nc28

Please review App support for NC 31

If it was enabled in your prior version, it must have been force enabled since it isn’t compatible with the prior version of Server either.

When an app is forced enabled, all compatibility checks are disabled for it.

Glad you got it figured out!

Yes, we just check apps that were available on NC 29+. For NC30, it was still on the list:

I don’t know why you don’t use standard 2FA, e.g. with Google Authenticator. Because you’re afraid of smartphones or Google? That’s complete rubbish, of course. Just use TOTP with Google Authenticator, for example.

The use of e-mail is a risk. If malware is installed on the PC, the attacker can obtain the access data for Nextcloud and e-mail. Strictly speaking, this is not a real 2FA. Although if you use Nextcloud and TOTP on the same smartphone, it’s not really 2FA either.

For those using docker experiencing the same issue -

I couldn’t find a proper way to run that command. Best I got was that the user did not have access to the config file.

I used the following commands to change the config in the database:

  1. Find the docker name if you don’t already know it:

docker ps --format “{{.Names}}” | grep nextcloud

  1. Get the DB user and password:

docker exec nextcloud cat /app/www/public/config/config.php

(Look for “dbuser” & “dbpassword”)

  1. Connect to DB (in my case it is another docker container):

docker exec -it nextcloud_db mysql -u nextcloud -p

Change the username to the one from step 3 and type or paste the password

  1. If all goes well you should be connected to the DB now. Select the DB required by pasting

USE nextcloud_db

Change the above to the name of your DB - “dbname” from step 3

  1. Paste the bellow:

UPDATE oc_appconfig SET configvalue = ‘no’ WHERE appid = ‘twofactor_email’ AND configkey = ‘enabled’;

If you see “Query OK, 1 row affected” - go refresh your dashboard :wink:

1 Like

Thank you so much!
I updated from 30.0.6 to 31.0.1 and had the same issue.

Simply updated mine via pgAdmin

Works like a charm. After I could log in again, I removed the app.

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.