mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2026-02-05 00:29:40 +03:00
postgres database / cannot save entries with error msg re: favorite #859
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @joergmschulz on GitHub (Nov 11, 2020).
Subject of the issue
Trying to save entries, an error occurs. The logfile says:
[CAUSE] DatabaseError( bitwarden_rs | __Unknown, bitwarden_rs | "null value in column \"favorite\" violates not-null constraint",Your environment
Version 1.17.0-e25fc708
docker image bitwardenrs/server-postgresql:testing and bitwardenrs/server-postgresql
Steps to reproduce
enter data in existing records
save the data
Expected behaviour
data should be saved
Actual behaviourop cit error message (column "favorite" violates not-null constraint",)
Relevant logs
@BlackDex commented on GitHub (Nov 18, 2020):
Hello @joergmschulz, could you please provide some more information?
Looking at the error it seems to be something regarding toggling an item as favorite on/off.
But you state it happens during editing an item.
I have tried the following scenarios.
All of these are working without producing any error at all.
It could be that your database is broken for some reason.
If that is the case i would suggest to check the
favoritestable and look fornullvalues and remove them.It doesn't pose any harm, except for maybe losing a favorite flag on an item.
@joergmschulz commented on GitHub (Nov 19, 2020):
Do you use postgres?
I've removed the not-null constraint for the favorite column as a workaround. Later the week, I'll rebuild a test instance and retest.
@BlackDex commented on GitHub (Nov 19, 2020):
Yes i did use postgresql for these tests.
Would be nice to know what could have happened.
@jjlin commented on GitHub (Nov 19, 2020):
There should no longer even be a
favoritecolumn in 1.17.0, so something probably went wrong in the migrations:5379329ef7/migrations/postgresql/2020-08-02-025025_add_favorites_table/up.sql (L15-L16)@joergmschulz commented on GitHub (Nov 19, 2020):
hmmm, this might have happened during the switch from a devel package to the next release. If and when nobody else can reproduce this issue, this seems to be a local thing here not worth following up.
@joergmschulz commented on GitHub (Nov 19, 2020):
did now
ALTER TABLE ciphers
DROP COLUMN favorite;
seems to work fine.
Assuming it really is a local issue due to intermediary using a devel version, I close this one. On next upgrade, I seem to have to watch log messages more carefully.
Thank you for the support!