Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrating database. Database is in script upgrade mode. #60

Open
winkler-winsen opened this issue Oct 16, 2022 · 3 comments
Open

Migrating database. Database is in script upgrade mode. #60

winkler-winsen opened this issue Oct 16, 2022 · 3 comments

Comments

@winkler-winsen
Copy link

Hello,

my Linux Docker installation stalled after update via

./bitwarden.sh updateself
./bitwarden.sh update

The error is

Database is in script upgrade mode. Trying again (attempt #10)...
Migrating database.
Unhandled exception. System.Data.SqlClient.SqlException (0x80131904): Login failed for user 'sa'. Reason: Server is in script upgrade mode. Only administrator can connect at this time.

After waiting several minutes and running the two update script commands again, the update finalizes successfully.

Maybee there should more attempts to wait for successfull database upgrade.

This is the end of my logged run of the two update commands above

Creating network "docker_default" with the default driver
Creating network "docker_public" with the default driver
Creating bitwarden-notifications ...
Creating bitwarden-identity ...
Creating bitwarden-mssql ...
Creating bitwarden-web ...
Creating bitwarden-events ...
Creating bitwarden-attachments ...
Creating bitwarden-api ...
Creating bitwarden-sso ...
Creating bitwarden-icons ...
Creating bitwarden-web ... done
Creating bitwarden-mssql ... done
Creating bitwarden-admin ...
Creating bitwarden-notifications ... done
Creating bitwarden-attachments ... done
Creating bitwarden-identity ... done
Creating bitwarden-icons ... done
Creating bitwarden-api ... done
Creating bitwarden-sso ... done
Creating bitwarden-events ... done
Creating bitwarden-admin ... done
Creating bitwarden-nginx ...
Creating bitwarden-nginx ... done
2022.10.0: Pulling from bitwarden/setup
Digest: sha256:b20826e60e6084ed5a727eea998433ae37ff7baa3b7dea05e6432fb6c65eb182
Status: Image is up to date for bitwarden/setup:2022.10.0
docker.io/bitwarden/setup:2022.10.0


Bitwarden is up and running!
===================================================

visit https://xxx/
to update, run `./bitwarden.sh updateself` and then `./bitwarden.sh update`

Deleted Images:
untagged: bitwarden/api:2022.9.1
untagged: bitwarden/api@sha256:cfb8a16e6a0fa25377fd032c292a76c758c2051357b263358de1cf513a72e828
deleted: sha256:925de309736ed558eaf4af1976ecfd1e019dc4cea20484dd5194c0c60c5a23ca
deleted: sha256:928abc6578c8f859d74657ec19b26fb830d3627e53e1f6df29f56b654dd7a4e4
deleted: sha256:e31f7d6155e115973ebf44f84d4a29cac28054d00f7efa453cd225ade01b1c5b
deleted: sha256:031aacd1791427ce1a940813a68252aab29e0341d73ef94d5728c04ab2d028da
deleted: sha256:9a8dc7587739226badf483f1e1bc9d20f4bf9f8e0ac7ac1d704970989ef7a52f
deleted: sha256:0867ecd4946de0962d7b426c17020a1518a66bdf9957aac54635b71cbc97b395
deleted:
deleted:
deleted:
deleted:
untagged: bitwarden/mssql:2022.9.1
untagged: bitwarden/mssql@sha256:d38d299eb9155993965c1c4947e9b8a90d4a95917644e2157a4e9bb312941ef6
deleted: sha256:773e91dfa3ab5c4a28894b0f3007ea378919c536fa19870531b77ed27a54248c
deleted: sha256:acfdbb8ae0b55f00d2baae31326cad54b4b80a000e5e2ef22277b5afebcf108f
deleted: sha256:737e83203504229a0ff0afbf382d438daee5eb1514021f7024efd4de3669e8a3
deleted: sha256:2b6c8367b125d38bc8de9a56b4a85b4223b5ec6f39a1b9472f1cc69f625522c3
deleted: sha256:8cad2e4d24541d45364fe59a8160593b30eceadbaecb2f07511058874bfda51c
deleted: sha256:72e2c563dbd0a63a13eaebe6f3f4426ed8d847b02889cdfb976fd4bd6d1af162
deleted: sha256:025522b71cfe4f0c83f82b6870065d9c7b6574c7539b307585d9f0d4fa87bca6
deleted: sha256:8c29a31bd900d07ae2e6f16163e8667291ff83bb4d344facc14c2ed2f6a4e8a2
deleted: sha256:bfd45a4b249a45a22429adcd8c58845747e5c971d1683127ed68e1d4e0b09959
deleted: sha256:6a0e6bf8055ade83f0e1a811778801da594b6b2d0f0559513cfa3ab09cc44687
deleted: sha256:91e4318a5f8d6a9aead4e9e0dbf6eaf425f84b761bcf4d8f8380c918340bebfc
deleted: sha256:ef572e1ba2ecca900f0ec3db00e997de12dd380ce3e360b5813fd75920232359
deleted: sha256:98fc4d5421178c7be7d5718d2d44abba8053dc5c712e51658fe5b872675b4f7a
deleted: sha256:7b2cc05dfd889e28234f8831c80ac20cf299d5bbebbbac013f8f7d2b7abc0d65
deleted: sha256:6b0187d1cdff63eb5966ac72bf4ccd96150586c1409eb858bb98783f02018ee7
deleted: sha256:644879075e24394efef8a7dddefbc133aad42002df6223cacf98bd1e3d5ddde2
deleted:
deleted:
untagged: bitwarden/web:2022.9.1
untagged: bitwarden/web@sha256:a183fe841a3269a5a49f0787f4341126d4f25041adf185b368af2bb7bbcf1fae
deleted: sha256:3b112ddf352c1d4a95bbbb8192e11e257722d18b7a0f2ac43253578be8f1f963
deleted: sha256:f3e013b2b6773bfcbb4280022b6dedaf3d4b5473f8ec4813e4c0ff38f762906b
deleted: sha256:b05337c3dba36affe50117decdc83f53c1f755639b687e2d07461352cd99c4a7
deleted: sha256:933405b6737dd184f75bf434621d696fde28ab26c92987d144f9800e405d0459
deleted: sha256:a44df38e4b63f57e7d0293e12934c9c89f0e49aef86899342f1807de886f6466
deleted: sha256:c0a4025569d41dae98e302b85bc81a91bcddfdbf4b314ce28598fa272958220b
deleted: sha256:45dde847e0eefe2957f1190383623762fd7d00d0ef6c3308cd8047de524aa2df
deleted: sha256:1aec719198fd7343aa3d572cf2ab609cdf86a3afcc56e058ac536d2f4ac06b94
deleted: sha256:b264cff4e083c2b28fa7dd83b9c405755af14ac8e7ca9bb00e57a64792931fe0
deleted: sha256:77fca1f8661c068c1e3eab1e688e924fbfdeb2bee13db116e33ceeecd412929f
deleted: sha256:dc46ee02ad38a8aa20fe9258d772c6c3a2518c3ac655834cd8b5aba0460f5956
untagged: bitwarden/events:2022.9.1
untagged: bitwarden/events@sha256:3ac03e470430c292878000e939ecb67a4c886a5e1c7b454da65f6c5ad873dfd5
deleted: sha256:951bebd465f1fd537918fb069600145cfbd724f3a91463944581b881d17f8e40
deleted: sha256:43e2a3998210074fbec17486c15f46ccd21076445bc16a855f724e41ef22a0f6
deleted: sha256:089517a4f4961c0f901282f2ad544f4dac1665b2a52ece62f06b0a88beea38ff
deleted: sha256:1514d1bcc396695796cd22d76c9aa3b24e1c565680273a77cafb379d1b27a99f
deleted: sha256:3e9f57b7c249a4e3d2c590be3ad6f6db4434c341a3cd83756739cee927db2e82
deleted: sha256:e455200fe80739839e2ee0792d1e0686bebe05103e9e612d188eb7d75e82d87f
untagged: bitwarden/admin:2022.9.1
untagged: bitwarden/admin@sha256:c38e47c46dc675debb46fc2598006fd5380fe86c8817fc57f00e50fac4504762
deleted: sha256:a535f05fbb98b78a2e9396b3abaca28952ac3ed377e9400f1963370c567c65be
deleted: sha256:7e6bb22af9788eee0dd7638a80199652b76d07ab453b449bf556452769d09310
deleted: sha256:e2df6b55a1601a3e0bb2f1a894eb257dafefba828691ef8e0ba17568b7cc0f1c
deleted: sha256:00873ca4ecdf58efe7a0b73bb5dc122ad0e9527d763d62229047774480a95f8d
deleted: sha256:c34b2101fc3c93eb8c611b7a89937eafc5661eedd323d4acda1c66200f501f60
deleted: sha256:120d0c80f61a9e2f62baf748d759c89b2ae4092a628bd18abc00d2d378f4ade5
untagged: bitwarden/attachments:2022.9.1
untagged: bitwarden/attachments@sha256:7bc300775614bb3292a2a8fdbf15747ba616bc68fc15463bd1b6c058be05f6e2
deleted: sha256:8cb7c3d1917ed1fab0ea991681edfb4b1b7e3ee805eeb0b5720b2783a87d4e48
deleted: sha256:5514acad792c8346055a9a7ea9815f276e194f4a61f29e8f1064f11e1033eaa3
deleted: sha256:19296bc1ddd58e2d02a5c7133f531ff8972d14c8d7f52964c4f04776c8c19677
deleted: sha256:1b326a4692e99d1198218b6c965e27a215f9b66ae11b08783a1383f9709aa730
deleted: sha256:b39192df4eee844a1b4453c95dc0bca14271921cd24c5cd83b8b92449cd6da0a
untagged: bitwarden/nginx:2022.9.1
untagged: bitwarden/nginx@sha256:24e01d5fb26daf2c0674738c86baa82ef20046a814e4c592061d336260db9a8d
deleted: sha256:2fc32efe65881ea595ac9977c3555c8275ca11d11ef57da5c3fcd9150a8f68fd
deleted: sha256:f6368f15071c455264c019ca1a1356079f53ff2877c51362880bb9f2919b822a
deleted: sha256:a196afcf3d7882a05491529f947a22806c7436a709f3104cf25a31987ad1a2fc
deleted: sha256:1279c6420f845360dc4a67e7eba95370e19e6f4d15a99c286e346f05ee0f4fe4
deleted: sha256:2b04477b51e8e97dabc68a1a5396a4eb479b50c872684a645581b6815cca3b77
deleted: sha256:6455851996279fe7f4d0dbe4269da84c33a76efa104e3bccf96cf6bdef432245
deleted: sha256:0245d94e4637f6be6a275c4af7ecb716089865e9e86f7e1e391efb9e6b27b805
deleted: sha256:decb740c10b8d0b9a3e921e9d91a9a87b3dcafca5f783deee7a778395590a38c
deleted: sha256:c927dcf2cd3697f86d6c4c729e689f175ea10ab967e77eab8f35447e7748e599
deleted: sha256:37a4f8d71046d3d484f730140e355ab2ca224e2a36889e615ed8865bb423d7e0
deleted: sha256:59716a71cea879143c86425b10986e2f28b1f4e6f6ecfff7a6bdc469a5e29486
deleted: sha256:34bdfbf02b3bbb46879c29769150eeb7cf5151b0addb86e5ac626bd8813ef99b
deleted: sha256:0333123f731a60ef626adca3670129136871cb3d0a70c0154196028d6b2405e3
deleted: sha256:4e41d535a6361e4c9760d5f2b37782a6a7e460d5dd187c4e3d1685efb4b24ce3
deleted: sha256:73757063f2c178000cbff9abd5a10f71932fb24f51fff4b87dba216f7ce8ad52
untagged: bitwarden/identity:2022.9.1
untagged: bitwarden/identity@sha256:80d3cd02baa811e45e8e85d7bf366e6bb37da7b618d6622f32378b6445fd215c
deleted: sha256:5d28235aa023ea328708236b07b13a5d59ceaed7f2165cb25b2cb0faf0523a07
deleted: sha256:b1e464eeb412ca8157c7effbbd955aab82600a64d42d1f322f25b8c8500adb6a
deleted: sha256:af56dc562a3a34ad13547d9bec71e36be0cc7e4cf06cecb5ad431f354c319233
deleted: sha256:4fab89a21f1af917902c7a3ad2507ce9637a72cb64b6d2abdb844be68c3da595
deleted: sha256:fb1470229bd547bfd0d291eea809314f742fe42bf06d6fe70d8525c3f169e67c
deleted: sha256:b695fd4960680f45b90384637169d5bfe3e77dffdd4240e2c336928e4bcbb8cf
deleted:
deleted:
untagged: bitwarden/notifications:2022.9.1
untagged: bitwarden/notifications@sha256:f728d114412e17ed77d256fd58a5b938000669a137fcb3b93d9671c8b8a90b02
deleted: sha256:d9e8152e31716876b2b6217ce5f57e5154eca121d8d411da44d9cbd7e434364b
deleted: sha256:22d935cd2703b4fa92070413f6f921efb203fe5a8243d254b89ea2f46a818ff4
deleted: sha256:2ae044d9af3a275b87d1502090ad5e028a000fa2f2c99fd3d0b67d677a05a5ea
deleted: sha256:6774ec82e3d4e209ac0e68acce78a344225257b3c1b4a2ad1b0f831f8b82f675
deleted: sha256:6eef464cc09381826a90532179891721591bf5c283e2c47344395e104b444ea4
deleted: sha256:d757db22a8a1c3047516b232de64dbf0d47e2c852be90633b9fa09cc3eeee5d9
deleted:
deleted:
deleted:
deleted:
deleted:
deleted:
untagged: bitwarden/icons:2022.9.1
untagged: bitwarden/icons@sha256:f03005b186658322359432d57d1349c0db5668f4e16fe4b8375088e48ecb14c3
deleted: sha256:340ef1d632f7962b519d8a7c0cf1556f8c5d3816f8a70d6e5f54cd4d74d80351
deleted: sha256:b5777e3fbfc305e0954ca182efe39c3cb431fb333fb0dca32dcd601e8906ee92
deleted: sha256:3bd5f4b9018f32f495bc7f90bb81b10b129883bd4664d1d114f22e79faba8969
deleted: sha256:1b6cb0012215cd8940931aefe5d8701ad1a388b708a48e32958595f027a35677
deleted: sha256:f3bc98e133aaae78954dea41675c6e42ed0db6cab9d6cafa67403e8e8a8b5d7b
deleted: sha256:19789059efeea7b2c76e1e76041f4b8efa006fda78940355506f6b5e309062a5
untagged: bitwarden/sso:2022.9.1
untagged: bitwarden/sso@sha256:d1fb1a78282f2aef2eadbc43cd098ecfcad23213789b75cc6d1b1e8651f4388a
deleted: sha256:dfc27543d3dfd9afe6a7b757c56da6f7c6d10c18227fa298325b7009d2fe1c84
deleted: sha256:c1a1fc139938ec0b469accba8c0d3ab34566a421dd7e463da37290d4084f0572
deleted: sha256:379170e1b6af2fc95057218e53bd2f3fa4309d255d9fc6f1b1a6a21f05130c95
deleted: sha256:465bafd7e80cf37549afeac43aa87aaa60ad357f3e146816f36c198c34137695
deleted: sha256:2526515a1045ea8e63a80407e1ae78ab65a8b6daa1e12a05dc76c378eade369b
deleted: sha256:f2a7df6cb062da6533659af582aa639cf8af805c5c895f7aff907113eaadf189
deleted:
deleted:
deleted:
deleted:
deleted:
deleted:
deleted:
deleted:

Total reclaimed space: 2.249GB
Pausing 60 seconds for database to come online. Please wait...
2022.10.0: Pulling from bitwarden/setup
Digest: sha256:b20826e60e6084ed5a727eea998433ae37ff7baa3b7dea05e6432fb6c65eb182
Status: Image is up to date for bitwarden/setup:2022.10.0
docker.io/bitwarden/setup:2022.10.0

Migrating database.
Database is in script upgrade mode. Trying again (attempt #2)...
Migrating database.
Database is in script upgrade mode. Trying again (attempt #3)...
Migrating database.
Database is in script upgrade mode. Trying again (attempt #4)...
Migrating database.
Database is in script upgrade mode. Trying again (attempt #5)...
Migrating database.
Database is in script upgrade mode. Trying again (attempt #6)...
Migrating database.
Database is in script upgrade mode. Trying again (attempt #7)...
Migrating database.
Database is in script upgrade mode. Trying again (attempt #8)...
Migrating database.
Database is in script upgrade mode. Trying again (attempt #9)...
Migrating database.
Database is in script upgrade mode. Trying again (attempt #10)...
Migrating database.
Unhandled exception. System.Data.SqlClient.SqlException (0x80131904): Login failed for user 'sa'. Reason: Server is in script upgrade mode. Only administrator can connect at this time.
  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, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection)
  at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
  at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
  at System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
  at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)
  at System.Data.SqlClient.SqlConnection.Open()
  at Bit.Migrator.DbMigrator.MigrateMsSqlDatabase(Boolean enableLogging, CancellationToken cancellationToken) in /home/runner/work/server/server/util/Migrator/DbMigrator.cs:line 47
  at Bit.Setup.Program.MigrateDatabase(Int32 attempt) in /home/runner/work/server/server/util/Setup/Program.cs:line 196
  at Bit.Setup.Program.MigrateDatabase(Int32 attempt) in /home/runner/work/server/server/util/Setup/Program.cs:line 214
  at Bit.Setup.Program.MigrateDatabase(Int32 attempt) in /home/runner/work/server/server/util/Setup/Program.cs:line 214
  at Bit.Setup.Program.MigrateDatabase(Int32 attempt) in /home/runner/work/server/server/util/Setup/Program.cs:line 214
  at Bit.Setup.Program.MigrateDatabase(Int32 attempt) in /home/runner/work/server/server/util/Setup/Program.cs:line 214
  at Bit.Setup.Program.MigrateDatabase(Int32 attempt) in /home/runner/work/server/server/util/Setup/Program.cs:line 214
  at Bit.Setup.Program.MigrateDatabase(Int32 attempt) in /home/runner/work/server/server/util/Setup/Program.cs:line 214
  at Bit.Setup.Program.MigrateDatabase(Int32 attempt) in /home/runner/work/server/server/util/Setup/Program.cs:line 214
  at Bit.Setup.Program.MigrateDatabase(Int32 attempt) in /home/runner/work/server/server/util/Setup/Program.cs:line 214
  at Bit.Setup.Program.MigrateDatabase(Int32 attempt) in /home/runner/work/server/server/util/Setup/Program.cs:line 214
  at Bit.Setup.Program.Update() in /home/runner/work/server/server/util/Setup/Program.cs:line 158
  at Bit.Setup.Program.Main(String[] args) in /home/runner/work/server/server/util/Setup/Program.cs:line 56
ClientConnectionId:a8a71078-ded4-4c3b-9c88-93ae9f34ce27
Error Number:18401,State:1,Class:14
@winkler-winsen
Copy link
Author

before update:
bitwarden.sh version 2022.9.1
Docker version 20.10.3, build 55f0773
docker-compose version 1.28.5, build 24fb474e

bitwarden/setup:2022.10.0
bitwarden/api:2022.9.1
bitwarden/mssql:2022.9.1
bitwarden/web:2022.9.1
bitwarden/events:2022.9.1
bitwarden/admin:2022.9.1
bitwarden/attachments:2022.9.1
bitwarden/nginx:2022.9.1
bitwarden/identity:2022.9.1
bitwarden/notifications:2022.9.1
bitwarden/icons:2022.9.1
bitwarden/sso:2022.9.1

after update:
bitwarden.sh version 2022.10.0
Docker version 20.10.3, build 55f0773
docker-compose version 1.28.5, build 24fb474e

bitwarden/setup:2022.10.0

@dbosompem
Copy link

Hi @winkler-winsen , are you still facing this challenge? If yes, it would otherwise be better handled by our dedicated Customer Success team, since this issue appears to be a support request,
Please contact us using our Contact page.

@winkler-winsen
Copy link
Author

Hi @dbosompem

No need for support request. After waiting minutes the upgrade completed successfully.

Just want to let you know, that the waiting loop is sometimes to short.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants