[GH-ISSUE #3299] An internal error occured - KeyError at /webmail/ 'password' #1826

Closed
opened 2026-02-27 11:19:20 +03:00 by kerem · 15 comments
Owner

Originally created by @TSKNF on GitHub (Aug 8, 2024).
Original GitHub issue: https://github.com/modoboa/modoboa/issues/3299

Originally assigned to: @tonioo on GitHub.

Impacted versions

  • OS Type: Proxmox 8.2.1
  • OS Version: Debian 12
  • Database Type: PostgreSQL
  • Database version: 16+261.pgdg120+1
  • Modoboa: 2.3.0
  • installer used: Yes
  • Webserver: Nginx

Steps to reproduce

Step 1: Create a Debian 12 LXC container in Proxmox 8.2.1.
Step 2: Install Modoboa according to the instructions
Step 3: Create a simple user

Current behavior

If you now log in with this user everything seems to work but if you click on webmail you get this error message:

modoboa 5
"Sorry An internal error occured."

An image of the error message with Debug True:

modoboa 3
"KeyError at /webmail/ 'password'"

This message appears during setup:

modoboa 1
"User dovocot already exists, skipping creation but please make sure the /srv/vmail directory exists."

When I try to delete a user, I get this error message:

modoboa 4

Expected behavior

The webmail interface should work without errors.
Deleting accounts should also work without errors.
There should not already be a user with the name dovocot.

Originally created by @TSKNF on GitHub (Aug 8, 2024). Original GitHub issue: https://github.com/modoboa/modoboa/issues/3299 Originally assigned to: @tonioo on GitHub. # Impacted versions * OS Type: Proxmox 8.2.1 * OS Version: Debian 12 * Database Type: PostgreSQL * Database version: 16+261.pgdg120+1 * Modoboa: 2.3.0 * installer used: Yes * Webserver: Nginx # Steps to reproduce Step 1: Create a Debian 12 LXC container in Proxmox 8.2.1. Step 2: Install Modoboa according to the instructions Step 3: Create a simple user # Current behavior If you now log in with this user everything seems to work but if you click on webmail you get this error message: ![modoboa 5](https://github.com/user-attachments/assets/e17fbc4f-76bb-47d6-a1da-11bea0dc0d99) "Sorry An internal error occured." An image of the error message with Debug True: ![modoboa 3](https://github.com/user-attachments/assets/1d620122-449a-40a3-82a5-e568d5a212e0) "KeyError at /webmail/ 'password'" This message appears during setup: ![modoboa 1](https://github.com/user-attachments/assets/ca02f5b1-088e-419d-b7e4-0a61d9a3932e) "User dovocot already exists, skipping creation but please make sure the /srv/vmail directory exists." When I try to delete a user, I get this error message: ![modoboa 4](https://github.com/user-attachments/assets/01f28f13-897a-4ae0-a6a2-9af6085731fd) <!-- Explain the behavior you're seeing that you think is a bug, and explain how you think things should behave instead. --> # Expected behavior The webmail interface should work without errors. Deleting accounts should also work without errors. There should not already be a user with the name dovocot.
kerem 2026-02-27 11:19:20 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@VladislavGatsenko commented on GitHub (Aug 10, 2024):

same error

<!-- gh-comment-id:2282283305 --> @VladislavGatsenko commented on GitHub (Aug 10, 2024): same error
Author
Owner

@nadihighlander commented on GitHub (Aug 13, 2024):

Hi
debian 11 , clean install (postwhite is not installed)
Database Type: PostgreSQL
Modoboa: 2.3.0
installer used: Yes
Webserver: Nginx

same error
calendar and contacts are ok

<!-- gh-comment-id:2287018936 --> @nadihighlander commented on GitHub (Aug 13, 2024): Hi debian 11 , clean install (postwhite is not installed) Database Type: PostgreSQL Modoboa: 2.3.0 installer used: Yes Webserver: Nginx same error calendar and contacts are ok
Author
Owner

@ghost commented on GitHub (Aug 13, 2024):

Getting similar error. Install seems OK. After creating a domain and user in admin, when switching to added user, the webmail errors - first with a generic problem. I switched into debug and got this. I had read something a while back about no default session variable being set, but it was from 2015.

<html>

KeyError at /webmail/

'password'
Request Method: GET
https://mail.manysparrows.io/webmail/
4.2.15
KeyError
'password'
/srv/modoboa/env/lib/python3.10/site-packages/django/contrib/sessions/backends/base.py, line 53, in getitem
modoboa_webmail.views.index
/usr/bin/uwsgi-core
3.10.12
['.', '', '/usr/lib/python310.zip', '/usr/lib/python3.10', '/usr/lib/python3.10/lib-dynload', '/srv/modoboa/env/lib/python3.10/site-packages', '/srv/modoboa/env/lib/python3.10/site-packages/setuptools/_vendor']
Tue, 13 Aug 2024 16:28:25 -0400
</html>
<!-- gh-comment-id:2287097445 --> @ghost commented on GitHub (Aug 13, 2024): Getting similar error. Install seems OK. After creating a domain and user in admin, when switching to added user, the webmail errors - first with a generic problem. I switched into debug and got this. I had read something a while back about no default session variable being set, but it was from 2015. <html><body> <!--StartFragment--><h1>KeyError at /webmail/</h1> <pre class="exception_value">'password'</pre> Request Method: | GET -- | -- https://mail.manysparrows.io/webmail/ 4.2.15 KeyError 'password' /srv/modoboa/env/lib/python3.10/site-packages/django/contrib/sessions/backends/base.py, line 53, in __getitem__ modoboa_webmail.views.index /usr/bin/uwsgi-core 3.10.12 ['.', '', '/usr/lib/python310.zip', '/usr/lib/python3.10', '/usr/lib/python3.10/lib-dynload', '/srv/modoboa/env/lib/python3.10/site-packages', '/srv/modoboa/env/lib/python3.10/site-packages/setuptools/_vendor'] Tue, 13 Aug 2024 16:28:25 -0400 <!--EndFragment--> </body> </html>
Author
Owner

@theitmachine commented on GitHub (Aug 13, 2024):

Same error as donhalloway
Same versions. other pages all appear fine.

`<html>

Name | Installed version | Last version | Description -- | -- | -- | -- Modoboa | 2.3.0 | 2.2.4 | The core part of Modoboa Amavis frontend | 1.5.1 | 1.5.0 | Simple amavis management frontend Contacts | 1.1.2 | 1.1.2 | Address book Radicale management | 1.7.2 | 1.7.2 | Management frontend for Radicale, a simple calendar and contact server. Webmail | 1.9.0 | 1.9.0 | Simple IMAP webmail </html>`
<!-- gh-comment-id:2287235131 --> @theitmachine commented on GitHub (Aug 13, 2024): Same error as donhalloway Same versions. other pages all appear fine. `<html> <body> <!--StartFragment--> Name | Installed version | Last version | Description -- | -- | -- | -- Modoboa | 2.3.0 | 2.2.4 | The core part of Modoboa Amavis frontend | 1.5.1 | 1.5.0 | Simple amavis management frontend Contacts | 1.1.2 | 1.1.2 | Address book Radicale management | 1.7.2 | 1.7.2 | Management frontend for Radicale, a simple calendar and contact server. Webmail | 1.9.0 | 1.9.0 | Simple IMAP webmail <!--EndFragment--> </body> </html>`
Author
Owner

@TSKNF commented on GitHub (Aug 13, 2024):

That makes me confident that we can solve the problem.

The message in the setup that a Dovecot user already exists is irrelevant. I named the user differently in the setup. The message did not appear but the result was the same.

Whether MariaDB or Postresql is used makes no difference.

Can someone tell me if modoboa supports ipv6 only?

<!-- gh-comment-id:2287279906 --> @TSKNF commented on GitHub (Aug 13, 2024): That makes me confident that we can solve the problem. The message in the setup that a Dovecot user already exists is irrelevant. I named the user differently in the setup. The message did not appear but the result was the same. Whether MariaDB or Postresql is used makes no difference. Can someone tell me if modoboa supports ipv6 only?
Author
Owner

@VladislavGatsenko commented on GitHub (Aug 14, 2024):

By the way, connecting external clients doesn't work either. Who has the same thing?

And file2ban service starts with an error

<!-- gh-comment-id:2288319275 --> @VladislavGatsenko commented on GitHub (Aug 14, 2024): By the way, connecting external clients doesn't work either. Who has the same thing? And file2ban service starts with an error
Author
Owner

@Spitfireap commented on GitHub (Aug 14, 2024):

The password thing on the webmail is logic, we need to push an update for webmail since we've added oauth2 login.
@VladislavGatsenko the external client should work though. Can you add detail on this error ?

<!-- gh-comment-id:2288377638 --> @Spitfireap commented on GitHub (Aug 14, 2024): The password thing on the webmail is logic, we need to push an update for webmail since we've added oauth2 login. @VladislavGatsenko the external client should work though. Can you add detail on this error ?
Author
Owner

@ghost commented on GitHub (Aug 14, 2024):

Excellent news. Is there a way that I can update the webmail code once it is finished? (or can I be a tester?)

<!-- gh-comment-id:2288914132 --> @ghost commented on GitHub (Aug 14, 2024): Excellent news. Is there a way that I can update the webmail code once it is finished? (or can I be a tester?)
Author
Owner

@Spitfireap commented on GitHub (Aug 14, 2024):

The update will be fairly easy to apply.
I think that the hotfix will consist in asking the user password the first time you open the webmail for the session before we've got time to fully implement oauth2 flow (unless @tonioo gets more time to work on that :D ). I'll have time to work on this hotfix this weekend.

<!-- gh-comment-id:2289042957 --> @Spitfireap commented on GitHub (Aug 14, 2024): The update will be fairly easy to apply. I think that the hotfix will consist in asking the user password the first time you open the webmail for the session before we've got time to fully implement oauth2 flow (unless @tonioo gets more time to work on that :D ). I'll have time to work on this hotfix this weekend.
Author
Owner

@ghost commented on GitHub (Aug 14, 2024):

Thanks, I have been a longtime django user, new to modoboa, so am anxious to start using it.

<!-- gh-comment-id:2289254292 --> @ghost commented on GitHub (Aug 14, 2024): Thanks, I have been a longtime django user, new to modoboa, so am anxious to start using it.
Author
Owner

@Spitfireap commented on GitHub (Aug 18, 2024):

Ok can those affected by the issue try this :

  • make sure you have modoboa 2.3.0 fully updated and working
  • sudo -u modoboa -i bash
  • /srv/modoboa/env/bin/pip install modoboa-webmail==1.9.1b1
  • as root : systemctl restart uwsgi

To revert do all the steps but instead of 1.9.1b1 put 1.9.0 :)

