Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot login after upgrade to bitwarden/self-host:2024.11.1-beta #5121

Open
1 task done
stanislav-bios-baranov opened this issue Dec 5, 2024 · 3 comments
Open
1 task done
Labels
bug bw-unified-deploy An Issue related to Bitwarden unified deployment

Comments

@stanislav-bios-baranov
Copy link

Steps To Reproduce

  1. Go to '#/login'
  2. Click on 'Log in with master password'

Expected Result

Logged in to secrets list or 2FA prompt

Actual Result

An error has occurred.
An unexpected error has occurred.

Screenshots or Videos

image

Additional Context

I have YubiKey, email and DUO setup as 2FA providers.

identity.log contains errors:

crit: Duende.IdentityServer.Hosting.IdentityServerMiddleware[0]
      => SpanId:0793de8fbc8a9643, TraceId:cbf9c730dfc53426bd441f606553d5c3, ParentId:0000000000000000 => ConnectionId:0HN8LAP7QJDPM => RequestPath:/identity/connect/token RequestId:0HN8LAP7QJDPM:00000001 => IpAddress:172.18.0.4 UserAgent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36 DeviceType:9 Origin:9 ClientVersion:2024.10.5
      Unhandled exception: Unable to cast object of type 'System.Boolean' to type 'System.String'.
      System.InvalidCastException: Unable to cast object of type 'System.Boolean' to type 'System.String'.
         at Bit.Core.Auth.Identity.YubicoOtpTokenProvider.<>c.<CanGenerateTwoFactorTokenAsync>b__3_0(Object v) in /source/src/Core/Auth/Identity/YubicoOtpTokenProvider.cs:line 33
         at System.Linq.Enumerable.Any[TSource](IEnumerable`1 source, Func`2 predicate)
         at Bit.Core.Auth.Identity.YubicoOtpTokenProvider.CanGenerateTwoFactorTokenAsync(UserManager`1 manager, User user) in /source/src/Core/Auth/Identity/YubicoOtpTokenProvider.cs:line 33
         at Microsoft.AspNetCore.Identity.UserManager`1.GetValidTwoFactorProvidersAsync(TUser user)
         at Bit.Identity.IdentityServer.RequestValidators.TwoFactorAuthenticationValidator.RequiresTwoFactorAsync(User user, ValidatedTokenRequest request) in /source/src/Identity/IdentityServer/RequestValidators/TwoFactorAuthenticationValidator.cs:line 86
         at Bit.Identity.IdentityServer.RequestValidators.BaseRequestValidator`1.ValidateAsync(T context, ValidatedTokenRequest request, CustomValidatorRequestContext validatorContext) in /source/src/Identity/IdentityServer/RequestValidators/BaseRequestValidator.cs:line 101
         at Bit.Identity.IdentityServer.RequestValidators.ResourceOwnerPasswordValidator.ValidateAsync(ResourceOwnerPasswordValidationContext context) in /source/src/Identity/IdentityServer/RequestValidators/ResourceOwnerPasswordValidator.cs:line 109
         at Duende.IdentityServer.Validation.TokenRequestValidator.ValidateResourceOwnerCredentialRequestAsync(NameValueCollection parameters) in /_/src/IdentityServer/Validation/Default/TokenRequestValidator.cs:line 601
         at Duende.IdentityServer.Validation.TokenRequestValidator.RunValidationAsync(Func`2 validationFunc, NameValueCollection parameters) in /_/src/IdentityServer/Validation/Default/TokenRequestValidator.cs:line 273
         at Duende.IdentityServer.Validation.TokenRequestValidator.ValidateRequestAsync(TokenRequestValidationContext context) in /_/src/IdentityServer/Validation/Default/TokenRequestValidator.cs:line 194
         at Duende.IdentityServer.Endpoints.TokenEndpoint.ProcessTokenRequestAsync(HttpContext context) in /_/src/IdentityServer/Endpoints/TokenEndpoint.cs:line 120
         at Duende.IdentityServer.Endpoints.TokenEndpoint.ProcessAsync(HttpContext context) in /_/src/IdentityServer/Endpoints/TokenEndpoint.cs:line 81
         at Duende.IdentityServer.Hosting.IdentityServerMiddleware.Invoke(HttpContext context, IdentityServerOptions options, IEndpointRouter router, IUserSession userSession, IEventService events, IIssuerNameService issuerNameService, ISessionCoordinationService sessionCoordinationService) in /_/src/IdentityServer/Hosting/IdentityServerMiddleware.cs:line 106
