kratos
kratos copied to clipboard
401 when db is down (should be 500)
Preflight checklist
- [X] I could not find a solution in the existing issues, docs, nor discussions.
- [X] I agree to follow this project's Code of Conduct.
- [X] I have read and am following this repository's Contribution Guidelines.
- [X] This issue affects my Ory Network project.
- [ ] I have joined the Ory Community Slack.
- [ ] I am signed up to the Ory Security Patch Newsletter.
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
/whoamiendpoints, should return 200 - stop db (postgresql in our case)
-
- make a query to
/whoamiendpoints, should return 500 but return 401
- make a query to
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
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.