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] The error returned to user is not detailed enough when getting OpenAIBizError #465

Closed
skyf0cker opened this issue Nov 16, 2023 · 6 comments · Fixed by #469
Closed
Assignees
Labels
🐛 Bug Something isn't working | 缺陷 released 👷🏻‍♂️ Working On You are right, I should do that | 处理中

Comments

@skyf0cker
Copy link
Contributor

💻 系统环境 | Operating System

macOS

🌐 浏览器 | Browser

Chrome

🐛 问题描述 | Bug Description

Since this morning, the Lobe-Chat deployed on Vercel suddenly stopped working. When chatting, the frontend threw an error: "请求 OpenAI 服务出错,请根据以下信息排查或重试" The error message only included the endpoint without any details, and from the Vercel logs, I could only see a 577 error status code. All these indicate that the OpenAI interface was reporting an error, but I couldn't determine the specific reason, which led to the inability to resolve the issue.

Finally, in another Telegram group chat, I heard that the problem was due to API regional restrictions causing the API to fail. I briefly looked at the code, but I still don't understand it very well. Intuitively, I think the error message should be more comprehensive, including the error information of the OpenAI interface, HTTP status codes, and so on.

image

// Check if the error is an OpenAI APIError
if (error instanceof OpenAI.APIError) {
return createErrorResponse(ChatErrorType.OpenAIBizError, {
endpoint: openai.baseURL,
error: error.error ?? error.cause,
});

🚦 期望结果 | Expected Behavior

Intuitively, I think the error message should be more comprehensive, including the error information of the OpenAI interface, HTTP status codes, and so on.

📷 复现步骤 | Recurrence Steps

No response

📝 补充信息 | Additional Information

No response

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

👀 @skyf0cker

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。我们会尽快调查此事,并尽快回复您。 请确保您已经提供了尽可能多的背景信息。

@skyf0cker skyf0cker changed the title [Bug] The error returned to user when getting OpenAIBizError [Bug] The error returned to user is not detailed enough when getting OpenAIBizError Nov 16, 2023
@arvinxx
Copy link
Contributor

arvinxx commented Nov 16, 2023

you are right. we should add more info when meet this error.

@arvinxx
Copy link
Contributor

arvinxx commented Nov 16, 2023

By the way, why your message shows Chinese other than English? Do you use Chinese?

@skyf0cker
Copy link
Contributor Author

Yep, i'm a Chinese native speaker, but used to communicate in English on gh

@arvinxx arvinxx self-assigned this Nov 17, 2023
@arvinxx arvinxx added the 👷🏻‍♂️ Working On You are right, I should do that | 处理中 label Nov 17, 2023
@github-project-automation github-project-automation bot moved this from Roadmap - Chat 1.x to Done in Lobe Chat Routine Nov 17, 2023
@lobehubbot
Copy link
Member

@skyf0cker

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

@lobehubbot
Copy link
Member

🎉 This issue has been resolved in version 0.101.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Something isn't working | 缺陷 released 👷🏻‍♂️ Working On You are right, I should do that | 处理中
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants