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] 配置PROXY_URL后页面持续报错 #5334

Open
ww-xb opened this issue Jan 8, 2025 · 3 comments
Open

[Bug] 配置PROXY_URL后页面持续报错 #5334

ww-xb opened this issue Jan 8, 2025 · 3 comments
Labels
🐛 Bug Something isn't working | 缺陷

Comments

@ww-xb
Copy link

ww-xb commented Jan 8, 2025

📦 部署环境

Docker

📌 软件版本

lobehub/lobe-chat-database:v1.44.0

💻 系统环境

Ubuntu

🌐 浏览器

Edge

🐛 问题描述

配置PROXY_URL后服务持续报错,页面打不开, 去掉后恢复正常,日志如下:

2025/01/08 11:21AM 30 | pid=28 hostname=508eb8ee8d51 msg=Error in tRPC handler (lambda) on path: aiProvider.getAiProviderRuntimeState, type: query 
Error [TRPCError]: Connection terminated unexpectedly
    at async (.next/server/chunks/14847.js:17:13034)
    at async d.getAiProviderRuntimeConfig (.next/server/chunks/45485.js:3:3086)
    at async (.next/server/chunks/45485.js:3:19318)
    at async a.middlewares (.next/server/chunks/47885.js:1:5569)
    at async f (.next/server/chunks/47885.js:4:68)
    at async f (.next/server/chunks/47885.js:4:68)
    at async f (.next/server/chunks/47885.js:4:68)
    at async f (.next/server/chunks/47885.js:4:68) {
  code: 'INTERNAL_SERVER_ERROR',
  [cause]: Error: Connection terminated unexpectedly
      at async (.next/server/chunks/14847.js:17:13034)
      at async d.getAiProviderRuntimeConfig (.next/server/chunks/45485.js:3:3086)
      at async (.next/server/chunks/45485.js:3:19318)
      at async a.middlewares (.next/server/chunks/47885.js:1:5569)
      at async f (.next/server/chunks/47885.js:4:68)
      at async f (.next/server/chunks/47885.js:4:68)
      at async f (.next/server/chunks/47885.js:4:68)
      at async f (.next/server/chunks/47885.js:4:68)
}
2025/01/08 11:21AM 30 | pid=28 hostname=508eb8ee8d51 msg=Error in tRPC handler (lambda) on path: user.getUserState, type: query 

启动命令:

docker run -d --name lobe-chat --restart=always \
    -e APP_URL="http://10.10.10.7:3210" \
    -e NEXT_AUTH_SSO_PROVIDERS=casdoor \
    -e KEY_VAULTS_SECRET=p*****************= \
    -e NEXT_AUTH_SECRET=p*****************= \
    -e AUTH_URL="http://10.10.10.7:3210/api/auth" \
    -e AUTH_CASDOOR_ISSUER="http://10.10.10.7:8000/" \
    -e DATABASE_URL="postgresql://postgres:*****************@10.10.10.7:5432/lobechat" \
    -e S3_ENDPOINT="http://10.10.10.7:9100" \
    -e S3_BUCKET=lobe \
    -e S3_PUBLIC_DOMAIN="http://10.10.10.7:9100" \
    -e S3_ENABLE_PATH_STYLE=1 \
    -e LLM_VISION_IMAGE_USE_BASE64=1 \
    -e AUTH_CASDOOR_ID=a*****************9 \
    -e AUTH_CASDOOR_SECRET=d*****************4 \
    -e QWEN_API_KEY=sk-***************** -e GOOGLE_API_KEY=A*****************Q \
    -e PROXY_URL=http://10.10.10.7:7890 \
    -p 3210:3210 \
    lobehub/lobe-chat-database

📷 复现步骤

No response

🚦 期望结果

No response

📝 补充信息

我要使用Google Gemini API,配置PROXY_URL后服务起不来 配置HTTP_PROXY和HTTPS_PROXY又不起作用

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

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


📦 Deployment environment

Docker

📌 Software version

lobehub/lobe-chat-database:v1.44.0

💻 System environment

Ubuntu

🌐 Browser

Edge

🐛 Problem description

