logto-io / logto

🧑‍🚀 The better identity infrastructure for developers and the open-source alternative to Auth0.
https://logto.io
Mozilla Public License 2.0
8.63k stars 438 forks source link

bug: Docker Compose can not work #6652

Open wyl2003 opened 2 weeks ago

wyl2003 commented 2 weeks ago

Describe the bug

The service cannot be started using docker-compose.yml, the logto container has an error and exits

Expected behavior

Successfully run logto locally

How to reproduce?

In the 1Panel server management panel, create an compose, copy the docker-compose.yml file on the web page, fill it in, and click Confirm to run. After two containers are successfully run, the logto container stops running and the following error appears in the log


> cli
> logto db seed --swe

info ✔ Created database logto
- 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.0
npm notice Changelog: https://github.com/npm/cli/releases/tag/v10.9.0
npm notice To update run: npm install -g npm@10.9.0
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/pg@8.11.3/node_modules/pg/lib/client.js:106:28)
    at listOnTimeout (node:internal/timers:581:17)
    at process.processTimers (node:internal/timers:519:7)

Context

Screenshots

image
charIeszhao commented 1 week ago

It seems you have a DB connection timeout. And this PR (https://github.com/logto-io/logto/pull/6674) might potentially solve it by letting you override the default DB timeout (5s).