Cannot open database "vault", after upgrade. verion 1.24.0

Hi,
I performed updateself, and update. all seems normal till it failed after “migrating database”. I’m running it on docker linux.
I tried the following hoping to fix it… but not luck so far.

  • ./bitwarden.sh restart… no changes.
  • deleted mssql volume and restart. new mssql database populated as blank database.
  • restore bak vault table… without error.
  • run bitwarden.sh upgradedb… failed again with following error.

Migrating database.
Upgrade failed due to an unexpected exception:
System.Data.SqlClient.SqlException (0x80131904): Cannot open database “vault” requested by the login. The login failed.
Login failed for user ‘sa’.
at System.Data.SqlClient.SqlInternalConnectionTds…ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, Boolean applyTransientFaultHandling)
at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)
at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions)
at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection)
at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection) at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource1 retry, DbConnectionOptions userOptions) at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource1 retry)
at System.Data.SqlClient.SqlConnection.Open()
at DbUp.Engine.Transactions.DatabaseConnectionManager.OperationStarting(IUpgradeLog upgradeLog, List`1 executedScripts)
at DbUp.Engine.UpgradeEngine.PerformUpgrade()
ClientConnectionId:5c822e33-7ba9-44a6-8ed9-0140302c9c6d
Error Number:4060,State:1,Class:11
Migration failed.
Database update complete

please help… :frowning:

restore using the SA password in the mssql.override.env works… why is it elling me it can’t login using sa?

try to connect to the database directly using SQL Studio.

Sorry guys… false alarm. :blush:

I ran the restore command with “NORECOVERY” parameter…
read through the doco… and ran RESTORE DATABASE vault resolve the issue.