n4ze3m / dialoqbase

Create chatbots with ease
https://dialoqbase.n4ze3m.com/
MIT License
1.54k stars 253 forks source link

dialoqbase exited with code 0 - Latest version #113

Closed oalmajalists closed 8 months ago

oalmajalists commented 8 months ago

dialoqbase | yarn run v1.22.19 dialoqbase | $ npx prisma migrate deploy && fastify start app.js dialoqbase | Prisma schema loaded from prisma/schema.prisma dialoqbase | Datasource "db": PostgreSQL database "dialoqbase", schema "public" at "dialoqbase-pg:5432" dialoqbase | dialoqbase | 15 migrations found in prisma/migrations dialoqbase | dialoqbase | dialoqbase | No pending migrations to apply. dialoqbase | WARNING: Session secret should be 32 characters long. dialoqbase | Connecting integration... dialoqbase | Connecting to database... dialoqbase | Error: the secret must have length 32 or greater dialoqbase | at checkOptions (/app/node_modules/@fastify/session/lib/fastifySession.js:211:14) dialoqbase | at fastifySession (/app/node_modules/@fastify/session/lib/fastifySession.js:10:17) dialoqbase | at Plugin.exec (/app/node_modules/avvio/plugin.js:130:19) dialoqbase | at Boot.loadPlugin (/app/node_modules/avvio/plugin.js:272:10) dialoqbase | at process.processTicksAndRejections (node:internal/process/task_queues:82:21) dialoqbase | error Command failed with exit code 1. dialoqbase | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. dialoqbase exited with code 0 dialoqbase | yarn run v1.22.19 dialoqbase | $ npx prisma migrate deploy && fastify start app.js dialoqbase | Prisma schema loaded from prisma/schema.prisma dialoqbase | Datasource "db": PostgreSQL database "dialoqbase", schema "public" at "dialoqbase-pg:5432" dialoqbase | dialoqbase | 15 migrations found in prisma/migrations dialoqbase | dialoqbase | dialoqbase | No pending migrations to apply. dialoqbase | WARNING: Session secret should be 32 characters long. dialoqbase | Connecting integration... dialoqbase | Connecting to database... dialoqbase | Error: the secret must have length 32 or greater dialoqbase | at checkOptions (/app/node_modules/@fastify/session/lib/fastifySession.js:211:14) dialoqbase | at fastifySession (/app/node_modules/@fastify/session/lib/fastifySession.js:10:17) dialoqbase | at Plugin.exec (/app/node_modules/avvio/plugin.js:130:19) dialoqbase | at Boot.loadPlugin (/app/node_modules/avvio/plugin.js:272:10) dialoqbase | at process.processTicksAndRejections (node:internal/process/task_queues:82:21) dialoqbase | error Command failed with exit code 1. dialoqbase | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. dialoqbase exited with code 0

n4ze3m commented 8 months ago

Hey, you need to provide a session secret with a length greater than 32 characters. You can use the 1Password generator for this purpose: https://1password.com/password-generator/

comeback01 commented 8 months ago

I'm having a similar problem, but I've set 32 characters.

As a result, I can't access the site.