<!-- gh-comment-id:2295268229 --> @Spitfireap commented on GitHub (Aug 18, 2024): Ok can those affected by the issue try this : - make sure you have modoboa 2.3.0 fully updated and working - `sudo -u modoboa -i bash` - `/srv/modoboa/env/bin/pip install modoboa-webmail==1.9.1b1` - as root : `systemctl restart uwsgi` To revert do all the steps but instead of 1.9.1b1 put 1.9.0 :)
Author
Owner

@ultr41337h4xor commented on GitHub (Aug 19, 2024):

Same issue here I believe. I am also on Debian 12, used the run.py --upgrade script to update my installation. After the upgrade, I've noticed the new interface is used as default, however I can't log in (Internal Server Error when I enter my login data). Also can't send any emails from an external client.

image

image

Ok can those affected by the issue try this :

* make sure you have modoboa 2.3.0 fully updated and working

* `sudo -u modoboa -i bash`

* `/srv/modoboa/env/bin/pip install modoboa-webmail==1.9.1b1`

* as root : `systemctl restart uwsgi`

To revert do all the steps but instead of 1.9.1b1 put 1.9.0 :)

Tried it, didn't help, unfortunately.

<!-- gh-comment-id:2296376505 --> @ultr41337h4xor commented on GitHub (Aug 19, 2024): Same issue here I believe. I am also on Debian 12, used the run.py --upgrade script to update my installation. After the upgrade, I've noticed the new interface is used as default, however I can't log in (Internal Server Error when I enter my login data). Also can't send any emails from an external client. ![image](https://github.com/user-attachments/assets/95961d09-a17d-450a-8898-4210aca40d61) ![image](https://github.com/user-attachments/assets/e0903699-6526-48e4-8657-86ff4285ccf0) > Ok can those affected by the issue try this : > > * make sure you have modoboa 2.3.0 fully updated and working > > * `sudo -u modoboa -i bash` > > * `/srv/modoboa/env/bin/pip install modoboa-webmail==1.9.1b1` > > * as root : `systemctl restart uwsgi` > > > To revert do all the steps but instead of 1.9.1b1 put 1.9.0 :) Tried it, didn't help, unfortunately.
Author
Owner

