You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When deploying logto using docker according to the official documentation, the container reports “timeout expired” and exits abnormally.
Expected behavior
Logto should start successfully and connect to the PostgreSQL database without timing out.
How to reproduce?
The problem started when I wanted to deploy logto via 1panel, and the problem occurred after doing so by default. The container log reported the following error:
> cli
> logto db seed --swe
- Create tables
info ✔ Create tables
info ✔ [default] Generated config oidc.privateKeys
info ✔ [default] Generated config oidc.cookieKeys
info ✔ [default] Seed OIDC config
info ✔ [admin] Generated config oidc.privateKeys
info ✔ [admin] Generated config oidc.cookieKeys
info ✔ [admin] Seed OIDC config
info ✔ Cloud Service Application successfully created for: default
info ✔ Created machine-to-machine applications for Management API proxy
info ✔ Initialized tenant organization template
info ✔ Assigned the proxy roles to the applications
info ✔ Created tenant organizations
info ✔ Seed data
npm notice
npm notice New minor version of npm available! 10.8.2 -> 10.9.2
npm notice Changelog: https://github.com/npm/cli/releases/tag/v10.9.2
npm notice To update run: npm install -g [email protected]
npm notice
> start
> cd packages/core && NODE_ENV=production node .
(node:44) ExperimentalWarning: Importing JSON modules is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
index error Error while initializing app:
index error Error: timeout expired
at Timeout._onTimeout (/etc/logto/node_modules/.pnpm/[email protected]/node_modules/pg/lib/client.js:106:28)
at listOnTimeout (node:internal/timers:581:17)
at process.processTimers (node:internal/timers:519:7)
After this, I tried to re-deploy according to the official documentation. I tried deploying via docker, deploying via docker-compose, and deploying via npm-init, but the same problem happened in all three cases. I even tried different versions of the database, including pgSQL14, pgSQL16 and pgSQL17 containers, but none of them worked and the same problem happened again.
I then tried the solution provided by others in #6748, but it still didn't work. I also checked #6187 and PR #6674, but I don't seem to understand them very well.
Up to this point, I had exhausted everything I could think of, but the problem remained unsolved.
Context
Logto Cloud
Self-hosted, Logto version = 1.22.0
Container (Docker image)
Raw Node.js
The text was updated successfully, but these errors were encountered:
Hi. I think you actually found the answer yourself. We've had several similar cases before and it was due to a low connection speed between the web application / CLI client / 1panel platform and the postgres DB, as by default we have the DB connection timeout set to 5000ms.
Therefore, try to set a bigger timeout value by specifying the DATABASE_CONNECTION_TIMEOUT env variable when deploying Logto.
Hi @charIeszhao , thank you for your help. The problem has been solved.
After trying, the problem was solved when the value of DATABASE_CONNECTION_TIMEOUT was set to 30000. And for those who are experiencing the same problem after using the 1panel to deploy “one-click”, this method can be used to resolve the issue.
This issue can be closed now.
Describe the bug
When deploying logto using docker according to the official documentation, the container reports “timeout expired” and exits abnormally.
Expected behavior
Logto should start successfully and connect to the PostgreSQL database without timing out.
How to reproduce?
The problem started when I wanted to deploy logto via 1panel, and the problem occurred after doing so by default. The container log reported the following error:
After this, I tried to re-deploy according to the official documentation. I tried deploying via docker, deploying via docker-compose, and deploying via npm-init, but the same problem happened in all three cases. I even tried different versions of the database, including pgSQL14, pgSQL16 and pgSQL17 containers, but none of them worked and the same problem happened again.
I then tried the solution provided by others in #6748, but it still didn't work. I also checked #6187 and PR #6674, but I don't seem to understand them very well.
Up to this point, I had exhausted everything I could think of, but the problem remained unsolved.
Context
The text was updated successfully, but these errors were encountered: