Error before answer is fully generated #3708
-
What happened?Hi! I am using LibreChat v0.7.4 to talk to a GPT-4o backend hosted at
After some time, the answer is then completely replaced with the following error:
Looking at the code in the stack trace, the error seems to be originating from the underlying OpenAI client library, but I cannot pinpoint where exactly this goes wrong. My librechat.yml currently looks like this:
Any pointers on how to debug this further would be very appreciated. Steps to Reproduce
What browsers are you seeing the problem on?Firefox Relevant log output[
{
"level": "warn",
"message": "[OpenAIClient.chatCompletion][stream] Unhandled error type",
"timestamp": "2024-08-19T14:02:33.443Z"
},
{
"level": "warn",
"message": "[OpenAIClient.chatCompletion][finalChatCompletion] Unhandled error type",
"timestamp": "2024-08-19T14:02:34.177Z"
},
{
"level": "error",
"message": "[OpenAIClient.chatCompletion] Unhandled error type Error: Cannot read properties of undefined (reading 'content')",
"stack": "Error: Error: Cannot read properties of undefined (reading 'content')\n at OpenAIClient.chatCompletion (/app/api/app/clients/OpenAIClient.js: 1260: 15)\n at async OpenAIClient.sendCompletion (/app/api/app/clients/OpenAIClient.js: 634: 15)\n at async OpenAIClient.sendMessage (/app/api/app/clients/BaseClient.js: 515: 24)\n at async AskController (/app/api/server/controllers/AskController.js: 125: 20)\n at async /app/api/server/routes/ask/openAI.js: 24: 5",
"timestamp": "2024-08-19T14: 02: 34.177Z"
},
{
"level": "error",
"message": "[handleAbortError] AI response error; aborting request: Error: Cannot read properties of undefined (reading 'content')",
"stack": "Error: Error: Cannot read properties of undefined (reading 'content')\n at OpenAIClient.chatCompletion (/app/api/app/clients/OpenAIClient.js: 1260: 15)\n at async OpenAIClient.sendCompletion (/app/api/app/clients/OpenAIClient.js: 634: 15)\n at async OpenAIClient.sendMessage (/app/api/app/clients/BaseClient.js: 515: 24)\n at async AskController (/app/api/server/controllers/AskController.js: 125: 20)\n at async /app/api/server/routes/ask/openAI.js: 24: 5",
"timestamp": "2024-08-19T14: 02: 34.178Z"
},
{
"code": "ERR_HTTP_HEADERS_SENT",
"level": "error",
"message": "[handleAbortError] error while trying to abort message Cannot set headers after they are sent to the client",
"stack": "Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client\n at ServerRes ponse.setHeader (node:_http_outgoing: 659: 11)\n at ServerResponse.header (/app/api/node_modules/express/lib/response.js: 795: 10)\n at S erverResponse.send (/app/api/node_modules/express/lib/response.js: 175: 12)\n at ServerResponse.json (/app/api/node_modules/express/lib/re sponse.js: 279: 15)\n at ServerResponse.send (/app/api/node_modules/express/lib/response.js: 163: 21)\n at abortMessage (/app/api/server/ middleware/abortMiddleware.js: 30: 28)\n at handleAbortError (/app/api/server/middleware/abortMiddleware.js: 205: 20)\n at AskController (/app/api/server/controllers/AskController.js: 175: 5)\n at async /app/api/server/routes/ask/openAI.js: 24: 5",
"timestamp": "2024-08-19T14: 02 : 34.179Z"
}
] ScreenshotsNo response Code of Conduct
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 14 replies
-
An AI response error is usually an upstream API error. thanks for the logs, seems like azure is triggering the initial error and then it cascades into several other errors in the server. I will look into this |
Beta Was this translation helpful? Give feedback.
I improved the error handling here, can you try it once it's merged?
#3710