You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We deploy our gradio-Chatbot with AWS App Runner.
On App Runner, there is a 120s timeout:
There is a total of 120 seconds request timeout limit on the HTTP requests. The 120 seconds include the time the application takes to read the request, including the body, and complete writing the HTTP response.
The JS-error occurs only on the remote AWS App Runner environment, linked to the App Runner timeout.
When the page loads initially, an initial Server-Sent Events (SSE) connection is opened but remains open without closing. After 120 seconds, the connection hits the App Runner timeout and disconnects, causing a console error (e.g., net::ERR_INCOMPLETE_CHUNKED_ENCODING in Chrome or NS_ERROR_NET_PARTIAL_TRANSFER in Firefox).
This initial connection is separate from connections opened and closed for each chat message.
My analysis so far:
This behavior seems to have started since this commit, which introduces repeated calls to the connect method here for the client.
It’s unclear if/when this initial connection is closed. It appears that nothing significant is transmitted over this initial SSE connection, which mostly pings the "heartbeat" endpoint to check if the application is alive.
The heartbeat endpoint returns a regular status (e.g., "ALIVE") but may not do anything with this response. After 120 seconds, the stream times out and triggers the error
There is no observed impact on chatbot functionality, but we don't really want to deploy anything that causes JS-errors.
Have you searched existing issues? 🔎
I have searched and found no existing issues
Reproduction
It is a bit tricky to reproduce this error without having to deploy on AWS App Runner.
However, you can just use this simple demo:
And then set a breakpoint under "Sources" in "client/js/src/client.ts" here.
Then you can see that an initial connection is opened on the initial page load.
The comment there even says:
// Just connect to the endpoint without parsing the response. Ref: https://github.com/gradio-app/gradio/pull/7974#discussion_r1557717540
Screenshot
Logs
dummy/gradio_api/heartbeat/j3sx9yr4dk:1
Failed to load resource: net::ERR_INCOMPLETE_CHUNKED_ENCODING
System Info
Gradio Environment Information:
------------------------------
Operating System: Darwin
gradio version: 5.5.0
gradio_client version: 1.4.2
------------------------------------------------
gradio dependencies in your environment:
aiofiles: 23.2.1
anyio: 4.6.2.post1
audioop-lts is not installed.
fastapi: 0.115.4
ffmpy: 0.4.0
gradio-client==1.4.2 is not installed.
httpx: 0.27.2
huggingface-hub: 0.26.2
jinja2: 3.1.4
markupsafe: 2.1.5
numpy: 2.1.3
orjson: 3.10.11
packaging: 24.2
pandas: 2.2.3
pillow: 11.0.0
pydantic: 2.9.2
pydub: 0.25.1
python-multipart==0.0.12 is not installed.
pyyaml: 6.0.2
ruff: 0.7.3
safehttpx: 0.1.1
semantic-version: 2.10.0
starlette: 0.41.2
tomlkit==0.12.0 is not installed.
typer: 0.13.0
typing-extensions: 4.12.2
urllib3: 2.2.3
uvicorn: 0.32.0
authlib; extra == 'oauth' is not installed.
itsdangerous; extra == 'oauth' is not installed.
gradio_client dependencies in your environment:
fsspec: 2024.10.0
httpx: 0.27.2
huggingface-hub: 0.26.2
packaging: 24.2
typing-extensions: 4.12.2
websockets: 12.0
Severity
I can work around it
The text was updated successfully, but these errors were encountered:
Describe the bug
We deploy our gradio-Chatbot with AWS App Runner.
On App Runner, there is a 120s timeout:
See https://docs.aws.amazon.com/apprunner/latest/dg/develop.html
The JS-error occurs only on the remote AWS App Runner environment, linked to the App Runner timeout.
When the page loads initially, an initial Server-Sent Events (SSE) connection is opened but remains open without closing. After 120 seconds, the connection hits the App Runner timeout and disconnects, causing a console error (e.g.,
net::ERR_INCOMPLETE_CHUNKED_ENCODING
in Chrome orNS_ERROR_NET_PARTIAL_TRANSFER
in Firefox).This initial connection is separate from connections opened and closed for each chat message.
My analysis so far:
There is no observed impact on chatbot functionality, but we don't really want to deploy anything that causes JS-errors.
Have you searched existing issues? 🔎
Reproduction
It is a bit tricky to reproduce this error without having to deploy on AWS App Runner.
However, you can just use this simple demo:
And then set a breakpoint under "Sources" in "client/js/src/client.ts" here.
Then you can see that an initial connection is opened on the initial page load.
The comment there even says:
// Just connect to the endpoint without parsing the response. Ref: https://github.com/gradio-app/gradio/pull/7974#discussion_r1557717540
Screenshot
Logs
System Info
Severity
I can work around it
The text was updated successfully, but these errors were encountered: