[GH-ISSUE #1797] The web app docker is crashing in db migration script. #1123

Closed
opened 2026-03-02 11:55:10 +03:00 by kerem · 4 comments
Owner

Originally created by @theatul on GitHub (Jul 29, 2025).
Original GitHub issue: https://github.com/karakeep-app/karakeep/issues/1797

Describe the Bug

This is a new install, it worked fine for the first time and stuck here after a docker compose down/up cycle.
I even provided the env "EMAIL_VERIFICATION_REQUIRED" in the docker-compose even though it's not a mandatory variable.

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
Running db migration script
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
/db_migrations/index.js:13768
if (val.auth.emailVerificationRequired && !val.email.smtp) {
^

TypeError: Cannot read properties of undefined (reading 'emailVerificationRequired')
at allEnv.transform.refine.message (/db_migrations/index.js:13768:18)
at Object.refinement (/db_migrations/index.js:8909:28)
at executeRefinement (/db_migrations/index.js:11971:39)
at ZodEffects._parse (/db_migrations/index.js:11991:17)
at ZodEffects._parseSync (/db_migrations/index.js:8796:29)
at ZodEffects.safeParse (/db_migrations/index.js:8826:29)
at ZodEffects.parse (/db_migrations/index.js:8807:29)
at /db_migrations/index.js:13775:41
at /db_migrations/index.js:13890:3
at Object. (/db_migrations/index.js:13893:12)

Node.js v22.17.1
s6-rc: warning: unable to start service init-db-migration: command exited

Steps to Reproduce

I have not tried to reproduce it yet, but it occurred with following steps:

  • Docker compose up with the standard docker compose configuration.
  • added a user with UI.
  • Added a test link
  • Docker compose down.
  • Added Ollama configuration.
  • Added DISABLE_SIGNUPS: false env.
  • docker compose up -d

Expected Behaviour

The app should be able to boot, and probably not do db-migration( I am not sure when db-migration should kick in, but this is a new install with no version changes in between so not expecting the migration to kick in)
if the DB migration kicks in, the environment variable "emailVerificationRequired" should not be mandatory,

Screenshots or Additional Context

No response

Device Details

No response

Exact Karakeep Version

Latest docker file release on july 28 2025, i do not have a webpage up to check.

Have you checked the troubleshooting guide?

  • I have checked the troubleshooting guide and I haven't found a solution to my problem
Originally created by @theatul on GitHub (Jul 29, 2025). Original GitHub issue: https://github.com/karakeep-app/karakeep/issues/1797 ### Describe the Bug This is a new install, it worked fine for the first time and stuck here after a docker compose down/up cycle. I even provided the env "EMAIL_VERIFICATION_REQUIRED" in the docker-compose even though it's not a mandatory variable. 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 Running db migration script s6-rc: info: service fix-attrs successfully started s6-rc: info: service legacy-cont-init: starting s6-rc: info: service legacy-cont-init successfully started /db_migrations/index.js:13768 if (val.auth.emailVerificationRequired && !val.email.smtp) { ^ TypeError: Cannot read properties of undefined (reading 'emailVerificationRequired') at allEnv.transform.refine.message (/db_migrations/index.js:13768:18) at Object.refinement (/db_migrations/index.js:8909:28) at executeRefinement (/db_migrations/index.js:11971:39) at ZodEffects._parse (/db_migrations/index.js:11991:17) at ZodEffects._parseSync (/db_migrations/index.js:8796:29) at ZodEffects.safeParse (/db_migrations/index.js:8826:29) at ZodEffects.parse (/db_migrations/index.js:8807:29) at /db_migrations/index.js:13775:41 at /db_migrations/index.js:13890:3 at Object.<anonymous> (/db_migrations/index.js:13893:12) Node.js v22.17.1 s6-rc: warning: unable to start service init-db-migration: command exited ### Steps to Reproduce I have not tried to reproduce it yet, but it occurred with following steps: - Docker compose up with the standard docker compose configuration. - added a user with UI. - Added a test link - Docker compose down. - Added Ollama configuration. - Added DISABLE_SIGNUPS: false env. - docker compose up -d ### Expected Behaviour The app should be able to boot, and probably not do db-migration( I am not sure when db-migration should kick in, but this is a new install with no version changes in between so not expecting the migration to kick in) if the DB migration kicks in, the environment variable "emailVerificationRequired" should not be mandatory, ### Screenshots or Additional Context _No response_ ### Device Details _No response_ ### Exact Karakeep Version Latest docker file release on july 28 2025, i do not have a webpage up to check. ### Have you checked the troubleshooting guide? - [x] I have checked the troubleshooting guide and I haven't found a solution to my problem
kerem 2026-03-02 11:55:10 +03:00
Author
Owner

@sprjr commented on GitHub (Jul 31, 2025):

Wanted to include that I went through similar steps to you and ran into the same issue.

s6-rc: warning: unable to start service init-db-migration: command exited 1

I did not add the DISABLE_SIGNUPS variable, nor have I added a user or test link. I did add Ollama.

<!-- gh-comment-id:3140971856 --> @sprjr commented on GitHub (Jul 31, 2025): Wanted to include that I went through similar steps to you and ran into the same issue. `s6-rc: warning: unable to start service init-db-migration: command exited 1` I did not add the DISABLE_SIGNUPS variable, nor have I added a user or test link. I did add Ollama.
Author
Owner

@theatul commented on GitHub (Jul 31, 2025):

I was able to reproduce it and found the problem, the error is reproduced when i configure Ollama endpoint without http:
OLLAMA_BASE_URL="192.168.1.33:4012"

and this work:
OLLAMA_BASE_URL="http://192.168.1.33:4012/api/generate"

So this look like a failed validation kicking in DB migration ?
Also does this mean that db_migration script also have a problem and would actually fail if needed?

<!-- gh-comment-id:3141156944 --> @theatul commented on GitHub (Jul 31, 2025): I was able to reproduce it and found the problem, the error is reproduced when i configure Ollama endpoint without http: OLLAMA_BASE_URL="192.168.1.33:4012" and this work: OLLAMA_BASE_URL="http://192.168.1.33:4012/api/generate" So this look like a failed validation kicking in DB migration ? Also does this mean that db_migration script also have a problem and would actually fail if needed?
Author
Owner

@sprjr commented on GitHub (Jul 31, 2025):

Modifying my OLLAMA_BASE_URL variable to the same format worked for me too, thanks!

<!-- gh-comment-id:3141206865 --> @sprjr commented on GitHub (Jul 31, 2025): Modifying my OLLAMA_BASE_URL variable to the same format worked for me too, thanks!
Author
Owner

@MohamedBassem commented on GitHub (Aug 3, 2025):

Glad you found the issue. The problem of it showing as "db migration error" is fixed in #1790.

<!-- gh-comment-id:3148497574 --> @MohamedBassem commented on GitHub (Aug 3, 2025): Glad you found the issue. The problem of it showing as "db migration error" is fixed in #1790.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/karakeep#1123
No description provided.