Skip to content

Timeout APIConnectionError during Large File Upload (200MB) - ECONNRESET #31148

Open
@SuMyatHlaing30

Description

@SuMyatHlaing30

Describe the bug
When attempting to upload a large file (200MB) to the Azure OpenAI API using the OpenAI Node.js SDK, the request fails with an ECONNRESET error. The error seems to occur when the upload exceeds a certain size, as smaller files upload without issue.
https://platform.openai.com/docs/api-reference/files/create

To Reproduce

 const file = await openai_client.files.create({
      file: fs.createReadStream(path.join(__dirname, './uploads/testfile.pdf')),
      purpose: 'assistants',
    });

Expected behavior
The file should upload successfully without a connection reset error because there is a description in api documentation like - Individual files can be up to 512 MB, and the size of all files uploaded by one organization can be up to 100 GB.

Additional context
Additional Info:

The issue only occurs with larger files (200MB+).
Smaller files upload successfully.
Node.js version: 20
OpenAI SDK version: V2

APIConnectionError: Connection error.
at AzureOpenAI.makeRequest (...\node_modules\openai\core.js:304:19)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async runThread (...\fileTestOpenai.js:23:16)
at async main (...\fileTestOpenai.js:19:5) {
status: undefined,
headers: undefined,
request_id: undefined,
error: undefined,
code: undefined,
param: undefined,
type: undefined,
cause: FetchError: request to https://...openai.azure.com//openai/files?api-version=2024-07-01-preview failed, reason: read ECONNRESET
at ClientRequest. (...\node_modules\node-fetch\lib\index.js:1501:11)
at ClientRequest.emit (node:events:517:28)
at TLSSocket.socketErrorListener (node:_http_client:501:9)
at TLSSocket.emit (node:events:529:35)
at emitErrorNT (node:internal/streams/destroy:151:8)
at emitErrorCloseNT (node:internal/streams/destroy:116:3)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
type: 'system',
errno: 'ECONNRESET',
code: 'ECONNRESET'
}
}

Metadata

Metadata

Assignees

Labels

ClientThis issue points to a problem in the data-plane of the library.OpenAIcustomer-reportedIssues that are reported by GitHub users external to the Azure organization.needs-team-attentionWorkflow: This issue needs attention from Azure service team or SDK teamquestionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions