Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] 启动时卡在用户状态初始化 #6569

Closed
Yastruhank opened this issue Feb 27, 2025 · 13 comments
Closed

[Bug] 启动时卡在用户状态初始化 #6569

Yastruhank opened this issue Feb 27, 2025 · 13 comments
Labels
🐛 Bug Something isn't working | 缺陷

Comments

@Yastruhank
Copy link

📦 Platform

Self hosting Docker

📦 Deploymenet mode

server db(lobe-chat-database image)

📌 Version

1.66.1

💻 Operating System

Ubuntu

🌐 Browser

Chrome

🐛 Bug Description

使用Docker部署的database版本,使用next-auth进行身份认证,在登陆后再次打开页面会一直卡在 用户状态初始化...

之前一直正常,在某次更新后出现的,一直有打开自动更新,这一周以来的更新都没有解决这个问题

在卡在用户状态初始化...时,浏览器控制台会出现以下报错:

webpack-0734839ebecdad7f.js:1 
GET https://chat.****.cn/_next/static/chunks/63765.3c7b2c9a74c93514.js net::ERR_ABORTED 404 (Not Found)

服务器的环境变量配置信息如下(敏感信息用*代替)

# 网站域名
APP_URL=https://chat.****.cn

# DB 必须的环境变量
# 用于加密敏感信息的密钥,可以使用 openssl rand -base64 32 生成
KEY_VAULTS_SECRET='*******'
# Postgres 数据库连接字符串
# 格式:postgres://username:password@host:port/dbname,如果你的 pg 实例为 Docker 容器,请使用容器名
DATABASE_URL=postgres://postgres:*******@postgres:5432/postgres

GOOGLE_ANALYTICS_MEASUREMENT_ID=G-*******

# NEXT_AUTH 相关,可以使用 auth0、Azure AD、GitHub、Authentik、zitadel 等,如有其他接入诉求欢迎提 PR
NEXT_PUBLIC_ENABLE_NEXT_AUTH=1
NEXT_AUTH_SECRET=*******
NEXT_AUTH_SSO_PROVIDERS=github,microsoft-entra-id
NEXTAUTH_URL=https://chat.****.cn/api/auth
AUTH_GITHUB_ID=*******
AUTH_GITHUB_SECRET=*******
AUTH_MICROSOFT_ENTRA_ID_ID=*******
AUTH_MICROSOFT_ENTRA_ID_SECRET=*******
AUTH_MICROSOFT_ENTRA_ID_TENANT_ID=*******

# S3 相关
S3_ACCESS_KEY_ID=*******
S3_SECRET_ACCESS_KEY=*******
# 用于 S3 API 访问的域名
S3_ENDPOINT=https://****.r2.cloudflarestorage.com
S3_BUCKET=lobehub-*
# 用于外网访问 S3 的公共域名,需配置 CORS
S3_PUBLIC_DOMAIN=https://lobehub-s3.****.cn
# S3_REGION=ap-chengdu # 如果需要指定地域

SEARXNG_URL=http://127.0.0.1:5676

📷 Recurrence Steps

未登录和首次登陆都不会出现,在登陆后再次访问网址稳定复现

🚦 Expected Behavior

No response

📝 Additional Information

No response

@Yastruhank Yastruhank added the 🐛 Bug Something isn't working | 缺陷 label Feb 27, 2025
@github-project-automation github-project-automation bot moved this to Roadmap - Chat 1.x in Lobe Chat Routine Feb 27, 2025
@lobehubbot
Copy link
Member

👀 @Yastruhank

Thank you for raising an issue. We will investigate into the matter and get back to you as soon as possible.
Please make sure you have given us as much context as possible.
非常感谢您提交 issue。我们会尽快调查此事,并尽快回复您。 请确保您已经提供了尽可能多的背景信息。

Copy link

dosubot bot commented Feb 27, 2025

