Closed simonorzel26 closed 5 months ago
This might be caused by a bug in Bun and not in openai-node
. We don't implement support for sending streaming request bodies yet via node:http
clients (not the server)
This might be caused by a bug in Bun and not in
openai-node
. We don't implement support for sending streaming request bodies yet vianode:http
clients (not the server)
@Jarred-Sumner Amazing, thank you! This was the problem, my ./generated bun build files were the ones being run on my container, but if i just run the scripts via bun script.ts
it works fine.
Thank you!
Confirm this is a Node library issue and not an underlying OpenAI API issue
Describe the bug
Bug Report:
openai.files.create
Method Hangs and Does Not Throw Errors in Docker ContainersBug Report ID: BR-20240622-001
Title:
openai.files.create
Method Hangs and Does Not Throw Errors in Docker ContainersReporter: simonorzel26
Date: June 22, 2024
Environment:
oven/bun:latest-debian
,bun:debian
,imbios/bun-node:20-slim
and other container versions (mainly bun)v20.x
1.1.15
curl
, network access is functionalDescription: The
openai.files.create
method hangs indefinitely and does not throw any errors when executed within a Docker container. The method works as expected when run locally on the host machine via building js scripts and running them. This behavior prevents the file upload process from completing, causing the application to stall and making the issue unfixable due to the lack of error feedback and only timeout error happens.Steps to Reproduce:
oven/bun:latest-debian
,bun:debian
, or similar variants.openai.files.create
method within the container.Expected Behavior: The
openai.files.create
method should either successfully upload the file and return the file ID or throw an error if the upload fails.Actual Behavior: The method hangs indefinitely and does not throw any errors, causing the application to stall and timeout the request.
Additional Information:
curl
andping
to external endpoints work correctly inside the Docker container, confirming network access.OPENAI_API_KEY
is set correctly within the container. Tested via running a completion api in same container.openai.chat.completions.create
, work correctly within the container, confirming the API is accessible over network.Forgive the mess of 8+hrs of debugging: Code:
Error Log:
Severity: Medium
Priority: P2
Status: Open
Notes: This issue appears to be specific to running the OpenAI file upload method inside a Docker container. Further investigation is required to determine if this is a configuration issue, a problem with the Docker environment, or an issue with the OpenAI SDK/API when used in this context.
To Reproduce
Steps to Reproduce:
Code snippets
No response
OS
macOs
Node version
node v20.12 bun 1.1.15
Library version
4.51.0