"Error 500 when adding messages to a thread: Issue with Axios and OpenAI API

Hi OpenAI Support,

Since September 1, 2024, my system has been experiencing issues when attempting to add messages to a thread using the OpenAI API. Previously, everything was working smoothly, but now I consistently receive a 500 error. Below are the details and logs associated with the problem:

Problem Description:
The error occurs when I attempt to add messages to an existing thread using Axios in a Node.js environment. The system tries to add messages to the thread multiple times, but each attempt results in a server error.

Here is a sample of the logs:

14:17:57 0|app  | Adding message to thread thread_Pieyusl2Bc7xYEX7G1dM0Qtr... (Attempt 2)
14:17:58 0|app  | Error adding message: {
14:17:58 0|app  |   error: {
14:17:58 0|app  |     message: 'The server had an error processing your request. Sorry about that! You can retry your request, or contact us through our help center at help.openai.com if you keep seeing this error. (Please include the request ID req_e390b90e5f2b43d3d08b9e5087eec46c in your email.)',
14:17:58 0|app  |     type: 'server_error',
14:17:58 0|app  |     param: null,
14:17:58 0|app  |     code: null
14:17:58 0|app  |   }
14:17:58 0|app  | }
14:17:58 0|app  | Retrying in 10 seconds... (Attempt 3 of 3)
14:18:08 0|app  | Error adding message: {
14:18:08 0|app  |   error: {
14:18:08 0|app  |     message: 'The server had an error processing your request. Sorry about that! You can retry your request, or contact us through our help center at help.openai.com if you keep seeing this error. (Please include the request ID req_23e8385b124d07bb896f93e61b37cca8 in your email.)',
14:18:08 0|app  |     type: 'server_error',
14:18:08 0|app  |     param: null,
14:18:08 0|app  |     code: null
14:18:08 0|app  |   }
14:18:08 0|app  | }
14:18:08 0|app  | Error processing transcription: AxiosError: Request failed with status code 500
14:18:08 0|app  |     at settle (/usr/src/node-app/node_modules/axios/dist/node/axios.cjs:2019:12)
14:18:08 0|app  |     at IncomingMessage.handleStreamEnd (/usr/src/node-app/node_modules/axios/dist/node/axios.cjs:3135:11)
14:18:08 0|app  |     at IncomingMessage.emit (node:events:532:35)
14:18:08 0|app  |     at endReadableNT (node:internal/streams/readable:1696:12)
14:18:08 0|app  |     at process.processTicksAndRejections (node:internal/process/task_queues:90:21)
14:18:08 0|app  |     at Axios.request (/usr/src/node-app/node_modules/axios/dist/node/axios.cjs:4287:41)
14:18:08 0|app  |     at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
14:18:08 0|app  |     at async processTranscription (/usr/src/node-app/src/subscribers/nplQueueSubscriber.js:364:9)
14:18:08 0|app  |     at async handleMessages (/usr/src/node-app/src/subscribers/nplQueueSubscriber.js:90:35) {
14:18:08 0|app  |   code: 'ERR_BAD_RESPONSE',
14:18:08 0|app  |   config: {
14:18:08 0|app  |     method: 'post',
14:18:08 0|app  |     url: 'https://api.openai.com/v1/threads/thread_Pieyusl2Bc7xYEX7G1dM0Qtr/messages',
14:18:08 0|app  |     data: '{"role":"user","content":[{"type":"text","text":"<message content>"}]}'
14:18:08 0|app  |   },
14:18:08 0|app  |   request: <ref *1> ClientRequest {
14:18:08 0|app  |     _events: [Object: null prototype] {
14:18:08 0|app  |       abort: [Function (anonymous)],
14:18:08 0|app  |       aborted: [Function (anonymous)],
14:18:08 0|app  |       connect: [Function (anonymous)],
14:18:08 0|app  |       error: [Function (anonymous)],
14:18:08 0|app  |       socket: [Function (anonymous)],
14:18:08 0|app  |       timeout: [Function (anonymous)],
14:18:08 0|app  |       finish: [Function: requestOnFinish]
14:18:08 0|app  |     },
14:18:08 0|app  |     _eventsCount: 7,
14:18:08 0|app  |     _maxListeners: undefined,
14:18:08 0|app  |     outputData: [],
14:18:08 0|app  |     outputSize: 0,
14:18:08 0|app  |     writable: true,
14:18:08 0|app  |     destroyed: true,
14:18:08 0|app  |     _last: false,
14:18:08 0|app  |     chunkedEncoding: false,
14:18:08 0|app  |     shouldKeepAlive: true,
14:18:08 0|app  |     maxRequestsOnConnectionReached: false,
14:18:08 0|app  |     _defaultKeepAlive: true,
14:18:08 0|app  |     useChunkedEncodingByDefault: true,
14:18:08 0|app  |     sendDate: false,
14:18:08 0|app  |     _removedConnection: false,
14:18:08 0|app  |     _removedContLen: false,
14:18:08 0|app  |     _removedTE: false,
14:18:08 0|app  |     strictContentLength: false,
14:18:08 0|app  |     _contentLength: '4871',
14:18:08 0|app  |     _hasBody: true,
14:18:08 0|app  |     _trailer: '',
14:18:08 0|app  |     finished: true,
14:18:08 0|app  |     _headerSent: true,
14:18:08 0|app  |     _closed: true,
14:18:08 0|app  |     _header: 'POST /v1/threads/thread_Pieyusl2Bc7xYEX7G1dM0Qtr/messages HTTP/1.1\r\n' +
14:18:08 0|app  |       'Accept: application/json, text/plain, */*\r\n' +
14:18:08 0|app  |       'Content-Type: application/json\r\n' +
14:18:08 0|app  |       'Authorization: Bearer sk-proj-****\r\n' +
14:18:08 0|app  |       'OpenAI-Beta: assistants=v2\r\n' +
14:18:08 0|app  |       'User-Agent: axios/1.7.7\r\n' +
14:18:08 0|app  |       'Content-Length: 4871\r\n' +
14:18:08 0|app  |       'Accept-Encoding: gzip, compress, deflate, br\r\n'
14:18:08 0|app  |     },
14:18:08 0|app  |     method: 'post',
14:18:08 0|app  |     url: 'https://api.openai.com/v1/threads/thread_Pieyusl2Bc7xYEX7G1dM0Qtr/messages',
14:18:08 0|app  |     data: '{"role":"user","content":[{"type":"text","text":"<message content>"}]}'
14:18:08 0|app  |   }
14:18:08 0|app

In the error message it clearly states you should contact https://help.openai.com/ - have you tried that?

Yes, I tried looking for a solution on https://help.openai.com/, but I couldn’t find specific information regarding my issue, nor a clear way to contact technical support. The only relevant information I found was:

500 - The server had an error while processing your request.

Cause: Issue on our servers.

Solution: Retry your request after a brief wait and contact us if the issue persists. Read status page.

It seems the site has been updated, and there isn’t a direct option to report technical problems like this. If anyone has experience with this type of error or knows how to effectively contact support, I would appreciate any advice

I’m having the same issue, and pretty regularly over the last week. Any updates on what the problem might be?