Unable to login after updating: [Error] Value cannot be null. (Parameter 'uriString')

Hi, I’ve updated this morning my instance of Bitwarden and since then I’m unable to log in the application, I only see this error in the Api log:

2023-04-01 16:13:16.051 +00:00 [Error] Value cannot be null. (Parameter 'uriString')
System.ArgumentNullException: Value cannot be null. (Parameter 'uriString')
   at System.Uri..ctor(String uriString)
   at Bit.Core.Services.BaseIdentityClientService..ctor(String baseClientServerUri, String baseIdentityServerUri, String identityScope, String identityClientId, String identityClientSecret, ILogger`1 logger) in /home/runner/work/server/server/src/Core/Services/Implementations/BaseIdentityClientService.cs:line 44
   at Bit.Core.Services.RelayPushNotificationService..ctor(IDeviceRepository deviceRepository, GlobalSettings globalSettings, IHttpContextAccessor httpContextAccessor, ILogger`1 logger) in /home/runner/work/server/server/src/Core/Services/Implementations/RelayPushNotificationService.cs:line 34
   at Bit.Core.Services.MultiServicePushNotificationService..ctor(IDeviceRepository deviceRepository, IInstallationDeviceRepository installationDeviceRepository, GlobalSettings globalSettings, IHttpContextAccessor httpContextAccessor, ILogger`1 logger, ILogger`1 relayLogger, ILogger`1 hubLogger) in /home/runner/work/server/server/src/Core/Services/Implementations/MultiServicePushNotificationService.cs:line 33
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
   at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitCache(ServiceCallSite callSite, RuntimeResolverContext context, ServiceProviderEngineScope serviceProviderEngine, RuntimeResolverLock lockType)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitRootCache(ServiceCallSite singletonCallSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitCache(ServiceCallSite callSite, RuntimeResolverContext context, ServiceProviderEngineScope serviceProviderEngine, RuntimeResolverLock lockType)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScopeCache(ServiceCallSite singletonCallSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.DynamicServiceProviderEngine.<>c__DisplayClass1_0.<RealizeService>b__0(ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngine.GetService(Type serviceType, ServiceProviderEngineScope serviceProviderEngineScope)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope.GetService(Type serviceType)
   at Microsoft.Extensions.DependencyInjection.ActivatorUtilities.GetService(IServiceProvider sp, Type type, Type requiredBy, Boolean isDefaultParameterRequired)
   at lambda_method(Closure , IServiceProvider , Object[] )
   at Microsoft.AspNetCore.Mvc.Controllers.ControllerActivatorProvider.<>c__DisplayClass4_0.<CreateActivator>b__0(ControllerContext controllerContext)
   at Microsoft.AspNetCore.Mvc.Controllers.ControllerFactoryProvider.<>c__DisplayClass5_0.<CreateControllerFactory>g__CreateController|0(ControllerContext controllerContext)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextExceptionFilterAsync>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)

I reviewed my global.override.env file and everything seems correct, I checked with that page Configure Environment Variables | Bitwarden Help Center that I have all the required configuration informed and don’t know where else to look at :frowning:

Sounds like you’re likely running the BW Unified edition which is in beta. I suggest providing them with an official report since they’re likely to be interested in it.

Some of the known issues:

I don’t know what’s this BW Unified is, I installed BW two years ago using this guide Install and Deploy - Linux | Bitwarden Help Center and only updated it using the script.

Thanks for your kind answer :slight_smile:

Gotcha. My bad. Your installation sounds like Standard.

In that case, any idea what version you were running previously (or at the very least how it had been since being last updated)?

Also there are a couple different ways to update. Can you confirm which of these you followed to update things:

  1. Update your Instance | Bitwarden Help Center

  2. Install and Deploy Manually | Bitwarden Help Center

Sorry, I have no idea which version I had before update :frowning:

I used the first method, running the updateself and update commands

Hi again, looking at logs I noticed that the error was related with the push notifications, as I´m not really using it I disabled it from the config.yml and run the rebuild, now the error is in the /identity/token endpoint and the log is this:

2023-04-02 00:35:40.244 +00:00 [Fatal] Unhandled exception: "Procedure or function 'Event_Create' expects parameter '@InstallationId', which was not supplied."
System.Data.SqlClient.SqlException (0x80131904): Procedure or function 'Event_Create' expects parameter '@InstallationId', which was not supplied.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
   at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
   at System.Data.SqlClient.SqlCommand.CompleteAsyncExecuteReader()
   at System.Data.SqlClient.SqlCommand.EndExecuteNonQueryInternal(IAsyncResult asyncResult)
   at System.Data.SqlClient.SqlCommand.EndExecuteNonQuery(IAsyncResult asyncResult)
   at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)
--- End of stack trace from previous location where exception was thrown ---
   at Dapper.SqlMapper.ExecuteImplAsync(IDbConnection cnn, CommandDefinition command, Object param) in /_/Dapper/SqlMapper.Async.cs:line 678
   at Bit.Core.Repositories.SqlServer.Repository`2.CreateAsync(T obj) in /home/runner/work/server/server/src/Core/Repositories/SqlServer/Repository.cs:line 51
   at Bit.Core.Repositories.SqlServer.EventRepository.CreateAsync(IEvent e) in /home/runner/work/server/server/src/Core/Repositories/SqlServer/EventRepository.cs:line 73
   at Bit.Core.Services.RepositoryEventWriteService.CreateAsync(IEvent e) in /home/runner/work/server/server/src/Core/Services/Implementations/RepositoryEventWriteService.cs:line 20
   at Bit.Core.Services.EventService.LogUserEventAsync(Guid userId, EventType type, Nullable`1 date) in /home/runner/work/server/server/src/Core/Services/Implementations/EventService.cs:line 66
   at Bit.Core.IdentityServer.BaseRequestValidator`1.BuildSuccessResultAsync(User user, T context, Device device, Boolean sendRememberToken) in /home/runner/work/server/server/src/Core/IdentityServer/BaseRequestValidator.cs:line 146
   at Bit.Core.IdentityServer.BaseRequestValidator`1.ValidateAsync(T context, ValidatedTokenRequest request) in /home/runner/work/server/server/src/Core/IdentityServer/BaseRequestValidator.cs:line 129
   at Bit.Core.IdentityServer.ResourceOwnerPasswordValidator.ValidateAsync(ResourceOwnerPasswordValidationContext context) in /home/runner/work/server/server/src/Core/IdentityServer/ResourceOwnerPasswordValidator.cs:line 46
   at IdentityServer4.Validation.TokenRequestValidator.ValidateResourceOwnerCredentialRequestAsync(NameValueCollection parameters)
   at IdentityServer4.Validation.TokenRequestValidator.RunValidationAsync(Func`2 validationFunc, NameValueCollection parameters)
   at IdentityServer4.Validation.TokenRequestValidator.ValidateRequestAsync(NameValueCollection parameters, ClientSecretValidationResult clientValidationResult)
   at IdentityServer4.Endpoints.TokenEndpoint.ProcessTokenRequestAsync(HttpContext context)
   at IdentityServer4.Endpoints.TokenEndpoint.ProcessAsync(HttpContext context)
   at IdentityServer4.Hosting.IdentityServerMiddleware.Invoke(HttpContext context, IEndpointRouter router, IUserSession session, IEventService events, IBackChannelLogoutService backChannelLogoutService)
ClientConnectionId:15f9d874-42d7-428a-b4d1-4cd17444ac0e
Error Number:201,State:4,Class:16
2023-04-02 00:35:40.254 +00:00 [Error] Connection id ""0HMPJ27FPHPFK"", Request id ""0HMPJ27FPHPFK:00000001"": An unhandled exception was thrown by the application.
System.Data.SqlClient.SqlException (0x80131904): Procedure or function 'Event_Create' expects parameter '@InstallationId', which was not supplied.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
   at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
   at System.Data.SqlClient.SqlCommand.CompleteAsyncExecuteReader()
   at System.Data.SqlClient.SqlCommand.EndExecuteNonQueryInternal(IAsyncResult asyncResult)
   at System.Data.SqlClient.SqlCommand.EndExecuteNonQuery(IAsyncResult asyncResult)
   at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)
