bitwarden / self-host

Bitwarden's self-hosted release repository
GNU General Public License v3.0
326 stars 58 forks source link

SSO container unhealthy - vault loads but new registrations not possible #81

Closed glen4cindy closed 1 year ago

glen4cindy commented 1 year ago

I've got a brand new instance of Bitwarden up and running.

The host VM is Ubuntu 22.10 if that matters.

All containers are healthy except sso when I issue docker ps command. When I look at the log files I see in the SSO directory there are endless repeating entries of the following:

2023-02-18 01:08:47.224 +00:00 [Information] SSO started. 2023-02-18 01:09:27.829 +00:00 [Error] An unhandled exception has occurred while executing the request. Microsoft.Data.SqlClient.SqlException (0x80131904): Cannot open database "vault" requested by the login. The login failed. Login failed for user 'sa'.

--- End of stack trace from previous location --- at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread) --- End of stack trace from previous location --- at Dapper.SqlMapper.QueryAsync[T](IDbConnection cnn, Type effectiveType, CommandDefinition command) in /_/Dapper/SqlMapper.Async.cs> at Bit.Infrastructure.Dapper.Repositories.SsoConfigRepository.GetManyByRevisionNotBeforeDate(Nullable1 notBefore) in /home/runner/> at Bit.Core.Business.Sso.DynamicAuthenticationSchemeProvider.LoadAllDynamicSchemesIntoCacheAsync() in /home/runner/work/server/serv> at Bit.Core.Business.Sso.DynamicAuthenticationSchemeProvider.GetRequestHandlerSchemesAsync() in /home/runner/work/server/server/bit> at Bit.Sso.Utilities.SsoAuthenticationMiddleware.Invoke(HttpContext context) in /home/runner/work/server/server/bitwarden_license/s> at IdentityServer4.Hosting.BaseUrlMiddleware.Invoke(HttpContext context) at Bit.Core.Utilities.CurrentContextMiddleware.Invoke(HttpContext httpContext, ICurrentContext currentContext, GlobalSettings globa> at Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware.<Invoke>g__Awaited|6_0(ExceptionHandlerMiddleware middleware, HttpCo> ClientConnectionId:ca7d6b27-c42e-49bf-8e70-2755fea41d60 Error Number:2812,State:62,Class:162023-02-20 00:00:05.537 +00:00 [Error] An unhandled exception has occurred while executing the request. Microsoft.Data.SqlClient.SqlException (0x80131904): Could not find stored procedure 'dbo.SsoConfig_ReadManyByNotBeforeRevisionDate'. at Microsoft.Data.SqlClient.SqlCommand.<>c.<ExecuteDbDataReaderAsync>b__208_0(Task1 result) at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke() at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)

This is not an exhaustive copy and paste of the log but it is most of the major blocks.

I haven't made any changes or updates to any of the configuration files other than the necessary ones such as the port numbers in config.yml and the entries in the global environment file.

Thanks in advance.

Greenderella commented 1 year ago

Hi there,

Thank you for your report!

The engineering team appears to have identified the issue, and a PR has been submitted to fix it: https://github.com/bitwarden/server/pull/2730

You can check here: https://github.com/bitwarden/server/releases as soon as the new release gets available to update your server.

Let us know if there is anything else we can do for you in the meantime.

glen4cindy commented 1 year ago

This issue was finally solved by running updates.

Thanks!