fail: Microsoft.AspNetCore.Server.Kestrel[13]
      => SpanId:0793de8fbc8a9643, TraceId:cbf9c730dfc53426bd441f606553d5c3, ParentId:0000000000000000 => ConnectionId:0HN8LAP7QJDPM => RequestPath:/identity/connect/token RequestId:0HN8LAP7QJDPM:00000001
      Connection id "0HN8LAP7QJDPM", Request id "0HN8LAP7QJDPM:00000001": An unhandled exception was thrown by the application.
      System.InvalidCastException: Unable to cast object of type 'System.Boolean' to type 'System.String'.
         at Bit.Core.Auth.Identity.YubicoOtpTokenProvider.<>c.<CanGenerateTwoFactorTokenAsync>b__3_0(Object v) in /source/src/Core/Auth/Identity/YubicoOtpTokenProvider.cs:line 33
         at System.Linq.Enumerable.Any[TSource](IEnumerable`1 source, Func`2 predicate)
         at Bit.Core.Auth.Identity.YubicoOtpTokenProvider.CanGenerateTwoFactorTokenAsync(UserManager`1 manager, User user) in /source/src/Core/Auth/Identity/YubicoOtpTokenProvider.cs:line 33
         at Microsoft.AspNetCore.Identity.UserManager`1.GetValidTwoFactorProvidersAsync(TUser user)
         at Bit.Identity.IdentityServer.RequestValidators.TwoFactorAuthenticationValidator.RequiresTwoFactorAsync(User user, ValidatedTokenRequest request) in /source/src/Identity/IdentityServer/RequestValidators/TwoFactorAuthenticationValidator.cs:line 86
         at Bit.Identity.IdentityServer.RequestValidators.BaseRequestValidator`1.ValidateAsync(T context, ValidatedTokenRequest request, CustomValidatorRequestContext validatorContext) in /source/src/Identity/IdentityServer/RequestValidators/BaseRequestValidator.cs:line 101
         at Bit.Identity.IdentityServer.RequestValidators.ResourceOwnerPasswordValidator.ValidateAsync(ResourceOwnerPasswordValidationContext context) in /source/src/Identity/IdentityServer/RequestValidators/ResourceOwnerPasswordValidator.cs:line 109
         at Duende.IdentityServer.Validation.TokenRequestValidator.ValidateResourceOwnerCredentialRequestAsync(NameValueCollection parameters) in /_/src/IdentityServer/Validation/Default/TokenRequestValidator.cs:line 601
         at Duende.IdentityServer.Validation.TokenRequestValidator.RunValidationAsync(Func`2 validationFunc, NameValueCollection parameters) in /_/src/IdentityServer/Validation/Default/TokenRequestValidator.cs:line 273
         at Duende.IdentityServer.Validation.TokenRequestValidator.ValidateRequestAsync(TokenRequestValidationContext context) in /_/src/IdentityServer/Validation/Default/TokenRequestValidator.cs:line 194
         at Duende.IdentityServer.Endpoints.TokenEndpoint.ProcessTokenRequestAsync(HttpContext context) in /_/src/IdentityServer/Endpoints/TokenEndpoint.cs:line 120
         at Duende.IdentityServer.Endpoints.TokenEndpoint.ProcessAsync(HttpContext context) in /_/src/IdentityServer/Endpoints/TokenEndpoint.cs:line 81
         at Duende.IdentityServer.Hosting.IdentityServerMiddleware.Invoke(HttpContext context, IdentityServerOptions options, IEndpointRouter router, IUserSession userSession, IEventService events, IIssuerNameService issuerNameService, ISessionCoordinationService sessionCoordinationService) in /_/src/IdentityServer/Hosting/IdentityServerMiddleware.cs:line 106
         at Duende.IdentityServer.Hosting.IdentityServerMiddleware.Invoke(HttpContext context, IdentityServerOptions options, IEndpointRouter router, IUserSession userSession, IEventService events, IIssuerNameService issuerNameService, ISessionCoordinationService sessionCoordinationService) in /_/src/IdentityServer/Hosting/IdentityServerMiddleware.cs:line 128
         at Duende.IdentityServer.Hosting.MutualTlsEndpointMiddleware.Invoke(HttpContext context, IAuthenticationSchemeProvider schemes) in /_/src/IdentityServer/Hosting/MutualTlsEndpointMiddleware.cs:line 95
         at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
         at Duende.IdentityServer.Hosting.DynamicProviders.DynamicSchemeAuthenticationMiddleware.Invoke(HttpContext context) in /_/src/IdentityServer/Hosting/DynamicProviders/DynamicSchemes/DynamicSchemeAuthenticationMiddleware.cs:line 51
         at Duende.IdentityServer.Hosting.BaseUrlMiddleware.Invoke(HttpContext context) in /_/src/IdentityServer/Hosting/BaseUrlMiddleware.cs:line 27
         at Bit.Core.Utilities.CurrentContextMiddleware.Invoke(HttpContext httpContext, ICurrentContext currentContext, GlobalSettings globalSettings) in /source/src/Core/Utilities/CurrentContextMiddleware.cs:line 19
         at Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware.Invoke(HttpContext context)
         at Microsoft.AspNetCore.Builder.Extensions.UsePathBaseMiddleware.InvokeCore(HttpContext context, PathString matchedPath, PathString remainingPath)
         at Bit.Identity.Startup.<>c__DisplayClass10_1.<<Configure>b__2>d.MoveNext() in /source/src/Identity/Startup.cs:line 188
      --- End of stack trace from previous location ---
         at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application)

Githash Version

6862a9b-dirty

Environment Details

Lubuntu, Docker

Database Image

postgres:15-alpine

Issue-Link

#2480

Issue Tracking Info

  • I understand that work is tracked outside of Github. A PR will be linked to this issue should one be opened to address it, but Bitwarden doesn't use fields like "assigned", "milestone", or "project" to track progress.
@stanislav-bios-baranov stanislav-bios-baranov added bug bw-unified-deploy An Issue related to Bitwarden unified deployment labels Dec 5, 2024
@stanislav-bios-baranov
Copy link
Author

I was upgrading from bitwarden/self-host:2024.8.3-beta
I have tried to roll back to it, but seems DB migrations are not backward compatible. If I try to run bitwarden/self-host:2024.8.3-beta it complains on some DB columns missing.

Would be glad for any guidance how to restore access without losing whole vault.

@jtodddd
Copy link

jtodddd commented Dec 6, 2024

Hi there,

I am glad to see you were able to get some help from our integration team regarding this. The issue here will remain open for now as it has been escalated for further investigation.

Thanks!

@Berzerker
Copy link

I’m getting a similar issue, though a different error, on 2024.12.1 upgrading from 2024.6.1

bitwarden/self-host#328

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug bw-unified-deploy An Issue related to Bitwarden unified deployment
Projects
None yet
Development

No branches or pull requests

3 participants