@Spitfireap commented on GitHub (Aug 19, 2024):

This is not the same issue. This issue is about strictly the webmail.
Please check the specific upgrade instructions for 2.3.0

<!-- gh-comment-id:2296380399 --> @Spitfireap commented on GitHub (Aug 19, 2024): This is not the same issue. This issue is about strictly the webmail. [Please check the specific upgrade instructions for 2.3.0](https://modoboa.readthedocs.io/en/latest/upgrade.html#version-2-3-0)
Author
Owner

@ghost commented on GitHub (Aug 19, 2024):

Ok can those affected by the issue try this :

* make sure you have modoboa 2.3.0 fully updated and working

* `sudo -u modoboa -i bash`

* `/srv/modoboa/env/bin/pip install modoboa-webmail==1.9.1b1`

* as root : `systemctl restart uwsgi`

To revert do all the steps but instead of 1.9.1b1 put 1.9.0 :)

Tried it, went into webmail and now got a screen asking for password, so progress, then got "authentication error".

<!-- gh-comment-id:2297202025 --> @ghost commented on GitHub (Aug 19, 2024): > Ok can those affected by the issue try this : > > * make sure you have modoboa 2.3.0 fully updated and working > > * `sudo -u modoboa -i bash` > > * `/srv/modoboa/env/bin/pip install modoboa-webmail==1.9.1b1` > > * as root : `systemctl restart uwsgi` > > > To revert do all the steps but instead of 1.9.1b1 put 1.9.0 :) Tried it, went into webmail and now got a screen asking for password, so progress, then got "authentication error".
Author
Owner

@jrosier commented on GitHub (Aug 25, 2024):

Ok can those affected by the issue try this :

* make sure you have modoboa 2.3.0 fully updated and working

* `sudo -u modoboa -i bash`

* `/srv/modoboa/env/bin/pip install modoboa-webmail==1.9.1b1`

* as root : `systemctl restart uwsgi`

To revert do all the steps but instead of 1.9.1b1 put 1.9.0 :)

Works for me!

<!-- gh-comment-id:2308737650 --> @jrosier commented on GitHub (Aug 25, 2024): > Ok can those affected by the issue try this : > > * make sure you have modoboa 2.3.0 fully updated and working > > * `sudo -u modoboa -i bash` > > * `/srv/modoboa/env/bin/pip install modoboa-webmail==1.9.1b1` > > * as root : `systemctl restart uwsgi` > > > To revert do all the steps but instead of 1.9.1b1 put 1.9.0 :) Works for me!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/modoboa-modoboa#1826
No description provided.