bitwarden / server

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

Could not find stored procedure 'dbo.Organization_ReadAbilities' #233

Closed shrimpza closed 6 years ago

shrimpza commented 6 years ago

Hi

I have just updated my self-hosted environment from version 1.12 (OK, I missed some in-between...) to 1.17.1, using the recommended update command.

The update seemed to work, new images were pulled, the new stuff is up and running, but login attempts fail with the following:

$ docker logs -f bitwarden-identity

...

info: Microsoft.AspNetCore.Hosting.Internal.WebHost[1]
      Request starting HTTP/1.0 POST http://my.host/connect/token application/x-www-form-urlencoded; charset=utf-8 469
info: IdentityServer4.Hosting.IdentityServerMiddleware[0]
      Invoking IdentityServer endpoint: IdentityServer4.Endpoints.TokenEndpoint for /connect/token
crit: IdentityServer4.Hosting.IdentityServerMiddleware[0]
      Unhandled exception: System.Data.SqlClient.SqlException (0x80131904): Could not find stored procedure 'dbo.Organization_ReadAbilities'.
         at System.Data.SqlClient.SqlCommand.<>c.<ExecuteDbDataReaderAsync>b__108_0(Task`1 result)
         at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke()
         at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
         at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
      --- End of stack trace from previous location where exception was thrown ---
         at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
         at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
         at Dapper.SqlMapper.<QueryAsync>d__31`1.MoveNext() in C:\projects\dapper\Dapper\SqlMapper.Async.cs:line 389

... <continues for quite a while> ...

It appears as though an upgrade script or something has not been executed, I can only imagine. I can't find any log output pointing to a failure to execute any such upgrade scripts.

I guess the contents of https://github.com/bitwarden/core/tree/master/util/Setup/DbScripts are expected to be executed?

Is there a way I can force these to run, or execute them manually against the MSSQL container?

Thanks

kspearrin commented 6 years ago

Try running ./bitwarden.sh updatedb

shrimpza commented 6 years ago

This worked perfectly, thanks!

And thank you for the incredibly swift response :)

edgardok commented 3 years ago

it works!! hey I had to changed the single quotes in the conection string to make it work, who should I tell this?