# 2fa error for mail users

**URL:** <https://forum.virtualmin.com/t/2fa-error-for-mail-users/129224>\
**Category:** Usermin\
**Created:** [September 17, 2024, 10:00pm UTC](https://forum.virtualmin.com/t/2fa-error-for-mail-users/129224 "2024-09-17T22:00:56Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![keithaza](https://cdn.forum.virtualmin.com/letter_avatar_proxy/v4/letter/k/47e85d/32.png) [@keithaza](https://forum.virtualmin.com/u/keithaza)\
**Post date:** [September 17, 2024, 10:00pm UTC](https://forum.virtualmin.com/t/2fa-error-for-mail-users/129224/1 "2024-09-17T22:00:56Z")

</div>

| SYSTEM INFORMATION | |
| --- | --- |
| OS type and version | Ubuntu Linux 22.04.4 |
| Usermin version | 2.102 |
| Virtualmin version | 7.20.2 |
| Theme version | 21.20.7 |
| Apache version | 2.4.52 |
| Package updates | 42 package updates are available |

Hello, I wanted to activate double authentication for email users but I get the following error. I verify that Google Authenticator was already installed

 ![Screenshot_33](https://cdn.forum.virtualmin.com/uploads/default/original/3X/2/0/20b8a410cd3bed5d91c3df495433d135b7472373.png)

---

<div class="post-metadata">

**Author:** ![manuch](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/manuch/32/17542_2.png) [@manuch](https://forum.virtualmin.com/u/manuch)\
**Post date:** [November 8, 2024, 11:13pm UTC](https://forum.virtualmin.com/t/2fa-error-for-mail-users/129224/2 "2024-11-08T23:13:16Z")

</div>

I’m having the exact same issue, on Ubuntu 24.04. Any news?

---

<div class="post-metadata">

**Author:** ![stefan1959](https://cdn.forum.virtualmin.com/letter_avatar_proxy/v4/letter/s/49beb7/32.png) [@stefan1959](https://forum.virtualmin.com/u/stefan1959)\
**Post date:** [November 9, 2024, 12:15am UTC](https://forum.virtualmin.com/t/2fa-error-for-mail-users/129224/3 "2024-11-09T00:15:15Z")

</div>

I just tried on Rocky and works fine, I noticed first post has alot of packages that need updating, can you make sure you system is updated as well.

Check here

> <https://github.com/webmin/usermin/issues/116>
>
> I don't know if this is already fixed in the development version, so I'm reporti…ng it "in case you haven't previously encountered the bug", based on what's available in the stable versions in your Debian 12 repositories (Usermin 2.102 running on top of Webmin 2.202 + Virtualmin 7.20.2).
> 
> \---
> 
> \## Steps to reproduce
> 
> Following the instructions from \[this forum thread\](https://forum.virtualmin.com/t/how-to-set-up-2fa-for-usermin-and-virtualmin-users/113935/5), 2FA was already enabled in "Webmin / Usermin Configuration", however the module was not activated in "Available Modules" in "Webmin / Usermin Configuration", so I enabled that, and restarted usermin.
> 
> Then in my webmail usermin panel, I went to "Login \> Two-Factor Authentication" and tried to enable it, and got this confusing error page, with this error message:
> 
> \> Enrolling for two-factor authentication with provider Google Authenticator ..  
> \> .. complete. Your ID with this provider is \[some presumably secret ID\].
> \> 
> \> \`HTTP/1.0 500 Perl execution failed Server: MiniServ/2.102 Date: Wed, 30 Oct 2024 15:39:34 GMT Content-type: text/html; Charset=utf-8 Connection: close \`
> \> \`Error — Perl execution failed\`
> \> 
> \> Undefined subroutine \`&twofactor::can\_generate\_qr\` called at \`twofactor-funcs-lib.pl\` line 235.
> 
> !\[image\](https://github.com/user-attachments/assets/949abb53-12c3-42e7-b2fd-e5b04bce737e)
> 
> \## Analysis and potential solutions
> 
> It first claims to have succeeded, then fails (and if I leave and re-enter that page, it seems to not have been enabled, thankfully).
> 
> As I understand it, it failed to generate a QR code because of a missing dependency? But as a user, I don't know what to do with this, as I don't have a QR code or clear instructions of what to do with my authenticator app to add this (can I just input that "ID" text string into my auth app? What parameters should I use? etc.)
> 
> Ideally, it should:
> 
> 1. ensure any such dependency is installed by virtualmin/webmin by default, and/or when you enable the feature
> 2. double-check for the presence of that subroutine before applying the changes to the user in usermin, to avoid any potential of locking them out
> 3. check that the user is actually capable of generating the matching TOTP codes before fully enabling and enforcing it (if it doesn't already do that)

---

<div class="post-metadata">

**Author:** ![manuch](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/manuch/32/17542_2.png) [@manuch](https://forum.virtualmin.com/u/manuch)\
**Post date:** [November 9, 2024, 10:24pm UTC](https://forum.virtualmin.com/t/2fa-error-for-mail-users/129224/4 "2024-11-09T22:24:41Z")

</div>

Thank you for the link, which shows that it does indeed seem to be a bug. In Virtualmin it works, in Usermin it doesn’t. All my packages are updated and it’s a fresh install I just set up yesterday.

---

<div class="post-metadata">

**Author:** ![stefan1959](https://cdn.forum.virtualmin.com/letter_avatar_proxy/v4/letter/s/49beb7/32.png) [@stefan1959](https://forum.virtualmin.com/u/stefan1959)\
**Post date:** [November 10, 2024, 8:31am UTC](https://forum.virtualmin.com/t/2fa-error-for-mail-users/129224/5 "2024-11-10T08:31:25Z")

</div>

Yeah, the updated code is listed in links, you could check against whats on your system.

---

<div class="post-metadata">

**Author:** ![manuch](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/manuch/32/17542_2.png) [@manuch](https://forum.virtualmin.com/u/manuch)\
**Post date:** [November 10, 2024, 8:04pm UTC](https://forum.virtualmin.com/t/2fa-error-for-mail-users/129224/6 "2024-11-10T20:04:40Z")

</div>

I just saw. I am on Webmin 2.202 / Usermin 2.102, no idea when that commit will be pushed to the repo that I’m using. How would I see that? I’m sorry, I’m not very familiar with the logic that is used by Virtualmin maintainers to push out updates.

---

<div class="post-metadata">

**Author:** ![shoulders](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/shoulders/32/10086_2.png) [@shoulders](https://forum.virtualmin.com/u/shoulders)\
**Post date:** [November 11, 2024, 8:58am UTC](https://forum.virtualmin.com/t/2fa-error-for-mail-users/129224/7 "2024-11-11T08:58:30Z")

</div>

> [@manuch](#):
>
> no idea when that commit will be pushed to the repo that I’m using.

~~It already is~~ , it is pushed to the GitHub repo, but this does not translate into an immediately available update for usermin/virtualmin/webmin

> [@manuch](#):
>
> I’m not very familiar with the logic that is used by Virtualmin maintainers to push out updates.

There are no fixed dates/times when Webmin and Virtualmin updates are pushed out to end users.

There are ways if you are a developer to update your local code, but for you I would not recommend these.

---

<div class="post-metadata">

**Author:** ![jimr1](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/jimr1/32/14173_2.png) [@jimr1](https://forum.virtualmin.com/u/jimr1)\
**Post date:** [November 11, 2024, 11:17am UTC](https://forum.virtualmin.com/t/2fa-error-for-mail-users/129224/8 "2024-11-11T11:17:41Z")

</div>

> [@shoulders](#):
>
> There are ways

What is wrong with using the `webmin patch ` command ? I think this option was designed for non tech users to update webmin with code committed to the github repro directly however you do need to know the commit id

---

<div class="post-metadata">

**Author:** ![shoulders](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/shoulders/32/10086_2.png) [@shoulders](https://forum.virtualmin.com/u/shoulders)\
**Post date:** [November 11, 2024, 11:29am UTC](https://forum.virtualmin.com/t/2fa-error-for-mail-users/129224/9 "2024-11-11T11:29:11Z")

</div>

he comes across as this is not his thing, so why don’t you post the full patch info and tell how to do it and let him decide. 😄

---

<div class="post-metadata">

**Author:** ![jimr1](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/jimr1/32/14173_2.png) [@jimr1](https://forum.virtualmin.com/u/jimr1)\
**Post date:** [November 11, 2024, 11:32am UTC](https://forum.virtualmin.com/t/2fa-error-for-mail-users/129224/10 "2024-11-11T11:32:38Z")

</div>

As I don’t use 2fa I have no use for it, and perhaps I have better things to do with my time than hunting for the correct commit

---

<div class="post-metadata">

**Author:** ![Ilia](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/ilia/32/10185_2.png) [@Ilia](https://forum.virtualmin.com/u/Ilia)\
**Post date:** [November 11, 2024, 11:47am UTC](https://forum.virtualmin.com/t/2fa-error-for-mail-users/129224/11 "2024-11-11T11:47:58Z")

</div>

This issue has been fixed for the upcoming Usermin release. For those who feel comfortable, there’s also a nightly build of Usermin available that addresses this issue.

---

<div class="post-metadata">

**Author:** ![system](https://cdn.forum.virtualmin.com/uploads/default/original/2X/c/cd96d761e326db4b2bef94886a639109bd7a8e76.svg) [@system](https://forum.virtualmin.com/u/system)\
**Post date:** [January 10, 2025, 11:48am UTC](https://forum.virtualmin.com/t/2fa-error-for-mail-users/129224/12 "2025-01-10T11:48:46Z")

</div>

Closed on January 10, 2025, 11:48am UTC

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