self-host icon indicating copy to clipboard operation
self-host copied to clipboard

Login not working after update to latest beta

Open MichaelSch opened this issue 11 months ago • 9 comments

Self-host installation scripts issue

  • [X] I understand this repository only tracks self-host installation scripts and any other issues should be reported in bitwarden/server

Steps To Reproduce

  1. Go to your bitwarden instance
  2. Try to log in

Expected Result

You are logged in

Actual Result

An unknown error occurs after entering the TOTP. From identity.log

  => SpanId:0028e3a2ebc851fa, TraceId:b76d5f72e1d0811f72c96ca850eb3d14, ParentId:0000000000000000 => ConnectionId:0HN99HET88LQO => RequestPath:/identity/connect/token RequestId:0HN99HET88LQO:00000001
  Connection id "0HN99HET88LQO", Request id "0HN99HET88LQO:00000001": An unhandled exception was thrown by the application.
  System.Text.Json.JsonException: 'b' is invalid after a single JSON value. Expected end of data. Path: $ | LineNumber: 15 | BytePositionInLine: 1.
   ---> System.Text.Json.JsonReaderException: 'b' is invalid after a single JSON value. Expected end of data. LineNumber: 15 | BytePositionInLine: 1.
     at System.Text.Json.ThrowHelper.ThrowJsonReaderException(Utf8JsonReader& json, ExceptionResource resource, Byte nextByte, ReadOnlySpan`1 bytes)
     at System.Text.Json.Utf8JsonReader.ConsumeNextToken(Byte marker)
     at System.Text.Json.Utf8JsonReader.ReadSingleSegment()
     at System.Text.Json.Utf8JsonReader.Read()
     at System.Text.Json.Serialization.JsonConverter`1.ReadCore(Utf8JsonReader& reader, T& value, JsonSerializerOptions options, ReadStack& state)
     --- End of inner exception stack trace ---
     at System.Text.Json.ThrowHelper.ReThrowWithPath(ReadStack& state, JsonReaderException ex)
     at System.Text.Json.Serialization.JsonConverter`1.ReadCore(Utf8JsonReader& reader, T& value, JsonSerializerOptions options, ReadStack& state)
     at System.Text.Json.Serialization.Metadata.JsonTypeInfo`1.Deserialize(Utf8JsonReader& reader, ReadStack& state)
     at System.Text.Json.JsonSerializer.ReadFromSpan[TValue](ReadOnlySpan`1 utf8Json, JsonTypeInfo`1 jsonTypeInfo, Nullable`1 actualByteCount)
     at System.Text.Json.JsonSerializer.ReadFromSpan[TValue](ReadOnlySpan`1 json, JsonTypeInfo`1 jsonTypeInfo)
     at System.Text.Json.JsonSerializer.Deserialize[TValue](String json, JsonSerializerOptions options)
     at Bit.Core.Services.LicensingService.ReadUserLicense(User user) in /source/src/Core/Services/Implementations/LicensingService.cs:line 286
     at Bit.Core.Services.LicensingService.ProcessUserValidationAsync(User user) in /source/src/Core/Services/Implementations/LicensingService.cs:line 212
     at Bit.Core.Services.LicensingService.ValidateUserPremiumAsync(User user) in /source/src/Core/Services/Implementations/LicensingService.cs:line 207
     at Bit.Identity.IdentityServer.ProfileService.GetProfileDataAsync(ProfileDataRequestContext context) in /source/src/Identity/IdentityServer/ProfileService.cs:line 46
     at Duende.IdentityServer.Services.DefaultClaimsService.GetAccessTokenClaimsAsync(ClaimsPrincipal subject, ResourceValidationResult resourceResult, ValidatedRequest request) in /_/src/IdentityServer/Services/Default/DefaultClaimsService.cs:line 211
     at Duende.IdentityServer.Services.DefaultTokenService.CreateAccessTokenAsync(TokenCreationRequest request) in /_/src/IdentityServer/Services/Default/DefaultTokenService.cs:line 180
     at Duende.IdentityServer.ResponseHandling.TokenResponseGenerator.ProcessRefreshTokenRequestAsync(TokenRequestValidationResult request) in /_/src/IdentityServer/ResponseHandling/Default/TokenResponseGenerator.cs:line 200
     at Duende.IdentityServer.ResponseHandling.TokenResponseGenerator.ProcessAsync(TokenRequestValidationResult request) in /_/src/IdentityServer/ResponseHandling/Default/TokenResponseGenerator.cs:line 101
     at Duende.IdentityServer.Endpoints.TokenEndpoint.ProcessTokenRequestAsync(HttpContext context) in /_/src/IdentityServer/Endpoints/TokenEndpoint.cs:line 133
     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)

Screenshots or Videos

No response

Additional Context

No response

Build Version

1024.12.1

Environment

Self-Hosted

Environment Details

No response

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.

MichaelSch avatar Dec 31 '24 11:12 MichaelSch

Hi @MichaelSch

Are you using the linux standard deployment or are you self hosting with helm? (https://bitwarden.com/help/self-host-with-helm/)

daniellbw avatar Dec 31 '24 12:12 daniellbw

It‘s the default linux deployment using the Unified beta via podman

MichaelSch avatar Dec 31 '24 12:12 MichaelSch

Having this same issue, noticed it today. Going back to 12.1 image from two weeks ago works. https://hub.docker.com/r/bitwarden/self-host/tags?page=2

7djs7 avatar Jan 01 '25 21:01 7djs7

Also having this issue (Docker deployment, bitwarden/self-host:beta)

baldemar-wuda avatar Jan 02 '25 14:01 baldemar-wuda

I also had this issue on bitwarden/self-host:beta

In my case the license file in /etc/bitwarden/licenses/user/ had gotten corrupted The second to last line of the file for my user was making the json invalid and needed to be deleted I was able to login after doing this, and I re-uploaded my license file for good measure

wbagdon avatar Jan 09 '25 02:01 wbagdon

Thanks @wbagdon,

it was the same for me. After deleting the last line in the license file login is working again. So the question is why the file gets corrupted.

MichaelSch avatar Jan 09 '25 05:01 MichaelSch

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!

daniellbw avatar Jan 10 '25 06:01 daniellbw

I also had this issue on bitwarden/self-host:beta

In my case the license file in /etc/bitwarden/licenses/user/ had gotten corrupted The second to last line of the file for my user was making the json invalid and needed to be deleted I was able to login after doing this, and I re-uploaded my license file for good measure

Did this. Deleted the second to the last line in the .Json file and then went back to the beta tag in docker compose and it's now working great. I'm on 2025.1.0. I did not however need to re-upload my license file.

7djs7 avatar Jan 10 '25 21:01 7djs7

Had this issue in the stable self hosted docker. The premium license was altered. Maybe related to the KDF update a while ago.

JanMarvin avatar Jan 26 '25 14:01 JanMarvin

@MichaelSch have you experienced this issue again after fixing the license file?

trmartin4 avatar Apr 30 '25 13:04 trmartin4

No, it‘s working. :)

MichaelSch avatar Apr 30 '25 13:04 MichaelSch

Thank you! We will be closing this issue, but if you encounter any other problems please let us know.

trmartin4 avatar May 02 '25 01:05 trmartin4