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.73k stars 438 forks source link

bug: cannot register at beginning #6601

Closed SLKun closed 1 month ago

SLKun commented 1 month ago

Describe the bug

I follow the document to start logto through docker compose.

curl -fsSL https://raw.githubusercontent.com/logto-io/logto/HEAD/docker-compose.yml | docker compose -p logto -f - up

However, when I submitted the password for the first-time user registration, the WEB prompted an internal server error.

Server logs as follows:

app-1       | j0MClN6QZzgaK8Bh   <-- PUT /api/interaction
app-1       | j0MClN6QZzgaK8Bh   --> PUT /api/interaction 204 137ms 
app-1       | -Mg1iycslyjUaR8n   <-- POST /api/interaction/submit
app-1       | -Mg1iycslyjUaR8n   --> POST /api/interaction/submit 422 25ms 134b
app-1       | RIOerGxDwjyWQuh6   <-- PATCH /api/interaction/profile
app-1       | RIOerGxDwjyWQuh6 error TypeError: fetch failed
app-1       |     at node:internal/deps/undici/undici:13178:13
app-1       |     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
app-1       |     at async PasswordPolicyChecker.hasBeenPwned (file:///etc/logto/packages/toolkit/core-kit/lib/password-policy.js:226:26)
app-1       |     at async PasswordPolicyChecker.check (file:///etc/logto/packages/toolkit/core-kit/lib/password-policy.js:97:43)
app-1       |     at async validatePassword (file:///etc/logto/packages/core/build/main-F72FFTZD.js:15982:18)
app-1       |     at async file:///etc/logto/packages/core/build/main-F72FFTZD.js:16164:7
app-1       |     at async guardMiddleware (file:///etc/logto/packages/core/build/main-F72FFTZD.js:4420:7)
app-1       |     at async file:///etc/logto/packages/core/build/main-F72FFTZD.js:2075:7
app-1       |     at async file:///etc/logto/packages/core/build/main-F72FFTZD.js:2106:5
app-1       |     at async cors (/etc/logto/node_modules/.pnpm/@koa+cors@5.0.0/node_modules/@koa/cors/index.js:64:16)
app-1       |     at async /etc/logto/node_modules/.pnpm/koa-mount@4.0.0/node_modules/koa-mount/index.js:58:5
app-1       |     at async /etc/logto/node_modules/.pnpm/koa-mount@4.0.0/node_modules/koa-mount/index.js:52:26
app-1       |     at async compressMiddleware (/etc/logto/node_modules/.pnpm/koa-compress@5.1.1/node_modules/koa-compress/lib/index.js:56:5)
app-1       |     at async file:///etc/logto/packages/core/build/main-F72FFTZD.js:743:7
app-1       |     at async file:///etc/logto/packages/core/build/main-F72FFTZD.js:1229:7
app-1       |     at async file:///etc/logto/packages/core/build/main-F72FFTZD.js:1072:7 {
app-1       |   [cause]: AggregateError [ETIMEDOUT]: 
app-1       |       at internalConnectMultiple (node:net:1118:18)
app-1       |       at internalConnectMultiple (node:net:1186:5)
app-1       |       at Timeout.internalConnectMultipleTimeout (node:net:1712:5)
app-1       |       at listOnTimeout (node:internal/timers:583:11)
app-1       |       at process.processTimers (node:internal/timers:519:7) {
app-1       |     code: 'ETIMEDOUT',
app-1       |     [errors]: [ [Error], [Error], [Error], [Error] ]
app-1       |   }
app-1       | }
app-1       | RIOerGxDwjyWQuh6   --> PATCH /api/interaction/profile 500 820ms 36b

I have tested different versions from latest to 1.10, the newest version that can register normally is 1.12.

Expected behavior

I can register successfully.

How to reproduce?

Just run follow command:

curl -fsSL https://raw.githubusercontent.com/logto-io/logto/HEAD/docker-compose.yml | docker compose -p logto -f - up

Context

image

charIeszhao commented 1 month ago

Related issues: #6577 #6582

alwqx commented 1 month ago

@SLKun Hi, I face the same problem and follow steps in https://github.com/logto-io/logto/issues/6577#issuecomment-2359921567 successfully register

update sign_in_experiences set password_policy='{"rejects": {"pwned": false}}' where tenant_id='admin';