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

**URL:** <https://forum.mattermost.com/t/user-can-no-longer-login-password-seem-okay-but-login-keeps-failing/17648>\
**Category:** Troubleshooting\
**Created:** [January 3, 2024, 10:33pm UTC](https://forum.mattermost.com/t/user-can-no-longer-login-password-seem-okay-but-login-keeps-failing/17648 "2024-01-03T22:33:01Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![clupus](https://avatars.discourse-cdn.com/v4/letter/c/3e96dc/32.png) [@clupus](https://forum.mattermost.com/u/clupus)\
**Post date:** [January 3, 2024, 10:33pm UTC](https://forum.mattermost.com/t/user-can-no-longer-login-password-seem-okay-but-login-keeps-failing/17648/1 "2024-01-03T22:33:01Z")

</div>

**Summary**  
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

```auto
{
  "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](https://github.com/mattermost/docker.git). 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?

Christian

---

<div class="post-metadata">

**Author:** ![john.oliver](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mattermost.com/john.oliver/32/6436_2.png) [@john.oliver](https://forum.mattermost.com/u/john.oliver)\
**Post date:** [January 4, 2024, 8:08pm UTC](https://forum.mattermost.com/t/user-can-no-longer-login-password-seem-okay-but-login-keeps-failing/17648/2 "2024-01-04T20:08:22Z")

</div>

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.

[https://docs.mattermost.com/configure/logging-configuration-settings.html](https://docs.mattermost.com/configure/logging-configuration-settings.html)

---

<div class="post-metadata">

**Author:** ![clupus](https://avatars.discourse-cdn.com/v4/letter/c/3e96dc/32.png) [@clupus](https://forum.mattermost.com/u/clupus)\
**Post date:** [January 5, 2024, 5:42pm UTC](https://forum.mattermost.com/t/user-can-no-longer-login-password-seem-okay-but-login-keeps-failing/17648/3 "2024-01-05T17:42:01Z")

</div>

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!
