[GH-ISSUE #2470] wierd database discrepancy between binary and docker #1272

Closed
opened 2026-03-03 02:07:41 +03:00 by kerem · 1 comment
Owner

Originally created by @Barborica-Alexandru on GitHub (May 15, 2022).
Original GitHub issue: https://github.com/dani-garcia/vaultwarden/issues/2470

Subject of the issue

Hello, I've been using vaultwarden by building the binary for years and have recently decided to switch to the docker container. In both cases I am using the postgresql backend. On my original database in the table devices there is a constraint devices_pkey that includes uuid and user_uuid. On the docker container version this contraint includes just uuid and not user_uuid which leads to a postgresql error when trying to log in because the query to add the device fails. The solution is to delete and recreate the constraint with just uuid as is on the freshly installed docker version.

Im just curios how this happened? And could there be other discrepancies that could lead to issues if I just use my old database with the corrected constraint?

Deployment environment

Binary and docker, migration done on latest versions on both platforms, same database.

Originally created by @Barborica-Alexandru on GitHub (May 15, 2022). Original GitHub issue: https://github.com/dani-garcia/vaultwarden/issues/2470 <!-- # ### NOTE: Please update to the latest version of vaultwarden before reporting an issue! This saves you and us a lot of time and troubleshooting. See: * https://github.com/dani-garcia/vaultwarden/issues/1180 * https://github.com/dani-garcia/vaultwarden/wiki/Updating-the-vaultwarden-image # ### --> <!-- Please fill out the following template to make solving your problem easier and faster for us. This is only a guideline. If you think that parts are unnecessary for your issue, feel free to remove them. Remember to hide/redact personal or confidential information, such as passwords, IP addresses, and DNS names as appropriate. --> ### Subject of the issue <!-- Describe your issue here. --> Hello, I've been using vaultwarden by building the binary for years and have recently decided to switch to the docker container. In both cases I am using the postgresql backend. On my original database in the table devices there is a constraint devices_pkey that includes uuid and user_uuid. On the docker container version this contraint includes just uuid and not user_uuid which leads to a postgresql error when trying to log in because the query to add the device fails. The solution is to delete and recreate the constraint with just uuid as is on the freshly installed docker version. Im just curios how this happened? And could there be other discrepancies that could lead to issues if I just use my old database with the corrected constraint? ### Deployment environment Binary and docker, migration done on latest versions on both platforms, same database.
kerem closed this issue 2026-03-03 02:07:41 +03:00
Author
Owner

@BlackDex commented on GitHub (May 16, 2022):

I wonder what you mean with latest version.
If you mean there is a difference between the database schema regarding the latest tagged docker images and the latest commit, then yea there is a difference, since they do not match.

The latest commit equals the testing tagged images.
The latest tagged image equals the latest stable released version.

If you build from source your self or use the docker build images they should match 1:1 when you use the exact same commit hash (depending a little bit on which OS you build it because of libraries etc..).

<!-- gh-comment-id:1127379769 --> @BlackDex commented on GitHub (May 16, 2022): I wonder what you mean with `latest` version. If you mean there is a difference between the database schema regarding the `latest` **tagged docker** images and the `latest` **commit**, then yea there is a difference, since they do not match. The `latest` **commit** equals the `testing` **tagged images**. The `latest` **tagged** image equals the latest stable released version. If you build from source your self or use the docker build images they should match 1:1 when you use the exact same commit hash (depending a little bit on which OS you build it because of libraries etc..).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/vaultwarden#1272
No description provided.