Unable to login after restore DB on another docker host #348

Closed
opened 2026-02-04 19:49:13 +03:00 by OVERLORD · 2 comments
Owner

Originally created by @evolsano on GitHub (Jul 19, 2019).

Hi,

I am trying to restore the bitwarden by replace existing db.sqlite3 with the backup.sqlite3 I have. But somehow it do not work and I cannot login to bitwarden after rename it.

Here are the scenarios,

  1. Create a new bitwarden container in host 2. Bitwarden is running behind traefik docker for reverse proxy.
  2. Copy backup.sqlite3 from host 1 to host 2 and renamed it to db.sqlite3.
  3. Host 1 domain is bitwarden.domain1.local, and host 2 is bitwarden.domain2.local. (These are example domains).
  4. Both docker host running on Ubuntu 18.04, docker-compose 1.23.1, and same docker-compose environment variables.
  5. Access to web vault, and login, but it prompt me incorrect username or password.
[2019-07-19 14:47:19][_][INFO] Matched: POST /identity/connect/token (login)
[2019-07-19 14:47:19][bitwarden_rs::error][ERROR] Username or password is incorrect. Try again. IP: x.x.x.y. Username: xxx@example.com.
[2019-07-19 14:47:19][_][INFO] Outcome: Success
[2019-07-19 14:47:19][_][INFO] Response succeeded.

Failed to add new user.

[2019-07-19 14:47:19][_][INFO] Response succeeded.
[2019-07-19 14:53:30][rocket::rocket][INFO] POST /api/accounts/register application/json; charset=utf-8:
[2019-07-19 14:53:30][_][INFO] Matched: POST /api/accounts/register (register)
[2019-07-19 14:53:30][bitwarden_rs::error][ERROR] Error saving user.
[CAUSE] DatabaseError(
    __Unknown,
    "table users has no column named key",

If I restore create a new container in host 1, and restore the DB, everything works well. The backup.sqlite3 copied to host 2 should not corrupt and it has the same md5 hash to the source.

Can someone enlighten me how can I restore it on another docker host?

Originally created by @evolsano on GitHub (Jul 19, 2019). Hi, I am trying to restore the bitwarden by replace existing db.sqlite3 with the backup.sqlite3 I have. But somehow it do not work and I cannot login to bitwarden after rename it. Here are the scenarios, 1. Create a new bitwarden container in host 2. Bitwarden is running behind traefik docker for reverse proxy. 2. Copy backup.sqlite3 from host 1 to host 2 and renamed it to db.sqlite3. 3. Host 1 domain is bitwarden.domain1.local, and host 2 is bitwarden.domain2.local. (These are example domains). 4. Both docker host running on Ubuntu 18.04, docker-compose 1.23.1, and same docker-compose environment variables. 5. Access to web vault, and login, but it prompt me incorrect username or password. ``` [2019-07-19 14:47:19][_][INFO] Matched: POST /identity/connect/token (login) [2019-07-19 14:47:19][bitwarden_rs::error][ERROR] Username or password is incorrect. Try again. IP: x.x.x.y. Username: xxx@example.com. [2019-07-19 14:47:19][_][INFO] Outcome: Success [2019-07-19 14:47:19][_][INFO] Response succeeded. ``` Failed to add new user. ``` [2019-07-19 14:47:19][_][INFO] Response succeeded. [2019-07-19 14:53:30][rocket::rocket][INFO] POST /api/accounts/register application/json; charset=utf-8: [2019-07-19 14:53:30][_][INFO] Matched: POST /api/accounts/register (register) [2019-07-19 14:53:30][bitwarden_rs::error][ERROR] Error saving user. [CAUSE] DatabaseError( __Unknown, "table users has no column named key", ``` If I restore create a new container in host 1, and restore the DB, everything works well. The backup.sqlite3 copied to host 2 should not corrupt and it has the same md5 hash to the source. Can someone enlighten me how can I restore it on another docker host?
Author
Owner

@evolsano commented on GitHub (Jul 19, 2019):

Issue resolved after update to latest docker image.
Please ignore my stupidity and I wasted half day to troubleshoot it.

@evolsano commented on GitHub (Jul 19, 2019): Issue resolved after update to latest docker image. Please ignore my stupidity and I wasted half day to troubleshoot it.
Author
Owner

@mprasil commented on GitHub (Jul 19, 2019):

Well you figured it out and now you know better, so no stupidity as far as I can see. You used older image with newer DB, if it was the other way around, it would work because bitwarden_rs would automatically upgrade the DB. I wonder if we could detect your case and refuse to start with clear message indicating the DB is ahead of program version.

@mprasil commented on GitHub (Jul 19, 2019): Well you figured it out and now you know better, so no stupidity as far as I can see. You used older image with newer DB, if it was the other way around, it would work because bitwarden_rs would automatically upgrade the DB. I wonder if we could detect your case and refuse to start with clear message indicating the DB is ahead of program version.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/vaultwarden#348