mirror of
https://github.com/pocket-id/pocket-id.git
synced 2026-02-05 00:39:38 +03:00
🐛 Bug Report: Failing v2 migration when a user has no email #582
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 @Petersmit27 on GitHub (Jan 3, 2026).
Reproduction steps
I upgraded to v2, and have some users in my database without an email.
Expected behavior
The migrations should run as normal
Actual Behavior
The
sqlite/20251217141000_v2_export_normalization.up.sqlmigration failed, leaving a dirty db. Seems like the migration adds theNOT NULLconstraint to theusers_newtable which causes the error.Pocket ID Version
v2.0.1
Database
sqlite
OS and Environment
Docker containers in docker compose on Ubuntu.
Log Output
@rsaffi commented on GitHub (Jan 3, 2026):
I was already on v2 but when bumping pocket-id from
v2.0.0tov2.0.1I get the same:Trying to downgrade back to
v2.0.0gives a warning:And even with adding the
ALLOW_DOWNGRADE=trueto the env variables, it still doesn't fix the issue:@rsaffi commented on GitHub (Jan 3, 2026):
Had to brush up my sqlite3 skills, but managed to get the app running again (v2.0.1) by:0. Make a backup copy of thepocket-id.dbfile1.sqlite3 pocket-id.db2.UPDATE schema_migrations SET dirty=0;After this, the applications starts. I don't know if I'm risking any issues or inconsistent states of the database, but at least it got me back on track (for now).EDIT: yeah, celebrated too early. The application is indeed running, but the failed migration left the db with issues. Upon trying to login to Pocket ID, I get this:
I have for now restored an earlier backup from my archive, while
v2.0.0was still running with its own database version (pre migration).@stonith404 commented on GitHub (Jan 3, 2026):
Thanks for reporting this.
v2.0.2should fix this issue. Unfortunately you have to make a small adjustment in the database manually:If you upgrade from
v2.0.0run the following command on the database:If you upgrade from
v1.x.xrun the following command on the database: