[GH-ISSUE #145] Development Instructions are incomplete/not working #120

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

Originally created by @kamtschatka on GitHub (May 10, 2024).
Original GitHub issue: https://github.com/karakeep-app/karakeep/issues/145

I tried to set up the workspace to see if I can contribute, but I am not able to get it to work.

  1. The setup page mentions cp .env.sample .env, but that does not exist. I have therefore created a .env file with DATA_DIR=<absolute path> inside.
  2. When I run everything, the login page loads fine, but when I then try to sign up, i get a "no such table: user" error. I checked the db.db file and it exists in the location of my DATA_DIR, but it is completely empty (0 bytes)
  3. I then tried to create some breakpoints in the db shared project to see if it even reaches there, but I am unable to stop at any of them for some reason. I am using VS Code and launched pnpm web with the debug config, but to no avail.

Would be great if you could provide more thorough instructions on setting up the dev environment.

Originally created by @kamtschatka on GitHub (May 10, 2024). Original GitHub issue: https://github.com/karakeep-app/karakeep/issues/145 I tried to set up the workspace to see if I can contribute, but I am not able to get it to work. 1. [The setup page](https://docs.hoarder.app/Development/setup) mentions `cp .env.sample .env`, but that does not exist. I have therefore created a `.env` file with `DATA_DIR=<absolute path>` inside. 2. When I run everything, the login page loads fine, but when I then try to sign up, i get a "no such table: user" error. I checked the `db.db` file and it exists in the location of my `DATA_DIR`, but it is completely empty (0 bytes) 3. I then tried to create some breakpoints in the db shared project to see if it even reaches there, but I am unable to stop at any of them for some reason. I am using VS Code and launched `pnpm web` with the debug config, but to no avail. Would be great if you could provide more thorough instructions on setting up the dev environment.
kerem closed this issue 2026-03-02 11:46:48 +03:00
Author
Owner

@MohamedBassem commented on GitHub (May 10, 2024):

Ah, I need to update the dev instructions, sorry for the hassle. Will update them over the weekend.

The error you're seeing indicates that you didn't run the migrations. Run pnpm run db:migrate from the root of the directory. One another missing instruction is that you need to symlink the .env file to the apps/web, apps/workers, and the packages/db directories so that the different components see the correct env.

<!-- gh-comment-id:2104222590 --> @MohamedBassem commented on GitHub (May 10, 2024): Ah, I need to update the dev instructions, sorry for the hassle. Will update them over the weekend. The error you're seeing indicates that you didn't run the migrations. Run `pnpm run db:migrate` from the root of the directory. One another missing instruction is that you need to symlink the `.env` file to the `apps/web`, `apps/workers`, and the `packages/db` directories so that the different components see the correct env.
Author
Owner

@kamtschatka commented on GitHub (May 10, 2024):

Thanks, that allowed me to progress and create a user.
Then I got this exception:

https://next-auth.js.org/errors#jwt_session_error decryption operation failed {
  message: 'decryption operation failed',
  stack: 'JWEDecryptionFailed: decryption operation failed\n' +
    '    at gcmDecrypt (webpack-internal:///(rsc)/../../node_modules/next-auth/node_modules/jose/dist/node/cjs/runtime/decrypt.js:67:15)\n' +
    '    at decrypt (webpack-internal:///(rsc)/../../node_modules/next-auth/node_modules/jose/dist/node/cjs/runtime/decrypt.js:92:20)\n' +
    '    at flattenedDecrypt (webpack-internal:///(rsc)/../../node_modules/next-auth/node_modules/jose/dist/node/cjs/jwe/flattened/decrypt.js:143:52)\n' +
    '    at async compactDecrypt (webpack-internal:///(rsc)/../../node_modules/next-auth/node_modules/jose/dist/node/cjs/jwe/compact/decrypt.js:18:23)\n' +
    '    at async jwtDecrypt (webpack-internal:///(rsc)/../../node_modules/next-auth/node_modules/jose/dist/node/cjs/jwt/decrypt.js:8:23)\n' +
    '    at async Object.decode (webpack-internal:///(rsc)/../../node_modules/next-auth/jwt/index.js:66:7)\n' +
    '    at async Object.session (webpack-internal:///(rsc)/../../node_modules/next-auth/core/routes/session.js:43:28)\n' +
    '    at async AuthHandler (webpack-internal:///(rsc)/../../node_modules/next-auth/core/index.js:165:27)\n' +
    '    at async getServerSession (webpack-internal:///(rsc)/../../node_modules/next-auth/next/index.js:159:19)\n' +
    '    at async Home (webpack-internal:///(rsc)/./app/page.tsx:10:21)',
  name: 'JWEDecryptionFailed'
}

I added NEXTAUTH_SECRET=<secret> to the .env and now it seems to work.

<!-- gh-comment-id:2104287836 --> @kamtschatka commented on GitHub (May 10, 2024): Thanks, that allowed me to progress and create a user. Then I got this exception: ``` https://next-auth.js.org/errors#jwt_session_error decryption operation failed { message: 'decryption operation failed', stack: 'JWEDecryptionFailed: decryption operation failed\n' + ' at gcmDecrypt (webpack-internal:///(rsc)/../../node_modules/next-auth/node_modules/jose/dist/node/cjs/runtime/decrypt.js:67:15)\n' + ' at decrypt (webpack-internal:///(rsc)/../../node_modules/next-auth/node_modules/jose/dist/node/cjs/runtime/decrypt.js:92:20)\n' + ' at flattenedDecrypt (webpack-internal:///(rsc)/../../node_modules/next-auth/node_modules/jose/dist/node/cjs/jwe/flattened/decrypt.js:143:52)\n' + ' at async compactDecrypt (webpack-internal:///(rsc)/../../node_modules/next-auth/node_modules/jose/dist/node/cjs/jwe/compact/decrypt.js:18:23)\n' + ' at async jwtDecrypt (webpack-internal:///(rsc)/../../node_modules/next-auth/node_modules/jose/dist/node/cjs/jwt/decrypt.js:8:23)\n' + ' at async Object.decode (webpack-internal:///(rsc)/../../node_modules/next-auth/jwt/index.js:66:7)\n' + ' at async Object.session (webpack-internal:///(rsc)/../../node_modules/next-auth/core/routes/session.js:43:28)\n' + ' at async AuthHandler (webpack-internal:///(rsc)/../../node_modules/next-auth/core/index.js:165:27)\n' + ' at async getServerSession (webpack-internal:///(rsc)/../../node_modules/next-auth/next/index.js:159:19)\n' + ' at async Home (webpack-internal:///(rsc)/./app/page.tsx:10:21)', name: 'JWEDecryptionFailed' } ``` I added `NEXTAUTH_SECRET=<secret>` to the `.env` and now it seems to work.
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#120
No description provided.