gradio-app / gradio

Build and share delightful machine learning apps, all in Python. 🌟 Star to support our work!
http://www.gradio.app
Apache License 2.0
33.62k stars 2.55k forks source link

Error triggered continously in app with Image and Audio component #6361

Closed mangiucugna closed 2 weeks ago

mangiucugna commented 11 months ago

Describe the bug

I have created a new space in HF with a gradio app with an Image component that has webcam input with streaming enabled and an audio component.

Link to the app: https://huggingface.co/spaces/mangiucugna/corporate-videocall-coach

The logs show this error happening continuously even when the app is not in use:

ERROR:    Exception in ASGI application
Traceback (most recent call last):
  File "/home/user/.local/lib/python3.10/site-packages/uvicorn/protocols/http/h11_impl.py", line 408, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
  File "/home/user/.local/lib/python3.10/site-packages/uvicorn/middleware/proxy_headers.py", line 84, in __call__
    return await self.app(scope, receive, send)
  File "/home/user/.local/lib/python3.10/site-packages/fastapi/applications.py", line 1106, in __call__
    await super().__call__(scope, receive, send)
  File "/home/user/.local/lib/python3.10/site-packages/starlette/applications.py", line 122, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/home/user/.local/lib/python3.10/site-packages/starlette/middleware/errors.py", line 184, in __call__
    raise exc
  File "/home/user/.local/lib/python3.10/site-packages/starlette/middleware/errors.py", line 162, in __call__
    await self.app(scope, receive, _send)
  File "/home/user/.local/lib/python3.10/site-packages/starlette/middleware/cors.py", line 91, in __call__
    await self.simple_response(scope, receive, send, request_headers=headers)
  File "/home/user/.local/lib/python3.10/site-packages/starlette/middleware/cors.py", line 146, in simple_response
    await self.app(scope, receive, send)
  File "/home/user/.local/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 79, in __call__
    raise exc
  File "/home/user/.local/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 68, in __call__
    await self.app(scope, receive, sender)
  File "/home/user/.local/lib/python3.10/site-packages/fastapi/middleware/asyncexitstack.py", line 20, in __call__
    raise e
  File "/home/user/.local/lib/python3.10/site-packages/fastapi/middleware/asyncexitstack.py", line 17, in __call__
    await self.app(scope, receive, send)
  File "/home/user/.local/lib/python3.10/site-packages/starlette/routing.py", line 718, in __call__
    await route.handle(scope, receive, send)
  File "/home/user/.local/lib/python3.10/site-packages/starlette/routing.py", line 276, in handle
    await self.app(scope, receive, send)
  File "/home/user/.local/lib/python3.10/site-packages/starlette/routing.py", line 66, in app
    response = await func(request)
  File "/home/user/.local/lib/python3.10/site-packages/fastapi/routing.py", line 274, in app
    raw_response = await run_endpoint_function(
  File "/home/user/.local/lib/python3.10/site-packages/fastapi/routing.py", line 191, in run_endpoint_function
    return await dependant.call(**values)
  File "/home/user/.local/lib/python3.10/site-packages/gradio/routes.py", line 699, in upload_file
    form = await multipart_parser.parse()
  File "/home/user/.local/lib/python3.10/site-packages/gradio/route_utils.py", line 444, in parse
    async for chunk in self.stream:
  File "/home/user/.local/lib/python3.10/site-packages/starlette/requests.py", line 230, in stream
    raise ClientDisconnect()
starlette.requests.ClientDisconnect

The error doesn't appear when developing locally and does not impact the functionality of the app.

Have you searched existing issues? 🔎

Reproduction

Create a new app with the same components and publish it in HF

Screenshot

No response

Logs

No response

System Info

stefanobaccianella@Stefanos-MacBook-Pro corporate-videocall-coach % 
 *  History restored 

stefanobaccianella@Stefanos-MacBook-Pro corporate-videocall-coach % gradio environment
gradio version: 4.1.2
gradio_client version: 0.7.0

------------------------------------------------
gradio dependencies in your environment:

aiofiles: 23.2.1
altair: 5.1.2
fastapi: 0.104.1
ffmpy: 0.3.1
gradio-client==0.7.0 is not installed.
httpx: 0.25.1
huggingface-hub: 0.19.0
importlib-resources: 6.1.1
jinja2: 3.1.2
markupsafe: 2.1.3
matplotlib: 3.8.1
numpy: 1.26.1
orjson: 3.9.10
packaging: 23.2
pandas: 2.1.2
pillow: 10.1.0
pydantic: 2.4.2
pydub: 0.25.1
python-multipart: 0.0.6
pyyaml: 6.0.1
requests: 2.31.0
semantic-version: 2.10.0
tomlkit==0.12.0 is not installed.
typer: 0.9.0
typing-extensions: 4.8.0
uvicorn: 0.24.0.post1
websockets: 11.0.3
authlib; extra == 'oauth' is not installed.
itsdangerous; extra == 'oauth' is not installed.

gradio_client dependencies in your environment:

fsspec: 2023.10.0
httpx: 0.25.1
huggingface-hub: 0.19.0
packaging: 23.2
requests: 2.31.0
typing-extensions: 4.8.0
websockets: 11.0.3

Severity

I can work around it

mangiucugna commented 11 months ago

relates to #6275

abidlabs commented 2 weeks ago

Hi, apologies for the late follow up. We haven't had a chance to look into this issue, but the Gradio codebase has changed quite significantly since this issue was created. Could you let us know if this is still an issue in the latest version of Gradio (pip install --upgrade gradio)? Thanks!

mangiucugna commented 2 weeks ago

oh wow, I forgot I opened this bug even. Let's close it as literally every single component that interacted with that experiment was updated massively and it makes no sense now.