Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug after Upgrade to latest Docker #86

Closed
RiDDiX opened this issue Oct 27, 2023 · 8 comments
Closed

Bug after Upgrade to latest Docker #86

RiDDiX opened this issue Oct 27, 2023 · 8 comments

Comments

@RiDDiX
Copy link

RiDDiX commented Oct 27, 2023

   
message "csrfField is not a function"
stack "Error: csrfField is not a function\n at anonymous (/app/build/resources/views/dashboard/login.edge:22:0)\n at Template.reThrow (/app/node_modules/.pnpm/edge.js@5.5.1/node_modules/edge.js/build/src/Template/index.js:174:15)\n at template (eval at wrapToFunction (/app/node_modules/.pnpm/edge.js@5.5.1/node_modules/edge.js/build/src/Template/index.js:60:20), :217:10)\n at Template.renderCompiled (/app/node_modules/.pnpm/edge.js@5.5.1/node_modules/edge.js/build/src/Template/index.js:80:57)\n at Template.render (/app/node_modules/.pnpm/edge.js@5.5.1/node_modules/edge.js/build/src/Template/index.js:135:21)\n at EdgeRenderer.render (/app/node_modules/.pnpm/edge.js@5.5.1/node_modules/edge.js/build/src/Renderer/index.js:37:103)\n at LoginController.show (/app/app/Controllers/Http/Dashboard/LoginController.ts:12:17)\n at Injector.callAsync (/app/node_modules/.pnpm/@adonisjs+fold@8.2.0/node_modules/@adonisjs/fold/build/src/Ioc/Injector.js:124:30)"
code "E_RUNTIME_EXCEPTION"
@SpecialAro
Copy link
Member

Please use NODE_ENV=production to fix this.
We should also change it on the docs.

@RiDDiX
Copy link
Author

RiDDiX commented Oct 28, 2023

I did this and then this comes up when I try to login with Ferdium App:

{"level":30,"time":1698527975484,"pid":507,"hostname":"4400417f3aee","name":"ferdium-server","msg":"started server on 0.0.0.0:3333"}
{"level":50,"time":1698527980455,"pid":507,"hostname":"4400417f3aee","name":"ferdium-server","err":{"type":"DatabaseError","message":"insert into "jwt_tokens" ("created_at", "expires_at", "name", "refresh_token", "refresh_token_expires_at", "token", "type", "user_id") values ($1, $2, $3, $4, $5, $6, $7, $8) returning "id" - relation "jwt_tokens" does not exist","stack":"error: insert into "jwt_tokens" ("created_at", "expires_at", "name", "refresh_token", "refresh_token_expires_at", "token", "type", "user_id") values ($1, $2, $3, $4, $5, $6, $7, $8) returning "id" - relation "jwt_tokens" does not exist\n at Parser.parseErrorMessage (/app/node_modules/.pnpm/pg-protocol@1.6.0/node_modules/pg-protocol/src/parser.ts:369:69)\n at Parser.handlePacket (/app/node_modules/.pnpm/pg-protocol@1.6.0/node_modules/pg-protocol/src/parser.ts:188:21)\n at Parser.parse (/app/node_modules/.pnpm/pg-protocol@1.6.0/node_modules/pg-protocol/src/parser.ts:103:30)\n at Socket. (/app/node_modules/.pnpm/pg-protocol@1.6.0/node_modules/pg-protocol/src/index.ts:7:48)\n at Socket.emit (node:events:517:28)\n at addChunk (node:internal/streams/readable:335:12)\n at readableAddChunk (node:internal/streams/readable:308:9)\n at Socket.Readable.push (node:internal/streams/readable:245:10)\n at TCP.onStreamRead (node:internal/stream_base_commons:190:23)","length":109,"name":"error","severity":"ERROR","code":"42P01","position":"13","file":"parse_relation.c","line":"1381","routine":"parserOpenTable","status":500},"msg":"insert into "jwt_tokens" ("created_at", "expires_at", "name", "refresh_token", "refresh_token_expires_at", "token", "type", "user_id") values ($1, $2, $3, $4, $5, $6, $7, $8) returning "id" - relation "jwt_tokens" does not exist"}

@RiDDiX
Copy link
Author

RiDDiX commented Oct 28, 2023

Fixed it by deleting the whole database. Let it recreate it and then I just imported my services / users.

@DragonHeart69
Copy link

Can you also change the docker compose plz ? :)

@fabolhak
Copy link
Contributor

fabolhak commented Jan 1, 2024

Hello, thank you for the hint. I also used NODE_ENV=production, but then the node app was not able to generate the app key (see logs below). After manually mounting an app key file this worked fine for me:
./FERDIUM_APP_KEY.txt:/data/FERDIUM_APP_KEY.txt:ro

Is this the correct way to do it?

I would be happy to update the docs 🙂

ferdium_1  | **** Generating Ferdium-server app key for first run ****
ferdium_1  | 
ferdium_1  |    ERROR  Cannot run key:generate command in production. Pass --force flag to continue
ferdium_1  | 
ferdium_1  | **** App key is . You can modify `/data/FERDIUM_APP_KEY.txt` to update the app key ****
ferdium_1  | Generating public and private keys...
ferdium_1  | CREATE: /data/private.pem
ferdium_1  | CREATE: /data/public.pem
ferdium_1  | Public and private keys generated successfully.
ferdium_1  | Database file '/data/ferdium.sqlite' not found. An empty database will be created.
ferdium_1  | 
ferdium_1  |    Exception:
ferdium_1  | E_MISSING_ENV_VALUE:
ferdium_1  | Missing
ferdium_1  | environment
ferdium_1  | variable
ferdium_1  | "APP_KEY"

@SpecialAro
Copy link
Member

SpecialAro commented Jan 8, 2024

Hello, thank you for the hint. I also used NODE_ENV=production, but then the node app was not able to generate the app key (see logs below). After manually mounting an app key file this worked fine for me: ./FERDIUM_APP_KEY.txt:/data/FERDIUM_APP_KEY.txt:ro

Is this the correct way to do it?

I would be happy to update the docs 🙂

ferdium_1  | **** Generating Ferdium-server app key for first run ****
ferdium_1  | 
ferdium_1  |    ERROR  Cannot run key:generate command in production. Pass --force flag to continue
ferdium_1  | 
ferdium_1  | **** App key is . You can modify `/data/FERDIUM_APP_KEY.txt` to update the app key ****
ferdium_1  | Generating public and private keys...
ferdium_1  | CREATE: /data/private.pem
ferdium_1  | CREATE: /data/public.pem
ferdium_1  | Public and private keys generated successfully.
ferdium_1  | Database file '/data/ferdium.sqlite' not found. An empty database will be created.
ferdium_1  | 
ferdium_1  |    Exception:
ferdium_1  | E_MISSING_ENV_VALUE:
ferdium_1  | Missing
ferdium_1  | environment
ferdium_1  | variable
ferdium_1  | "APP_KEY"

I wasn't aware that key:generate command would fail in production. I'll raise a PR to use the --force flag.

@fabolhak
Copy link
Contributor

fabolhak commented Jan 17, 2024

@SpecialAro thank you! After cleaning my data and recipe volume, everything works fine using production. I also created a PR to update the docs: #97

I think this issue can be closed now :)

@SpecialAro
Copy link
Member

Thank you @fabolhak for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants