[GH-ISSUE #4406] [Bug]: Broken DB migration from 25.1.0 to 25.2.1 #43535

Closed
opened 2026-04-26 04:03:30 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @albanqafa on GitHub (Feb 19, 2025).
Original GitHub issue: https://github.com/actualbudget/actual/issues/4406

Verified issue does not already exist?

  • I have searched and found no existing issue

What happened?

i found this issue while working out a different problem with the maintainer of the Proxmox VE Helper scripts

You can see communication that lead to my finding here:
https://github.com/community-scripts/ProxmoxVE/issues/2490

the problem appears that in upgrading from 25.1.0 to 25.2.1 the file migrations/1718889148000-openid.js attempts to create a new table with data from the "passwords" column of the "auth" table:

    INSERT INTO auth_new (method, display_name, extra_data, active)
      SELECT 'password', 'Password', password, 1 FROM auth;
        DROP TABLE auth;
        ALTER TABLE auth_new RENAME TO auth

but no such column exists in my db:

sqlite> .schema auth
CREATE TABLE IF NOT EXISTS "auth"
        (method TEXT PRIMARY KEY,
        display_name TEXT,
        extra_data TEXT, active INTEGER);
sqlite> 

additionally, migrations/1719409568000-multiuser.js causes a similar issue (i did not look into this as much as the one above before deleting it):

Feb 19 11:00:27 actualbudget systemd[1]: Started actualbudget.service - Actual Budget Service.
Feb 19 11:00:27 actualbudget yarn[3746]: Checking if there are any migrations to run for direction "up"...
Feb 19 11:00:27 actualbudget yarn[3746]: /opt/actualbudget/node_modules/better-sqlite3/lib/methods/wrappers.js:9
Feb 19 11:00:27 actualbudget yarn[3746]:         this[cppdb].exec(sql);
Feb 19 11:00:27 actualbudget yarn[3746]:                     ^
Feb 19 11:00:27 actualbudget yarn[3746]: SqliteError: table users already exists
Feb 19 11:00:27 actualbudget yarn[3746]:     at Database.exec (/opt/actualbudget/node_modules/better-sqlite3/lib/methods/wrappers.js:9:14)
Feb 19 11:00:27 actualbudget yarn[3746]:     at WrappedDatabase.exec (file:///opt/actualbudget/src/db.js:30:20)
Feb 19 11:00:27 actualbudget yarn[3746]:     at file:///opt/actualbudget/migrations/1719409568000-multiuser.js:8:15
Feb 19 11:00:27 actualbudget yarn[3746]:     at sqliteTransaction (/opt/actualbudget/node_modules/better-sqlite3/lib/methods/transaction.js:65:24)
Feb 19 11:00:27 actualbudget yarn[3746]:     at WrappedDatabase.transaction (file:///opt/actualbudget/src/db.js:47:35)
Feb 19 11:00:27 actualbudget yarn[3746]:     at Migration.up (file:///opt/actualbudget/migrations/1719409568000-multiuser.js:7:13)
Feb 19 11:00:27 actualbudget yarn[3746]:     at next (/opt/actualbudget/node_modules/migrate/lib/migrate.js:35:45)
Feb 19 11:00:27 actualbudget yarn[3746]:     at migrate (/opt/actualbudget/node_modules/migrate/lib/migrate.js:76:3)
Feb 19 11:00:27 actualbudget yarn[3746]:     at MigrationSet.migrate (/opt/actualbudget/node_modules/migrate/lib/set.js:123:3)
Feb 19 11:00:27 actualbudget yarn[3746]:     at MigrationSet.up (/opt/actualbudget/node_modules/migrate/lib/set.js:107:8) {
Feb 19 11:00:27 actualbudget yarn[3746]:   code: 'SQLITE_ERROR'
Feb 19 11:00:27 actualbudget yarn[3746]: }

after deleting both migrations/1718889148000-openid.js and migrations/1719409568000-multiuser.js actualbudget 25.2.1 is able to start and runs with seemingly no errors (i dont use openid or multiuser)

How can we reproduce the issue?

update actualbudget 25.1.0 to 25.2.1

Where are you hosting Actual?

Locally via Yarn

What browsers are you seeing the problem on?

No response

Operating System

Linux

Originally created by @albanqafa on GitHub (Feb 19, 2025). Original GitHub issue: https://github.com/actualbudget/actual/issues/4406 ### Verified issue does not already exist? - [x] I have searched and found no existing issue ### What happened? i found this issue while working out a different problem with the maintainer of the Proxmox VE Helper scripts You can see communication that lead to my finding here: https://github.com/community-scripts/ProxmoxVE/issues/2490 the problem appears that in upgrading from 25.1.0 to 25.2.1 the file migrations/1718889148000-openid.js attempts to create a new table with data from the "passwords" column of the "auth" table: ``` INSERT INTO auth_new (method, display_name, extra_data, active) SELECT 'password', 'Password', password, 1 FROM auth; DROP TABLE auth; ALTER TABLE auth_new RENAME TO auth ``` but no such column exists in my db: ``` sqlite> .schema auth CREATE TABLE IF NOT EXISTS "auth" (method TEXT PRIMARY KEY, display_name TEXT, extra_data TEXT, active INTEGER); sqlite> ``` additionally, migrations/1719409568000-multiuser.js causes a similar issue (i did not look into this as much as the one above before deleting it): ``` Feb 19 11:00:27 actualbudget systemd[1]: Started actualbudget.service - Actual Budget Service. Feb 19 11:00:27 actualbudget yarn[3746]: Checking if there are any migrations to run for direction "up"... Feb 19 11:00:27 actualbudget yarn[3746]: /opt/actualbudget/node_modules/better-sqlite3/lib/methods/wrappers.js:9 Feb 19 11:00:27 actualbudget yarn[3746]: this[cppdb].exec(sql); Feb 19 11:00:27 actualbudget yarn[3746]: ^ Feb 19 11:00:27 actualbudget yarn[3746]: SqliteError: table users already exists Feb 19 11:00:27 actualbudget yarn[3746]: at Database.exec (/opt/actualbudget/node_modules/better-sqlite3/lib/methods/wrappers.js:9:14) Feb 19 11:00:27 actualbudget yarn[3746]: at WrappedDatabase.exec (file:///opt/actualbudget/src/db.js:30:20) Feb 19 11:00:27 actualbudget yarn[3746]: at file:///opt/actualbudget/migrations/1719409568000-multiuser.js:8:15 Feb 19 11:00:27 actualbudget yarn[3746]: at sqliteTransaction (/opt/actualbudget/node_modules/better-sqlite3/lib/methods/transaction.js:65:24) Feb 19 11:00:27 actualbudget yarn[3746]: at WrappedDatabase.transaction (file:///opt/actualbudget/src/db.js:47:35) Feb 19 11:00:27 actualbudget yarn[3746]: at Migration.up (file:///opt/actualbudget/migrations/1719409568000-multiuser.js:7:13) Feb 19 11:00:27 actualbudget yarn[3746]: at next (/opt/actualbudget/node_modules/migrate/lib/migrate.js:35:45) Feb 19 11:00:27 actualbudget yarn[3746]: at migrate (/opt/actualbudget/node_modules/migrate/lib/migrate.js:76:3) Feb 19 11:00:27 actualbudget yarn[3746]: at MigrationSet.migrate (/opt/actualbudget/node_modules/migrate/lib/set.js:123:3) Feb 19 11:00:27 actualbudget yarn[3746]: at MigrationSet.up (/opt/actualbudget/node_modules/migrate/lib/set.js:107:8) { Feb 19 11:00:27 actualbudget yarn[3746]: code: 'SQLITE_ERROR' Feb 19 11:00:27 actualbudget yarn[3746]: } ``` after deleting both migrations/1718889148000-openid.js and migrations/1719409568000-multiuser.js actualbudget 25.2.1 is able to start and runs with seemingly no errors (i dont use openid or multiuser) ### How can we reproduce the issue? update actualbudget 25.1.0 to 25.2.1 ### Where are you hosting Actual? Locally via Yarn ### What browsers are you seeing the problem on? _No response_ ### Operating System Linux
GiteaMirror added the bug label 2026-04-26 04:03:30 -05:00
Author
Owner

@jfdoming commented on GitHub (Feb 19, 2025):

Please see #3957

<!-- gh-comment-id:2669239494 --> @jfdoming commented on GitHub (Feb 19, 2025): Please see #3957
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#43535