Skip to content

cause: SqliteError: NOT NULL constraint failed: user.bookmarkClickAction #1919

@halkeye

Description

@halkeye

Describe the Bug

On startup of ghcr.io/karakeep-app/karakeep:0.27.0 image i'm getting the following output in logs

/package/admin/s6-overlay/libexec/preinit: info: /run belongs to uid 0 instead of 1000 - fixing it
s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service init-db-migration: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
Running db migration script
s6-rc: info: service legacy-cont-init successfully started
file:///db_migrations/index.js:7854
      throw new DrizzleError({ cause: err, message: `Failed to run the query '${staticQuery.sql}'` });
            ^
DrizzleError: Failed to run the query '
UPDATE `user` SET
  `bookmarkClickAction` = (
    SELECT `bookmarkClickAction` FROM `userSettings` WHERE `userSettings`.`userId` = `user`.`id`
  ),
  `archiveDisplayBehaviour` = (
    SELECT `archiveDisplayBehaviour` FROM `userSettings` WHERE `userSettings`.`userId` = `user`.`id`
  ),
  `timezone` = (
    SELECT `timezone` FROM `userSettings` WHERE `userSettings`.`userId` = `user`.`id`
  );'
    at BetterSQLiteSession.run (file:///db_migrations/index.js:7854:13)
    at SQLiteSyncDialect.migrate (file:///db_migrations/index.js:5712:21)
    ... 4 lines matching cause stack trace ...
    at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:117:5) {
  cause: SqliteError: NOT NULL constraint failed: user.bookmarkClickAction
      at PreparedQuery.run (file:///db_migrations/index.js:7969:22)
      at BetterSQLiteSession.run (file:///db_migrations/index.js:7852:74)
      at SQLiteSyncDialect.migrate (file:///db_migrations/index.js:5712:21)
      at migrator_migrate (file:///db_migrations/index.js:2197:14)
      at file:///db_migrations/index.js:13874:1
      at ModuleJob.run (node:internal/modules/esm/module_job:345:25)
      at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:651:26)
      at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:117:5) {
    code: 'SQLITE_CONSTRAINT_NOTNULL'
  }
}
Node.js v22.19.0
s6-rc: warning: unable to start service init-db-migration: command exited 1
s6-rc: info: service legacy-cont-init: stopping
s6-rc: info: service legacy-cont-init successfully stopped
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped

Steps to Reproduce

Purely guessing here cause i can't startup (I may just roll back to see)
Have user login but not finish onboarding
run migration script?

Expected Behaviour

Not crash

Screenshots or Additional Context

No response

Device Details

No response

Exact Karakeep Version

ghcr.io/karakeep-app/karakeep:0.27.0

Have you checked the troubleshooting guide?

  • I have checked the troubleshooting guide and I haven't found a solution to my problem

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingstatus/untriagedThis issue needs triaging to confirm it

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions