# TwoFactorEmail issue prevents login after Upgrade to Nextcloud 31.0.0

**URL:** <https://help.nextcloud.com/t/twofactoremail-issue-prevents-login-after-upgrade-to-nextcloud-31-0-0/218857>\
**Category:** ℹ️ Support\
**Tags:** mfa, webauthn, twofactor-email, nc31\
**Created:** [March 2, 2025, 4:37pm UTC](https://help.nextcloud.com/t/twofactoremail-issue-prevents-login-after-upgrade-to-nextcloud-31-0-0/218857 "2025-03-02T16:37:29Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![alphablue52](https://help.nextcloud.com/letter_avatar/alphablue52/32/5_5575768a8748004e209b776fc1b2916d.png) [@alphablue52](https://help.nextcloud.com/u/alphablue52)\
**Post date:** [March 2, 2025, 4:37pm UTC](https://help.nextcloud.com/t/twofactoremail-issue-prevents-login-after-upgrade-to-nextcloud-31-0-0/218857/1 "2025-03-02T16:37:29Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [March 2, 2025, 8:51pm UTC](https://help.nextcloud.com/t/twofactoremail-issue-prevents-login-after-upgrade-to-nextcloud-31-0-0/218857/2 "2025-03-02T20:51:16Z")

</div>

> [@alphablue52](#):
>
> It left the app “TwoFactorEmail” enabled, even though it is not compatible with this server version.

WHY??? [twofactoremail](https://apps.nextcloud.com/apps/twofactor_email) supports nothing newer than #nc28

Please review [App support for NC 31](https://help.nextcloud.com/t/app-support-for-nc-31/217313)

---

<div class="post-metadata">

**Author:** ![jtr](https://help.nextcloud.com/letter_avatar/jtr/32/5_5575768a8748004e209b776fc1b2916d.png) [@jtr](https://help.nextcloud.com/u/jtr)\
**Post date:** [March 2, 2025, 9:32pm UTC](https://help.nextcloud.com/t/twofactoremail-issue-prevents-login-after-upgrade-to-nextcloud-31-0-0/218857/3 "2025-03-02T21:32:38Z")

</div>

> [@alphablue52](#):
>
> It left the app “TwoFactorEmail” enabled, even though it is not compatible with this server version.

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!

---

<div class="post-metadata">

**Author:** ![tflidd](https://help.nextcloud.com/letter_avatar/tflidd/32/5_5575768a8748004e209b776fc1b2916d.png) [@tflidd](https://help.nextcloud.com/u/tflidd)\
**Post date:** [March 2, 2025, 10:04pm UTC](https://help.nextcloud.com/t/twofactoremail-issue-prevents-login-after-upgrade-to-nextcloud-31-0-0/218857/4 "2025-03-02T22:04:49Z")

</div>

> [@wwe](#):
>
> WHY??? [twofactoremail](https://apps.nextcloud.com/apps/twofactor_email) supports nothing newer than #nc28
> 
> Please review [App support for NC 31](https://help.nextcloud.com/t/app-support-for-nc-31/217313)

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

> [@Apps waiting for NC 30 support](https://help.nextcloud.com/t/apps-waiting-for-nc-30-support/204064):
>
> [Nextcloud 30 (Hub 9) was released](https://help.nextcloud.com/t/be-connected-with-nextcloud-hub-9/203849). By default, existing apps are not compatible with the new version yet and must be tested (and perhaps fixed). Many apps are supported by community users working on the apps in their free time. You can try to enable an app by clicking enable manually in the app overview (as an admin). Please leave a feedback on the bug tracker of an app if your test was successful (for follow-ups, leave a +1 ) or leave a report with the errors you encountered. Here is an aut…

---

<div class="post-metadata">

**Author:** ![devnull](https://help.nextcloud.com/user_avatar/help.nextcloud.com/devnull/32/27793_2.png) [@devnull](https://help.nextcloud.com/u/devnull)\
**Post date:** [March 4, 2025, 7:08am UTC](https://help.nextcloud.com/t/twofactoremail-issue-prevents-login-after-upgrade-to-nextcloud-31-0-0/218857/5 "2025-03-04T07:08:06Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![liorgr](https://help.nextcloud.com/letter_avatar/liorgr/32/5_5575768a8748004e209b776fc1b2916d.png) [@liorgr](https://help.nextcloud.com/u/liorgr)\
**Post date:** [March 11, 2025, 6:57am UTC](https://help.nextcloud.com/t/twofactoremail-issue-prevents-login-after-upgrade-to-nextcloud-31-0-0/218857/6 "2025-03-11T06:57:07Z")

</div>

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 😉

---

<div class="post-metadata">

**Author:** ![dreadu](https://help.nextcloud.com/letter_avatar/dreadu/32/5_5575768a8748004e209b776fc1b2916d.png) [@dreadu](https://help.nextcloud.com/u/dreadu)\
**Post date:** [March 14, 2025, 4:37pm UTC](https://help.nextcloud.com/t/twofactoremail-issue-prevents-login-after-upgrade-to-nextcloud-31-0-0/218857/7 "2025-03-14T16:37:36Z")

</div>

> [@liorgr](#):
>
> UPDATE oc\_appconfig SET configvalue = ‘no’ WHERE appid = ‘twofactor\_email’ AND configkey = ‘enabled’;

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

Simply updated mine via pgAdmin

 ![image](https://help.nextcloud.com/uploads/default/original/3X/a/4/a47ee142f7d2c8b45065d61a21254a39781569d1.png)

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

---

<div class="post-metadata">

**Author:** ![system](https://help.nextcloud.com/user_avatar/help.nextcloud.com/system/32/29333_2.png) [@system](https://help.nextcloud.com/u/system)\
**Post date:** [March 22, 2025, 4:37pm UTC](https://help.nextcloud.com/t/twofactoremail-issue-prevents-login-after-upgrade-to-nextcloud-31-0-0/218857/8 "2025-03-22T16:37:43Z")

</div>

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