Hello @Yastruhank! I'm here to help you with your bug report. I can assist you with solving bugs, answering questions, and becoming a contributor.

I found a similar unsolved discussion regarding a bug when using Docker for advanced deployment, where a login prompt appears unexpectedly [1].

For your issue, the error message indicates a 404 error for a static chunk file, which might be related to how static files are served or updated in your deployment. Although I couldn't find specific information on handling static file requests in lobe-chat, here are a few things you might consider checking:

  1. Static File Serving: Ensure that your Docker setup correctly serves static files. Verify that the paths to these files are correctly configured and accessible.

  2. Environment Variables: Double-check your environment variables, especially those related to NEXTAUTH_URL and static file paths, to ensure they are correctly set up for your deployment environment.

  3. NextAuth Configuration: Since you're using NextAuth, ensure that all related configurations and secrets are correctly set. The NEXTAUTH_URL should match your deployment URL to handle authentication callbacks properly [2].

  4. Version Updates: Since the issue appeared after an update, consider reviewing the recent changes in the repository that might affect authentication or static file handling [3].

If these steps don't resolve the issue, you might want to explore the server logs for more detailed error messages or consider rolling back to a previous version to identify the specific update causing the problem.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@arvinxx
Copy link
Contributor

arvinxx commented Feb 27, 2025

@Yastruhank 尝试清理下服务端的网关缓存

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


@Yastruhank Try to clean the gateway cache on the server

@Yastruhank
Copy link
Author

@Yastruhank 尝试清理下服务端的网关缓存

我使用 sudo systemctl restart NetworkManager 重启了服务器的网络服务,好像还是不行

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


@Yastruhank Try to clean up the gateway cache on the server

I restarted the server's network service using sudo systemctl restart NetworkManager, but it still doesn't work.

@arvinxx
Copy link
Contributor

arvinxx commented Feb 27, 2025

不是,你用的网关,比如 Nginx 等清理它的缓存

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


No, the gateway you use, such as Nginx, to clean its cache

@Yastruhank
Copy link
Author

问题解决了,宝塔面板的Nginx反向代理设置中的关闭缓存是没有用的,必须注释nginx全局配置中的一行才能生效。
这个Bug 2022年就有人提出了,宝塔现在还没修
Ref: 【疑难】宝塔nginx反代缓存问题-问题没有解决!

@github-project-automation github-project-automation bot moved this from Roadmap - Chat 1.x to Done in Lobe Chat Routine Feb 28, 2025
@lobehubbot
Copy link
Member

@Yastruhank

This issue is closed, If you have any questions, you can comment and reply.
此问题已经关闭。如果您有任何问题,可以留言并回复。

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


The problem was solved. Turning off cache in the Nginx reverse proxy settings of the Baota panel is useless. One line in the nginx global configuration must be commented to take effect.
This bug was proposed in 2022, and the pagoda has not been repaired yet
Ref: [Difficult] Baota nginx anti-generation cache problem - the problem has not been solved!

@ImcwjHere
Copy link

问题解决了,宝塔面板的Nginx反向代理设置中的关闭缓存是没有用的,必须注释nginx全局配置中的一行才能生效。 这个Bug 2022年就有人提出了,宝塔现在还没修 Ref: 【疑难】宝塔nginx反代缓存问题-问题没有解决!

LobeChat不知道哪个版本开始出现卡在“应用启动中...”状态,无法进入主页,按此方法已解决,有用👍

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


The problem was solved. Turning off cache in the Nginx reverse proxy settings of the Baota panel is useless. One line in the nginx global configuration must be commented to take effect. This bug was raised in 2022, and the pagoda has not been repaired yet. Ref: [Difficult] The pagoda nginx anti-generation cache problem - the problem has not been solved!

LobeChat doesn't know which version starts to appear stuck in the "Application Starting..." state and cannot enter the home page. This method has been solved, useful 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Something isn't working | 缺陷
Projects
Status: Done
Development

No branches or pull requests

4 participants