Mailu: Login fails after upgrade to 1.6

Created on 31 Jan 2019  Â·  29Comments  Â·  Source: Mailu/Mailu

Hi, thanks for this awesome package!

After my recent upgrade attempt from 1.5 to 1.6 all users were suddenly unable to login on the server. It didn't work neither over IMAP nor webmail.
The error from the front container shows: client login failed: "Authentication credentials invalid" while in http auth state

typbug

Most helpful comment

As the reporter of this "bug", I'm fine with closing this issue. Thanks again for the support.

All 29 comments

Also occurs for me.

I can, however, login to /admin. I should mention that reverting back to the VERSION=1.5 in the env file does fix the issue (that is - it doesn't break a revert).

Did you updated your docker-compose.yml file? There were a few changes in it (we have a new setup utility to create new docker-compose files).

Furthermore, can you please share your (blackend) docker-compose and env file with us?

Yes, I updated the docker-compose.yml and used the newly named environment file, both created with the new setup utility. This is my configuration for both versions.

Version 1.5:

Version 1.6:

Thanks for your help!

@hoellen - I see your new guide - is there a migration guide anywhere for 1.5 -> 1.6?

Same issue, had to revert to 1.5

@hoellen - I see your new guide - is there a migration guide anywhere for 1.5 -> 1.6?

The release notes.

@Nebukadneza recommended me to adjust the PASSWORD_SCHEMA= to be the same from the .env to be in the mailu.env. So I adjusted it to PASSWORD_SCHEME=SHA512-CRYPT. Unfortunately with the same result: I can't login nor via imap, nor via /webmail nor /admin:

admin_1 | [2019-03-22 16:34:45,335] ERROR in app: Exception on /internal/auth/email [GET]
admin_1 | Traceback (most recent call last):
admin_1 | File "/usr/lib/python3.6/site-packages/flask/app.py", line 2292, in wsgi_app
admin_1 | response = self.full_dispatch_request()
admin_1 | File "/usr/lib/python3.6/site-packages/flask/app.py", line 1815, in full_dispatch_request
admin_1 | rv = self.handle_user_exception(e)
admin_1 | File "/usr/lib/python3.6/site-packages/flask/app.py", line 1718, in handle_user_exception
admin_1 | reraise(exc_type, exc_value, tb)
admin_1 | File "/usr/lib/python3.6/site-packages/flask/_compat.py", line 35, in reraise
admin_1 | raise value
admin_1 | File "/usr/lib/python3.6/site-packages/flask/app.py", line 1813, in full_dispatch_request
admin_1 | rv = self.dispatch_request()
admin_1 | File "/usr/lib/python3.6/site-packages/flask/app.py", line 1799, in dispatch_request
admin_1 | return self.view_functionsrule.endpoint
admin_1 | File "/usr/lib/python3.6/site-packages/flask_limiter/extension.py", line 544, in __inner
admin_1 | return obj(a, *k)
admin_1 | File "/app/mailu/internal/views/auth.py", line 18, in nginx_authentication
admin_1 | headers = nginx.handle_authentication(flask.request.headers)
admin_1 | File "/app/mailu/internal/nginx.py", line 29, in handle_authentication
admin_1 | server, port = get_server(headers["Auth-Protocol"], False)

front_1 | 2019/03/22 16:34:14 [info] 8#8: *73 client 172.18.0.6:59980 connected to 0.0.0.0:10143
front_1 | 127.0.0.1 - - [22/Mar/2019:16:34:14 +0000] "GET /auth/email HTTP/1.0" 200 0 "-" "-"
front_1 | 2019/03/22 16:34:14 [info] 8#8: *73 client login failed: "Authentication credentials invalid" while in http auth state, client: 172.18.0.6, server: 0.0.0.0:10143, login: "[email protected]"
webmail_1 | 172.18.0.2 - - [22/Mar/2019:16:34:14 +0000] "POST /?_task=login HTTP/1.0" 200 2919 "https://my.mail.com/webmail/?_task=login" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.109 Safari/537.36"
front_1 | 172.18.0.1 - - [22/Mar/2019:16:34:15 +0000] "POST /webmail/?_task=login HTTP/2.0" 200 2215 "https://my.mail.com/webmail/?_task=login" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3626.109 Safari/537.36

Any news on this? It's been a while and the problem is still there. Have to stick to an older version 🤔

Today I was able to fix it with the kind help of @Nebukadneza (thanks!).

And it turned out to be a silly thing: the ROOT variable in mailu.env (and the generated paths in the docker-compose.yml) were pointing to the root of the mailu installation, whereas it should point to the directory where the data is saved. I guess I got confused by the new and beautiful setup generation tool and while generating I mixed up the right paths.

@flayks, can you please check whether the ROOT variables in both versions are identical?

Today I was able to fix it with the kind help of @Nebukadneza (thanks!).

And it turned out to be a silly thing: the ROOT variable in mailu.env (and the generated paths in the docker-compose.yml) were pointing to the root of the mailu installation, whereas it should point to the directory where the data is saved. I guess I got confused by the new and beautiful setup generation tool and while generating I mixed up the right paths.

@flayks, can you please check whether the ROOT variables in both versions are identical?

@xamanu No luck for me, I did a backup of my 1.5 mailu directory, copied it and used the docker-compose.yml and mailu.env from the 1.6 generator but impossible to get my domain working, it justs doesn't show on my https://mail.domain.com :/ Had to revert to 1.5 again (which works perfectly).

Could I have a copy of your config files? Is your setup working?

Hi,

thanks again to @xamanu for letting me examine the situation on his testing box!

@flayks Could you do a docker-compose logs -t -f front admin webmail and then attempt a login on either webmail, or both webmail and then later IMAP? Also, if possible, try to include the startup of admin.

Do you have a second box for testing this on? If so, it’s quite easy: Either you also copy over the certs, and use (broken) SSL, only changing the listening IP. Or you set TLS_FLAVOR=notls, and build yourself a ssh forward like ssh -L 127.0.0.1:8080:127.0.0.1:80 <[email protected]>, then test on http://localhost:8080/webmail(or/admin) …. If you don’t have a box for testing, I can sponsor a small one for a couple of days ^_^.

Best & Thanks,
-Dario

Could I have a copy of your config files? Is your setup working?

Yes it is! My live system is on 1.6 now. :rainbow:

The config files i posted above are working. I just had to change the paths from /home/user/deploy to what I had before ./data/mailu in mailu.env and the docker-compose.yml to find my data located in /home/user/deploy/data/mailu.

As the reporter of this "bug", I'm fine with closing this issue. Thanks again for the support.

@flayks any news on your side?

@flayks any news on your side?

@kaiyou I opened a new issue as I can't even install the 1.6 :/

Hi,
I have this problem too.
After I installed mailu v1.6 , I can not login to webmail rainloop or roundcube , and gives me "Authentication failed" error.

Any help?

My problem was the configuration pointing to a wrong directory for the database. Can you share your cleaned configuration (no passwords, domains or keys)?

@xamanu
This is my mailu.env config : https://pastebin.com/g8HDRqcR

And the docker-compose.yml please

@xamanu
Of-course, And this is my mailu docker-compose.yml: https://pastebin.com/uUJt0qur

Can you confirm you have the main.db located under /mystorage/docker/storage/mail/data?

Yes, That is.

Then it is not the problem I had. Sorry.

Hi,

can you try:
sqlite3 -cmd 'select localpart, created_at, updated_at from user;' /mystorage/docker/storage/mail/data/main.db
And check if the users are in fact the ones you expect? I’m asking because we’ve had some users who managed to have multiple main.db sqlite-files in their system, and upon upgrading used the wrong one …

@Nebukadneza
Thanks you for your reply.

Yes, users are in main.db as I was added.
I installed new mailu v1.6 not upgrade older version. and I can successfully login to /admin and create info@*.com user with my own password. but when I want to login to roundcube or rainloop via that username and password getting me "Authentication failed" error.
It's great to know I can login with that username and password via /admin panel. but no success via roundcube or rainloop .

Hi @Nebukadneza @xamanu ,
I found my problem, and that was SUBNET configuration. I am using custom network with different ip range, so SUBNET configuration must change to it's subnet.

Thanks you.

Sorry i wasn’t much help, and glad you found it!

Since the issues here mostly turned out to be of other underlying problems, is everyone fine with closing the issue?

I also got a brand new installation into this state (both 1.6 and master) by:

  • Running "docker-compose up"
  • Running "docker-compose down" / killing the stack
  • Changing my mind about some of the setup, which was conflicting with other docker-compose stacks on the same host, _renaming the network in the docker-compose.yml_ to resolve this
  • Running "docker-compose up" again

At this point, I was confused because the stack was coming up cleanly but clearing out the data didn't seem to resolve the problem - no user could log in via IMAP.

What did resolve the problem was "docker network prune" and bringing the stack up again. I'm not sure exactly what went wrong with the internal networking, or whether Docker / mailu could have detected it.

Possibly related to a stale network with a name conflict? Many features are based on name resolution inside a network, if the front container contacts a different container named admin on your host, things will start to go really wrong.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

SJS28092018 picture SJS28092018  Â·  3Comments

whitef0x0 picture whitef0x0  Â·  4Comments

githtz picture githtz  Â·  4Comments

alizowghi picture alizowghi  Â·  3Comments

c-holtermann picture c-holtermann  Â·  3Comments