bitwarden / server

Bitwarden infrastructure/backend (API, database, Docker, etc).
https://bitwarden.com
Other
15.12k stars 1.26k forks source link

500 Unexpected error during login - CorsPolicyService - key not found in the key ring #4135

Open fusion4bass opened 3 months ago

fusion4bass commented 3 months ago

Steps To Reproduce

  1. Deploy self hosted version of Bitwarden using docker-compose
  2. Try to login on http://localhost

Expected Result

Login

Actual Result

Browser: POST | http://localhost/identity/connect/token 500 Internal Server Error

Docker compose logs:

bitwarden-identity       | warn: Duende.IdentityServer.Hosting.CorsPolicyProvider[0]
bitwarden-identity       |       => SpanId:38a461c5ddb02c71, TraceId:115cc524ce21877314e5c5f24c408398, ParentId:0000000000000000 => ConnectionId:0HN3U2VRREFDC => RequestPath:/identity/connect/token RequestId:0HN3U2VRREFDC:00000001
bitwarden-identity       |       CorsPolicyService did not allow origin: moz-extension://b8e3f0cd-d670-4e5a-9264-b0c7d6b17580
bitwarden-identity       | crit: Duende.IdentityServer.Hosting.IdentityServerMiddleware[0]
bitwarden-identity       |       => SpanId:38a461c5ddb02c71, TraceId:115cc524ce21877314e5c5f24c408398, ParentId:0000000000000000 => ConnectionId:0HN3U2VRREFDC => RequestPath:/identity/connect/token RequestId:0HN3U2VRREFDC:00000001
bitwarden-identity       |       Unhandled exception: The key {095f5985-3c62-4761-8965-120b0b276b68} was not found in the key ring. For more information go to https://aka.ms/aspnet/dataprotectionwarning
bitwarden-identity       | fail: Microsoft.AspNetCore.Server.Kestrel[13]
bitwarden-identity       |       => SpanId:38a461c5ddb02c71, TraceId:115cc524ce21877314e5c5f24c408398, ParentId:0000000000000000 => ConnectionId:0HN3U2VRREFDC => RequestPath:/identity/connect/token RequestId:0HN3U2VRREFDC:00000001
bitwarden-identity       |       Connection id "0HN3U2VRREFDC", Request id "0HN3U2VRREFDC:00000001": An unhandled exception was thrown by the application.
bitwarden-identity       |       System.Security.Cryptography.CryptographicException: The key {095f5985-3c62-4761-8965-120b0b276b68} was not found in the key ring. For more information go to https://aka.ms/aspnet/dataprotectionwarning

Screenshots or Videos

obraz

Additional Context

Used to work for few years but recently broke. Tried updates, reinstalling, updatedb, updateconf, renewcert.

Build Version

2024.4.1

Environment

Self-Hosted

Environment Details

Windows 10 WSL2 running: DISTRIB_ID=Ubuntu DISTRIB_RELEASE=20.04 DISTRIB_CODENAME=focal DISTRIB_DESCRIPTION="Ubuntu 20.04.6 LTS"

Exposed on local interfaces.

Issue Tracking Info

sammbw commented 3 months ago

Hi there,

I am unable to reproduce this issue, it has been escalated for further investigation. If you have more information that can help us, please add it below.

Thanks!

fusion4bass commented 3 months ago

These are version of images:

1470771f1351   bitwarden/nginx:2024.5.0           "/entrypoint.sh"   17 hours ago   Up 2 hours (healthy)   80/tcp, 0.0.0.0:80->8080/tcp, 0.0.0.0:443->8443/tcp   bitwarden-nginx
a9fb9e2c48a9   bitwarden/admin:2024.5.0           "/entrypoint.sh"   17 hours ago   Up 2 hours (healthy)   5000/tcp                                              bitwarden-admin
55154f97de9b   bitwarden/sso:2024.5.0             "/entrypoint.sh"   17 hours ago   Up 2 hours (healthy)   5000/tcp                                              bitwarden-sso
c082a091a17d   bitwarden/identity:2024.5.0        "/entrypoint.sh"   17 hours ago   Up 2 hours (healthy)   5000/tcp                                              bitwarden-identity
335475b44fdb   bitwarden/attachments:2024.5.0     "/entrypoint.sh"   17 hours ago   Up 2 hours (healthy)                                                         bitwarden-attachments
62dfa26af618   bitwarden/mssql:2024.5.0           "/entrypoint.sh"   17 hours ago   Up 2 hours (healthy)                                                         bitwarden-mssql
ad314eb3ad96   bitwarden/icons:2024.5.0           "/entrypoint.sh"   17 hours ago   Up 2 hours (healthy)   5000/tcp                                              bitwarden-icons
3b52eb7ed460   bitwarden/web:2024.5.0             "/entrypoint.sh"   17 hours ago   Up 2 hours (healthy)                                                         bitwarden-web
f8715a59ed6f   bitwarden/notifications:2024.5.0   "/entrypoint.sh"   17 hours ago   Up 2 hours (healthy)   5000/tcp                                              bitwarden-notifications
7edd1373e918   bitwarden/api:2024.5.0             "/entrypoint.sh"   17 hours ago   Up 2 hours (healthy)   5000/tcp                                              bitwarden-api
cbe95e8d236a   bitwarden/events:2024.5.0          "/entrypoint.sh"   17 hours ago   Up 2 hours (healthy)   5000/tcp                                              bitwarden-events

I attach recent logs from compose but cannot attach all logs as when I use ./bitwarden.sh compresslogs the file is 1 gig :) compose-logs.txt