--- End of stack trace from previous location where exception was thrown ---
   at Dapper.SqlMapper.ExecuteImplAsync(IDbConnection cnn, CommandDefinition command, Object param) in /_/Dapper/SqlMapper.Async.cs:line 678
   at Bit.Core.Repositories.SqlServer.Repository`2.CreateAsync(T obj) in /home/runner/work/server/server/src/Core/Repositories/SqlServer/Repository.cs:line 51
   at Bit.Core.Repositories.SqlServer.EventRepository.CreateAsync(IEvent e) in /home/runner/work/server/server/src/Core/Repositories/SqlServer/EventRepository.cs:line 73
   at Bit.Core.Services.RepositoryEventWriteService.CreateAsync(IEvent e) in /home/runner/work/server/server/src/Core/Services/Implementations/RepositoryEventWriteService.cs:line 20
   at Bit.Core.Services.EventService.LogUserEventAsync(Guid userId, EventType type, Nullable`1 date) in /home/runner/work/server/server/src/Core/Services/Implementations/EventService.cs:line 66
   at Bit.Core.IdentityServer.BaseRequestValidator`1.BuildSuccessResultAsync(User user, T context, Device device, Boolean sendRememberToken) in /home/runner/work/server/server/src/Core/IdentityServer/BaseRequestValidator.cs:line 146
   at Bit.Core.IdentityServer.BaseRequestValidator`1.ValidateAsync(T context, ValidatedTokenRequest request) in /home/runner/work/server/server/src/Core/IdentityServer/BaseRequestValidator.cs:line 129
   at Bit.Core.IdentityServer.ResourceOwnerPasswordValidator.ValidateAsync(ResourceOwnerPasswordValidationContext context) in /home/runner/work/server/server/src/Core/IdentityServer/ResourceOwnerPasswordValidator.cs:line 46
   at IdentityServer4.Validation.TokenRequestValidator.ValidateResourceOwnerCredentialRequestAsync(NameValueCollection parameters)
   at IdentityServer4.Validation.TokenRequestValidator.RunValidationAsync(Func`2 validationFunc, NameValueCollection parameters)
   at IdentityServer4.Validation.TokenRequestValidator.ValidateRequestAsync(NameValueCollection parameters, ClientSecretValidationResult clientValidationResult)
   at IdentityServer4.Endpoints.TokenEndpoint.ProcessTokenRequestAsync(HttpContext context)
   at IdentityServer4.Endpoints.TokenEndpoint.ProcessAsync(HttpContext context)
   at IdentityServer4.Hosting.IdentityServerMiddleware.Invoke(HttpContext context, IEndpointRouter router, IUserSession session, IEventService events, IBackChannelLogoutService backChannelLogoutService)
   at IdentityServer4.Hosting.IdentityServerMiddleware.Invoke(HttpContext context, IEndpointRouter router, IUserSession session, IEventService events, IBackChannelLogoutService backChannelLogoutService)
   at IdentityServer4.Hosting.MutualTlsEndpointMiddleware.Invoke(HttpContext context, IAuthenticationSchemeProvider schemes)
   at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
   at IdentityServer4.Hosting.BaseUrlMiddleware.Invoke(HttpContext context)
   at Bit.Core.Utilities.CurrentContextMiddleware.Invoke(HttpContext httpContext, CurrentContext currentContext, GlobalSettings globalSettings) in /home/runner/work/server/server/src/Core/Utilities/CurrentContextMiddleware.cs:line 18
   at Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware.Invoke(HttpContext context)
   at Bit.Core.Utilities.ServiceCollectionExtensions.<>c__DisplayClass10_0.<<UseDefaultMiddleware>b__1>d.MoveNext() in /home/runner/work/server/server/src/Core/Utilities/ServiceCollectionExtensions.cs:line 453
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.AspNetCore.Builder.Extensions.UsePathBaseMiddleware.Invoke(HttpContext context)
   at Bit.Identity.Startup.<>c__DisplayClass10_1.<<Configure>b__2>d.MoveNext() in /home/runner/work/server/server/src/Identity/Startup.cs:line 157
--- End of stack trace from previous location where exception was thrown ---
   at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication`1 application)
ClientConnectionId:15f9d874-42d7-428a-b4d1-4cd17444ac0e
Error Number:201,State:4,Class:16

By the way, on the global.override.env file I have the variable globalSettings__installation__id filled with a value

Hi @ddelamo, welcome to community! :wave:

If for this kind of issue, I’d recommend you reach out to our Support Team directly for further assistance. They may be able to provide better recommendations for next steps.

Hi sj-bitwarden, unfortunately I don’t have a premium account, so I suppose I cannot open a ticket to the Support Team, if nothing else I can do I will try to extract my passwords from Bitwarden database and find another way to continue :frowning:

Support is still available to users of the Free plan, but Premium customers get priority support, so you may have to wait a little longer.

Hey, thank you very much for the clarification, I sent them a ticket hope they can help me :slight_smile:

I have exactly the same error here.

What was your final solution, how did you make your installation work again?

Finally I found out the reason for this:
in config.yml I had the line
generate_compose_config: false
which should stop bitwarden to modify docker/docker-compose.yml after each update (and start a useless and resource consuming mssql container). I didn’t know about docker-compose.override.yml
at that time.

But that parameter also stopped updates working correctly.

After I changed
generate_compose_config: true
and did an update of Bitwarden, the problem is solved and Bitwarden is working again.