Credentials ok but can't log in

Hi, for some reason I can’t seem to log in to one of my Metabase instances. I enter my username and password and it just redirects me back to login.
If I enter invalid credentials I get the expected “did not match stored password” so that means that the credentials are fine and Metabase can connect to its database.
In the logs all I see is

09-10 14:29:44 DEBUG metabase.middleware :: POST /api/session 200 (116 ms) (3 DB calls). Jetty threads: 8/50 (3 busy, 5 idle, 0 queued)
09-10 14:29:44 DEBUG metabase.middleware :: GET /api/user/current 401 (181 µs) (0 DB calls).
"Unauthenticated" 

Any ideas what could be happening here?

The 401 Unauthorized error is an HTTP status code that means the page you were trying to access cannot be loaded until you first log in with a valid user ID and password. If you have just logged in and received the 401 Unauthorized error, it means that the credentials you entered were invalid for some reason

I actually think I have had a similar experience with a H2 application database just spun up for testing. Thought it might have been the H2 file that got broken. What database did use?

Maybe I should have reported it but didn’t because I didn’t have much to go by. Will be mindful of your observation about testing with another password and observing “did not match stored password” if I should experience it again.

I cleared cookies in the browser and was able to log in.
Looks like a bug to me…
Anyway thanks for the help.

Cheers,
Mauricio

2 Likes

Not much help from me I guess :wink: … but sweet that you now narrowed it down further (and others now at least have a workaround)

I have moved this topic to the #bug-reports category

Given that clearing cookies fixed the issue. If anyone else comes across this, can they check the values of their cookies before clearing?
There are plenty of add-ons that let you view/edit the current site’s cookies.

1 Like

A case reported here - with cookie clearing not fixing the problem: https://github.com/metabase/metabase/issues/8508#issuecomment-420845852

Sounds like a different problem. He’s geting an error about the password, not just being ‘unauthenticated’.

@AndrewMBaines you’re right regarding the post I deep-linked to just above. Though, rereading the full issue including title sounds like the initial issue on there is similar to this above:

I could have been clearer with my previous link target and/or explanation. 2nd experience deep-linked is clearly something different.

Ah, sorry. Looks like there’s more than one problem.

1 Like