[GH-ISSUE #1790] Env variable parse errors are misleading #1118

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

Originally created by @nickwebcouk on GitHub (Jul 27, 2025).
Original GitHub issue: https://github.com/karakeep-app/karakeep/issues/1790

Describe the Bug

When conducting a docker compose pull && docker compose up -d - upgrading form 0.24 to 0.26 (current) the webpage would return a server not found error. Running docker compose up provides an error message that starts with the line

if (val.auth.emailVerificationRequired && !val.email.smtp) {

Steps to Reproduce

run docker compose pull && docker compose up -d while on version 0.24
attempt to start the container
the container silently fails
check container running without daemon mode
observer error

Expected Behaviour

The db migration to complete successfully

Screenshots or Additional Context

Full error message:

chrome-1 | DevTools listening on ws://0.0.0.0:9222/devtools/browser/a026aca4-c5fd-4ef5-a6b4-22ab29befccc chrome-1 | [0727/202515.283170:WARNING:sandbox_linux.cc(420)] InitializeSandbox() called with multiple threads in process gpu-process. web-1 | /db_migrations/index.js:13768 web-1 | if (val.auth.emailVerificationRequired && !val.email.smtp) { web-1 | ^ web-1 | web-1 | TypeError: Cannot read properties of undefined (reading 'emailVerificationRequired') web-1 | at allEnv.transform.refine.message (/db_migrations/index.js:13768:18) web-1 | at Object.refinement (/db_migrations/index.js:8909:28) web-1 | at executeRefinement (/db_migrations/index.js:11971:39) web-1 | at ZodEffects._parse (/db_migrations/index.js:11991:17) web-1 | at ZodEffects._parseSync (/db_migrations/index.js:8796:29) web-1 | at ZodEffects.safeParse (/db_migrations/index.js:8826:29) web-1 | at ZodEffects.parse (/db_migrations/index.js:8807:29) web-1 | at /db_migrations/index.js:13775:41 web-1 | at /db_migrations/index.js:13890:3 web-1 | at Object.<anonymous> (/db_migrations/index.js:13893:12) web-1 | web-1 | Node.js v22.17.1 web-1 | s6-rc: warning: unable to start service init-db-migration: command exited 1

Checking the FAQ there is a mellisearch option - but as this is a migration and not a version change I have not carried out those steps. IF this should be done please close this bug and I will do so. Thanks.

Device Details

Raspberry Pi 4, Raspbian - no issues on 0.24 - fully updated

Exact Karakeep Version

0.24 - 0.26

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 @nickwebcouk on GitHub (Jul 27, 2025). Original GitHub issue: https://github.com/karakeep-app/karakeep/issues/1790 ### Describe the Bug When conducting a `docker compose pull && docker compose up -d` - upgrading form 0.24 to 0.26 (current) the webpage would return a server not found error. Running `docker compose up` provides an error message that starts with the line `if (val.auth.emailVerificationRequired && !val.email.smtp) {` ### Steps to Reproduce run `docker compose pull && docker compose up -d` while on version 0.24 attempt to start the container the container silently fails check container running without daemon mode observer error ### Expected Behaviour The db migration to complete successfully ### Screenshots or Additional Context Full error message: `chrome-1 | DevTools listening on ws://0.0.0.0:9222/devtools/browser/a026aca4-c5fd-4ef5-a6b4-22ab29befccc chrome-1 | [0727/202515.283170:WARNING:sandbox_linux.cc(420)] InitializeSandbox() called with multiple threads in process gpu-process. web-1 | /db_migrations/index.js:13768 web-1 | if (val.auth.emailVerificationRequired && !val.email.smtp) { web-1 | ^ web-1 | web-1 | TypeError: Cannot read properties of undefined (reading 'emailVerificationRequired') web-1 | at allEnv.transform.refine.message (/db_migrations/index.js:13768:18) web-1 | at Object.refinement (/db_migrations/index.js:8909:28) web-1 | at executeRefinement (/db_migrations/index.js:11971:39) web-1 | at ZodEffects._parse (/db_migrations/index.js:11991:17) web-1 | at ZodEffects._parseSync (/db_migrations/index.js:8796:29) web-1 | at ZodEffects.safeParse (/db_migrations/index.js:8826:29) web-1 | at ZodEffects.parse (/db_migrations/index.js:8807:29) web-1 | at /db_migrations/index.js:13775:41 web-1 | at /db_migrations/index.js:13890:3 web-1 | at Object.<anonymous> (/db_migrations/index.js:13893:12) web-1 | web-1 | Node.js v22.17.1 web-1 | s6-rc: warning: unable to start service init-db-migration: command exited 1` Checking the FAQ there is a mellisearch option - but as this is a migration and not a version change I have not carried out those steps. IF this should be done please close this bug and I will do so. Thanks. ### Device Details Raspberry Pi 4, Raspbian - no issues on 0.24 - fully updated ### Exact Karakeep Version 0.24 - 0.26 ### 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:07 +03:00
Author
Owner

@MohamedBassem commented on GitHub (Jul 27, 2025):

The database migration is actually not failing, in 0.26 I changed the way we parse the env variables and this error hides the true env variable validation error. Between 0.24 and 0.26, in 0.25 I added a validation that NEXTAUTH_URL is a valid URL, by any chance are you not setting this or setting it to something invalid?

<!-- gh-comment-id:3124713056 --> @MohamedBassem commented on GitHub (Jul 27, 2025): The database migration is actually not failing, in 0.26 I changed the way we parse the env variables and this error hides the true env variable validation error. Between 0.24 and 0.26, in 0.25 I added a validation that `NEXTAUTH_URL` is a valid URL, by any chance are you not setting this or setting it to something invalid?
Author
Owner

@nickwebcouk commented on GitHub (Jul 27, 2025):

And that was it! I didn't have https:// at the start of the URL - I've never needed it before. I access Karakeep from both an internal address and external - so it looks like it's external only now as the internal login just loops. Cheers for the very fast response and figuring it out!

<!-- gh-comment-id:3124725094 --> @nickwebcouk commented on GitHub (Jul 27, 2025): And that was it! I didn't have `https:// `at the start of the URL - I've never needed it before. I access Karakeep from both an internal address and external - so it looks like it's external only now as the internal login just loops. Cheers for the very fast response and figuring it out!
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#1118
No description provided.