kratos icon indicating copy to clipboard operation
kratos copied to clipboard

401 when db is down (should be 500)

Open nicolasburtey opened this issue 3 years ago • 1 comments

Preflight checklist

Describe the bug

When a request is sent to kratos and the postgres is down or unreachable, kratos sent back a 401 error.

This is creating issue, specially for client that disconnect the users on receipt of a 401, because those users would be randomly logged out when the database kratos relies on it not accessible.

I believe kratos should return a 500 in that scenario as this is a system issue.

Reproducing the bug

  • start kratos
  • create a user
  • make a query to /whoami endpoints, should return 200
  • stop db (postgresql in our case)
    • make a query to /whoami endpoints, should return 500 but return 401

Relevant log output

No response

Relevant configuration

No response

Version

11.1 and 13 same behavior

On which operating system are you observing this issue?

Linux

In which environment are you deploying?

None

Additional Context

local development with postgresdb as the database

nicolasburtey avatar Apr 23 '23 09:04 nicolasburtey

We have run into this issue as well. We are using caching, but want to know the difference between a legitimate 401 and a DB issue or other error.

osbornk avatar Apr 29 '24 23:04 osbornk