为什么页面setup一直是loading状态 #4343
Unanswered
caixukungg
asked this question in
Q&A
Replies: 1 comment 1 reply
|
直接原因 setup 页面(frontend/src/app/(auth)/setup/page.tsx)初始处于 mode = "loading",会一直显示 "Loading…",直到浏览器发出的 GET /api/v1/auth/setup-status 请求返回。而这个客户端请求(frontend/src/core/auth/setup.ts::fetchSetupStatus)没有设置任何超时——只要后端不返回、也不报错,页面就会永远卡在 loading。 关键的不对称(这就是为什么会"卡住"而不是跳走) 同一条 setup-status 接口被调用了两次,超时策略不同:
也就是说:只要 Gateway 在监听端口(能 accept 连接)但接口内部卡住,5 秒后页面会渲染出来,然后客户端请求一直 pending → 永远 loading。这也是为什么你看到的是页面的 "Loading…",而不是 "Service temporarily unavailable"(后者意味着 Gateway 完全连不上)。 接口为什么会卡住 /api/v1/auth/setup-status(backend/app/gateway/routers/auth.py:464)最终要执行 get_local_provider().count_admin_users()——一个查数据库的调用。它卡住几乎都是因为数据库 / 认证 Provider 还没就绪,最常见于:
如何定位(按顺序)
常见修复
|
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
为什么页面setup一直是loading状态
All reactions