Migration 1.15.0 fails to run, stuck with "no such column: requireDeviceApproval" #328

Closed
opened 2026-04-05 17:06:25 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @Mevas on 1/25/2026

Describe the Bug

Title: SQLite Migration 1.15.0 fails to run, stuck with "no such column: requireDeviceApproval"

Description:

When upgrading from 1.14.0 to 1.15.0, the migration fails silently and leaves the database in an inconsistent state. The app then continuously errors with:

SqliteError: no such column: "requireDeviceApproval" - should this be a string literal in single-quotes?

Root Cause:

On startup, the migration runner outputs:

Starting migrations from version 1.15.0
Migrations to run:
All migrations completed successfully

This indicates the upgrade check logic is broken. The versionMigrations table was empty, but the migration runner incorrectly determined that 1.15.0 was already the current version and skipped running the 1.15.0 migration. This leaves the database schema incomplete.

Note: Even manually setting APP_VERSION="0.14.1" when running the migration script doesn't work:

APP_VERSION="0.14.1" ENVIRONMENT=prod node dist/migrations.mjs
Starting migrations from version 1.15.0
Migrations to run:
All migrations completed successfully

The migration runner still reports "Starting migrations from version 1.15.0" despite the explicit environment variable, suggesting the version detection logic ignores APP_VERSION or has another source of truth.

Possible Issue:

It seems like fresh 1.14.1 deployments may not properly populate the versionMigrations table, causing subsequent upgrades to fail.

Workaround:

  1. Manually insert the missing 1.14.0 entry into the migrations table:

    # Inside the container or with direct sqlite3 access
    sqlite3 /path/to/db/db.sqlite "INSERT INTO versionMigrations (version, executedAt) VALUES ('1.14.0', $(date +%s)000);"
    
  2. Run migrations manually:

    docker exec -it <container> sh -c "ENVIRONMENT=prod node dist/migrations.mjs"
    
  3. Verify 1.15.0 migration completed:

    sqlite3 /path/to/db/db.sqlite "SELECT * FROM versionMigrations;"
    

Environment

  • Docker deployment
  • SQLite database
  • Started with: 1.14.1 (fresh deployment)
  • Upgraded to: 1.15.0

To Reproduce

  1. Deploy fresh 1.14.0/1.14.1 instance (I started with 1.14.1 a few weeks ago)
  2. Upgrade to 1.15.0
  3. Start the app
  4. Check versionMigrations table — it's empty (or missing 1.14.0)
  5. App crashes with requireDeviceApproval column missing error
  6. Restarting shows the same "Migrations to run: [empty]" output

Expected Behavior

  • Fresh deployments should populate versionMigrations with the current version
  • Migration runner should correctly detect when migrations need to run
  • Failed migrations should not silently complete
*Originally created by @Mevas on 1/25/2026* ### Describe the Bug **Title:** SQLite Migration 1.15.0 fails to run, stuck with "no such column: requireDeviceApproval" **Description:** When upgrading from 1.14.0 to 1.15.0, the migration fails silently and leaves the database in an inconsistent state. The app then continuously errors with: ``` SqliteError: no such column: "requireDeviceApproval" - should this be a string literal in single-quotes? ``` **Root Cause:** On startup, the migration runner outputs: ``` Starting migrations from version 1.15.0 Migrations to run: All migrations completed successfully ``` This indicates the upgrade check logic is broken. The `versionMigrations` table was empty, but the migration runner incorrectly determined that 1.15.0 was already the current version and skipped running the 1.15.0 migration. This leaves the database schema incomplete. **Note:** Even manually setting `APP_VERSION="0.14.1"` when running the migration script doesn't work: ```bash APP_VERSION="0.14.1" ENVIRONMENT=prod node dist/migrations.mjs Starting migrations from version 1.15.0 Migrations to run: All migrations completed successfully ``` The migration runner still reports "Starting migrations from version 1.15.0" despite the explicit environment variable, suggesting the version detection logic ignores `APP_VERSION` or has another source of truth. **Possible Issue:** It seems like fresh 1.14.1 deployments may not properly populate the `versionMigrations` table, causing subsequent upgrades to fail. **Workaround:** 1. Manually insert the missing 1.14.0 entry into the migrations table: ```bash # Inside the container or with direct sqlite3 access sqlite3 /path/to/db/db.sqlite "INSERT INTO versionMigrations (version, executedAt) VALUES ('1.14.0', $(date +%s)000);" ``` 2. Run migrations manually: ```bash docker exec -it <container> sh -c "ENVIRONMENT=prod node dist/migrations.mjs" ``` 3. Verify 1.15.0 migration completed: ```bash sqlite3 /path/to/db/db.sqlite "SELECT * FROM versionMigrations;" ``` ### Environment - Docker deployment - SQLite database - Started with: 1.14.1 (fresh deployment) - Upgraded to: 1.15.0 ### To Reproduce 1. Deploy fresh 1.14.0/1.14.1 instance (I started with 1.14.1 a few weeks ago) 2. Upgrade to 1.15.0 3. Start the app 4. Check `versionMigrations` table — it's empty (or missing 1.14.0) 5. App crashes with `requireDeviceApproval` column missing error 6. Restarting shows the same "Migrations to run: [empty]" output ### Expected Behavior - Fresh deployments should populate `versionMigrations` with the current version - Migration runner should correctly detect when migrations need to run - Failed migrations should not silently complete
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/pangolin#328