Attaching to dialoqbase, redis, dialoqbase-postgres
redis            | 1:C 15 Oct 2023 17:31:08.417 # WARNING Memory overcommit must be enabled! Without it, a background save or replication may fail under low memory condition. Being disabled, it can also cause failures without low memory condition, see https://github.com/jemalloc/jemalloc/issues/1328. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
redis            | 1:C 15 Oct 2023 17:31:08.417 * oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
redis            | 1:C 15 Oct 2023 17:31:08.417 * Redis version=7.2.1, bits=64, commit=00000000, modified=0, pid=1, just started
redis            | 1:C 15 Oct 2023 17:31:08.417 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
redis            | 1:M 15 Oct 2023 17:31:08.417 * monotonic clock: POSIX clock_gettime
redis            | 1:M 15 Oct 2023 17:31:08.417 * Running mode=standalone, port=6379.
redis            | 1:M 15 Oct 2023 17:31:08.418 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
redis            | 1:M 15 Oct 2023 17:31:08.418 * Server initialized
redis            | 1:M 15 Oct 2023 17:31:08.418 * Loading RDB produced by version 7.2.1
redis            | 1:M 15 Oct 2023 17:31:08.418 * RDB age 12 seconds
redis            | 1:M 15 Oct 2023 17:31:08.418 * RDB memory usage when created 1.07 Mb
redis            | 1:M 15 Oct 2023 17:31:08.418 * Done loading RDB, keys loaded: 1, keys expired: 0.
redis            | 1:M 15 Oct 2023 17:31:08.418 * DB loaded from disk: 0.000 seconds
redis            | 1:M 15 Oct 2023 17:31:08.418 * Ready to accept connections tcp
dialoqbase       | yarn run v1.22.19
dialoqbase       | $ npx prisma migrate deploy && fastify start  app.js
dialoqbase       | Prisma schema loaded from prisma/schema.prisma
dialoqbase       | Datasource "db": PostgreSQL database "dialoqbase", schema "public" at "dialoqbase-pg:5432"
dialoqbase       |
dialoqbase       | 15 migrations found in prisma/migrations
dialoqbase       |
dialoqbase       |
dialoqbase       | No pending migrations to apply.
dialoqbase       | npm notice
dialoqbase       | npm notice New major version of npm available! 9.8.1 -> 10.2.0
dialoqbase       | npm notice Changelog: <https://github.com/npm/cli/releases/tag/v10.2.0>
dialoqbase       | npm notice Run `npm install -g npm@10.2.0` to update!
dialoqbase       | npm notice
dialoqbase       | WARNING: Session secret should be 32 characters long.
dialoqbase       | Connecting integration...
dialoqbase       | Connecting to database...
dialoqbase       | Error: the secret must have length 32 or greater
dialoqbase       |     at checkOptions (/app/node_modules/@fastify/session/lib/fastifySession.js:211:14)
dialoqbase       |     at fastifySession (/app/node_modules/@fastify/session/lib/fastifySession.js:10:17)
dialoqbase       |     at Plugin.exec (/app/node_modules/avvio/plugin.js:130:19)
dialoqbase       |     at Boot.loadPlugin (/app/node_modules/avvio/plugin.js:272:10)
dialoqbase       |     at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
dialoqbase       | error Command failed with exit code 1.
dialoqbase       | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
dialoqbase       | yarn run v1.22.19
dialoqbase       | $ npx prisma migrate deploy && fastify start  app.js
dialoqbase       | Prisma schema loaded from prisma/schema.prisma
dialoqbase       | Datasource "db": PostgreSQL database "dialoqbase", schema "public" at "dialoqbase-pg:5432"
dialoqbase       |
dialoqbase       | 15 migrations found in prisma/migrations
dialoqbase       |
dialoqbase       |
dialoqbase       | No pending migrations to apply.
dialoqbase       | WARNING: Session secret should be 32 characters long.
dialoqbase-postgres |
dialoqbase-postgres | PostgreSQL Database directory appears to contain a database; Skipping initialization
dialoqbase-postgres |
dialoqbase-postgres | 2023-10-15 17:31:08.496 UTC [1] LOG:  starting PostgreSQL 15.4 (Debian 15.4-2.pgdg120+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit
dialoqbase-postgres | 2023-10-15 17:31:08.496 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
dialoqbase-postgres | 2023-10-15 17:31:08.496 UTC [1] LOG:  listening on IPv6 address "::", port 5432
dialoqbase-postgres | 2023-10-15 17:31:08.504 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
dialoqbase-postgres | 2023-10-15 17:31:08.514 UTC [29] LOG:  database system was shut down at 2023-10-15 17:30:56 UTC
dialoqbase-postgres | 2023-10-15 17:31:08.524 UTC [1] LOG:  database system is ready to accept connections
n4ze3m commented 8 months ago

The error is coming from Fastify session, which requires a string with a length of at least 32 characters. If you're not using a public embedding chatbot with protection, you can simply remove the DB_SESSION_SECRET from your .env file

comeback01 commented 8 months ago

L'erreur provient de la session Fastify, qui nécessite une chaîne d'au moins 32 caractères. Si vous n'utilisez pas de chatbot intégré public avec protection, vous pouvez simplement supprimer le DB_SESSION_SECRETde votre fichier .env.

yes, I understand, but my chain is 32 characters long, so I used it:

https://www.avast.com/fr-ch/random-password-generator#pc

comeback01 commented 8 months ago

I removed DB_SESSION_SECRET but I still have a bug!

I stopped the container and edited -env

Attaching to dialoqbase, dialoqbase-postgres, redis dialoqbase | yarn run v1.22.19 dialoqbase | $ npx prisma migrate deploy && fastify start app.js dialoqbase | Prisma schema loaded from prisma/schema.prisma dialoqbase | Datasource "db": PostgreSQL database "dialoqbase", schema "public" at "dialoqbase-pg:5432" dialoqbase | dialoqbase | 15 migrations found in prisma/migrations dialoqbase | dialoqbase | dialoqbase | No pending migrations to apply. dialoqbase | npm notice dialoqbase | npm notice New major version of npm available! 9.8.1 -> 10.2.0 dialoqbase | npm notice Changelog: https://github.com/npm/cli/releases/tag/v10.2.0 dialoqbase | npm notice Run npm install -g npm@10.2.0 to update! dialoqbase | npm notice dialoqbase | WARNING: Session secret should be 32 characters long. dialoqbase | Connecting integration... dialoqbase | AssertionError [ERR_ASSERTION]: missing secret dialoqbase | at validateOptions (/app/node_modules/@fastify/jwt/jwt.js:62:3) dialoqbase | at fastifyJwt (/app/node_modules/@fastify/jwt/jwt.js:91:5) dialoqbase | at Plugin.exec (/app/node_modules/avvio/plugin.js:130:19) dialoqbase | at Boot.loadPlugin (/app/node_modules/avvio/plugin.js:272:10) dialoqbase | at process.processTicksAndRejections (node:internal/process/task_queues:82:21) { dialoqbase | generatedMessage: false, dialoqbase | code: 'ERR_ASSERTION', dialoqbase | actual: undefined, dialoqbase | expected: true, dialoqbase | operator: '==' dialoqbase | } dialoqbase | error Command failed with exit code 1. dialoqbase | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. dialoqbase | yarn run v1.22.19 dialoqbase | $ npx prisma migrate deploy && fastify start app.js dialoqbase | Prisma schema loaded from prisma/schema.prisma dialoqbase | Datasource "db": PostgreSQL database "dialoqbase", schema "public" at "dialoqbase-pg:5432" dialoqbase | dialoqbase | 15 migrations found in prisma/migrations dialoqbase | dialoqbase | dialoqbase | No pending migrations to apply. dialoqbase | WARNING: Session secret should be 32 characters long. dialoqbase | Connecting integration... dialoqbase | AssertionError [ERR_ASSERTION]: missing secret dialoqbase | at validateOptions (/app/node_modules/@fastify/jwt/jwt.js:62:3) dialoqbase | at fastifyJwt (/app/node_modules/@fastify/jwt/jwt.js:91:5) dialoqbase | at Plugin.exec (/app/node_modules/avvio/plugin.js:130:19) dialoqbase | at Boot.loadPlugin (/app/node_modules/avvio/plugin.js:272:10) dialoqbase | at process.processTicksAndRejections (node:internal/process/task_queues:82:21) { dialoqbase | generatedMessage: false, dialoqbase | code: 'ERR_ASSERTION', dialoqbase | actual: undefined, dialoqbase | expected: true, dialoqbase | operator: '==' dialoqbase | } dialoqbase | error Command failed with exit code 1. dialoqbase | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. dialoqbase | yarn run v1.22.19 dialoqbase | $ npx prisma migrate deploy && fastify start app.js dialoqbase-postgres | dialoqbase-postgres | PostgreSQL Database directory appears to contain a database; Skipping initialization dialoqbase-postgres | dialoqbase-postgres | 2023-10-15 18:18:09.202 UTC [1] LOG: starting PostgreSQL 15.4 (Debian 15.4-2.pgdg120+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit dialoqbase-postgres | 2023-10-15 18:18:09.202 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432 dialoqbase-postgres | 2023-10-15 18:18:09.202 UTC [1] LOG: listening on IPv6 address "::", port 5432 dialoqbase-postgres | 2023-10-15 18:18:09.204 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432" dialoqbase-postgres | 2023-10-15 18:18:09.210 UTC [29] LOG: database system was shut down at 2023-10-15 18:18:02 UTC dialoqbase-postgres | 2023-10-15 18:18:09.215 UTC [1] LOG: database system is ready to accept connections dialoqbase-postgres | 2023-10-15 18:18:14.413 UTC [37] LOG: could not receive data from client: Connection reset by peer redis | 1:C 15 Oct 2023 18:18:09.186 # WARNING Memory overcommit must be enabled! Without it, a background save or replication may fail under low memory condition. Being disabled, it can also cause failures without low memory condition, see https://github.com/jemalloc/jemalloc/issues/1328. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect. redis | 1:C 15 Oct 2023 18:18:09.187 oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo redis | 1:C 15 Oct 2023 18:18:09.187 Redis version=7.2.1, bits=64, commit=00000000, modified=0, pid=1, just started redis | 1:C 15 Oct 2023 18:18:09.187 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf redis | 1:M 15 Oct 2023 18:18:09.187 monotonic clock: POSIX clock_gettime redis | 1:M 15 Oct 2023 18:18:09.187 Running mode=standalone, port=6379. redis | 1:M 15 Oct 2023 18:18:09.187 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128. redis | 1:M 15 Oct 2023 18:18:09.188 Server initialized redis | 1:M 15 Oct 2023 18:18:09.188 Loading RDB produced by version 7.2.1 redis | 1:M 15 Oct 2023 18:18:09.188 RDB age 7 seconds redis | 1:M 15 Oct 2023 18:18:09.188 RDB memory usage when created 1.07 Mb redis | 1:M 15 Oct 2023 18:18:09.188 Done loading RDB, keys loaded: 1, keys expired: 0. redis | 1:M 15 Oct 2023 18:18:09.188 DB loaded from disk: 0.000 seconds redis | 1:M 15 Oct 2023 18:18:09.188 * Ready to accept connections tcp

n4ze3m commented 8 months ago

Hey, can you verify that your input secret length is 32 characters or more on this site? You can also generate a secured secret from this site: https://n4ze3m.com/dbtools.html

comeback01 commented 8 months ago

Hé, pouvez-vous vérifier que la longueur de votre secret d'entrée est de 32 caractères ou plus sur ce site ? Vous pouvez également générer un secret sécurisé depuis ce site : https://n4ze3m.com/dbtools.html look at my message above, I removed it, but it doesn't change anything

n4ze3m commented 8 months ago

Hey, you removed DB_SECRET_KEY instead of DB_SESSION_SECRET according to the logs

comeback01 commented 8 months ago

Thank you very much, I had the wrong line!

I wanted to make a payment, but I can't find the website?

I'll make a payment at the end of the month,

n4ze3m commented 8 months ago

Ah, it's okay! :)

I'll make a payment at the end of the month,

I've already mentioned that if you love the project, you can support it by donating via Ko-fi or the GitHub Sponsor tab :p As always, only donate if you like the project. Thanks!

luckrnx09 commented 8 months ago

Created a PR to fix this issue ☝️