After configuring PROXY_URL, the service continued to report errors and the page could not be opened. After removing it, it returned to normal. The log is as follows:
2025/01/08 11:21AM 30 | pid=28 hostname=508eb8ee8d51 msg=Error in tRPC handler (lambda) on path: aiProvider.getAiProviderRuntimeState, type: query Error [TRPCError]: Connection terminated unexpectedly at async (.next/server/chunks/14847.js:17:13034) at async d.getAiProviderRuntimeConfig (.next/server/chunks/45485.js:3:3086) at async (.next/server/chunks/45485.js:3:19318) at async a.middlewares (.next/server/chunks/47885.js:1:5569) at async f (.next/server/chunks/47885.js:4:68) at async f (.next/server/chunks/47885.js:4:68) at async f (.next/server/chunks/47885.js:4:68) at async f (.next/server/chunks/47885.js:4:68) { code: 'INTERNAL_SERVER_ERROR', [cause]: Error: Connection terminated unexpectedly at async (.next/server/chunks/14847.js:17:13034) at async d.getAiProviderRuntimeConfig (.next/server/chunks/45485.js:3:3086) at async (.next/server/chunks/45485.js:3:19318) at async a.middlewares (.next/server/chunks/47885.js:1:5569) at async f (.next/server/chunks/47885.js:4:68) at async f (.next/server/chunks/47885.js:4:68) at async f (.next/server/chunks/47885.js:4:68) at async f (.next/server/chunks/47885.js:4:68) } 2025/01/08 11:21AM 30 | pid=28 hostname=508eb8ee8d51 msg=Error in tRPC handler (lambda) on path: user.getUserState, type: query

Start command:
docker run -d --name lobe-chat --restart=always \ -e APP_URL="http://10.10.10.7:3210" \ -e NEXT_AUTH_SSO_PROVIDERS=casdoor \ -e KEY_VAULTS_SECRET=p******************= \ -e NEXT_AUTH_SECRET=p******************= \ -e AUTH_URL="http://10.10.10.7:3210/api/auth" \ -e AUTH_CASDOOR_ISSUER="http://10.10.10.7:8000/" \ -e DATABASE_URL="postgresql://postgres:******************@10.10.10.7:5432/lobechat" \ -e S3_ENDPOINT="http://10.10.10.7:9100" \ -e S3_BUCKET=lobe \ -e S3_PUBLIC_DOMAIN="http://10.10.10.7:9100" \ -e S3_ENABLE_PATH_STYLE=1 \ -e LLM_VISION_IMAGE_USE_BASE64=1 \ -e AUTH_CASDOOR_ID=a************************9 \ -e AUTH_CASDOOR_SECRET=d**********************4 \ -e QWEN_API_KEY=sk-************************ -e GOOGLE_API_KEY=A************************Q \ -e PROXY_URL=http://10.10.10.7:7890 \ -p 3210:3210 \ lobehub/lobe-chat-database

📷 Steps to reproduce

No response

🚦 Expected results

No response

📝 Supplementary information

I want to use Google Gemini API. After configuring PROXY_URL, the service cannot be started. Configuring HTTP_PROXY and HTTPS_PROXY does not work.

@lobehubbot
Copy link
Member

👀 @ww-xb

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 Jan 8, 2025

@ww-xb 你好,我是Dosu,一个可以帮助你解决bug,回答问题,并成为贡献者的机器人。我在这里帮你解决问题,等待人类维护者的到来。

The issue you're experiencing with the PROXY_URL causing errors in the Lobe Chat application is a known limitation. Configuring an HTTP proxy URL can lead to errors such as 'Connection terminated unexpectedly' and make the application inaccessible. This issue can occur even after Docker restarts and when using different access methods. Removing the proxy URL configuration typically resolves the issue [1].

Additionally, when using Docker, remember that localhost or 127.0.0.1 refers to the container's localhost. If you're on Docker Desktop for Windows or macOS, try using host.docker.internal instead of localhost to address connectivity issues related to the proxy configuration [1].

For using the Google Gemini API, ensure that your API key is correctly configured in the Lobe Chat settings. If HTTP_PROXY and HTTPS_PROXY are not working, double-check their configurations and ensure they are set correctly in your environment variables [2][3].

To continue talking to Dosu, mention @dosu.


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

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: Roadmap - Chat 1.x
Development

No branches or pull requests

2 participants