User can no longer login, password seem okay but login keeps failing

Mattermost no longer allows me to login using the web frontend. Resetting the password does not solve it.

Steps to reproduce
In my instance, I try to login using the web frontend.

Expected behavior
I can log in successfully.

Observed behavior
I get the message Enter a valid email or username and/or password.

I tried to use mmctl user chnage-password to reset the password of my admin account. I get an email that my password has been changed. I tried also to use I forgot my password feature to reset the password. I get an email and can successfully change the password. The changed password is confirmed via email.

This are the only logged lines (cleaned using jq) during my login attempt. No other lines are logged

  "timestamp": "2024-01-03 22:46:51.565 +01:00",
  "level": "debug",
  "msg": "Enter a valid email or username and/or password.",
  "caller": "web/context.go:101",
  "path": "/api/v4/users/login",
  "request_id": "hqh7yq5jb7g89y53eboghkbgza",
  "ip_addr": "__ removed from logs __",
  "user_id": "",
  "method": "POST",
  "err_where": "login",
  "http_code": 401,
  "err_details": ""
  "timestamp": "2024-01-03 22:46:51.565 +01:00",
  "level": "debug",
  "msg": "Received HTTP request",
  "caller": "web/handlers.go:156",
  "method": "POST",
  "url": "/api/v4/users/login",
  "request_id": "hqh7yq5jb7g89y53eboghkbgza",
  "status_code": "401"

I see no error messages in the logs that would explain the failed logins. For me it looks as if I simply put wrong crentials. I use a password manager (plus copy&paste) thus I can rule out typos.

I suspected a problem with the DB, thus I had a look at the config.json. It had some strange setting in SqlSettings the DataSource. I am using the default docker setup. The setting was set to postgres://mmuser:mostest@localhost/mattermost_test?sslmode=disable\u0026connect_timeout=10. I tried to fix that to the URL here to the correct value (postgres://mmuser:mmuser_password@postgres:5432/mattermost?sslmode=disable\u0026connect_timeout=10) but this had no effect (after restart of the container).

Can you give me any good advice on how to debug this further?


I very much doubt this is a database problem… if Mattermost can’t talk to the database, you’d have much bigger problems! I’d start by increasing log verbosity to DEBUG, tail the logs, try to log in, and see if that gets you more info.

OK, sorry for disturbing. I looked at the logs and these were already set to debug. So not much to gain here.

I nevertheless found a hint: The docker compose is created such that the version is pinned. I was running an ancient version 7.1 or so. I upgraded to 7.10 and then via 8.1 to 9.4. Now the server is running like nothing. Thanks for thinking with me!