Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gradio not binding to [::] on windows #10150

Open
1 task done
BPplays opened this issue Dec 7, 2024 · 0 comments
Open
1 task done

gradio not binding to [::] on windows #10150

BPplays opened this issue Dec 7, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@BPplays
Copy link

BPplays commented Dec 7, 2024

Describe the bug

when i try to bind to [::] i get httpx.ConnectError: [WinError 10049] The requested address is not valid in its context. it might be related to #8437 but it seems to be a different error there.

Have you searched existing issues? 🔎

  • I have searched and found no existing issues

Reproduction

import gradio as gr
import logging

logging.basicConfig(level=logging.DEBUG)

def greet(name, intensity):
    return "Hello, " + name + "!" * int(intensity)

demo = gr.Interface(
    fn=greet,
    inputs=["text", "slider"],
    outputs=["text"],
)

if __name__ == "__main__":
    demo.launch(debug=True, server_name="[::]", server_port=2858)

Screenshot

No response

Logs

DEBUG:asyncio:Using proactor: IocpProactor
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): huggingface.co:443
DEBUG:asyncio:Using proactor: IocpProactor
DEBUG:urllib3.connectionpool:https://huggingface.co:443 "HEAD /api/telemetry/gradio/initiated HTTP/1.1" 200 0
* Running on local URL:  http://[::]:2858
DEBUG:httpcore.connection:connect_tcp.started host='api.gradio.app' port=443 local_address=None timeout=3 socket_options=None
DEBUG:httpcore.connection:connect_tcp.complete return_value=<httpcore._backends.sync.SyncStream object at 0x000000003F7075F0>
DEBUG:httpcore.connection:start_tls.started ssl_context=<ssl.SSLContext object at 0x000000003DE09DD0> server_hostname='api.gradio.app' timeout=3
DEBUG:httpcore.connection:start_tls.complete return_value=<httpcore._backends.sync.SyncStream object at 0x000000003E52B560>
DEBUG:httpcore.http11:send_request_headers.started request=<Request [b'GET']>
DEBUG:httpcore.http11:send_request_headers.complete
DEBUG:httpcore.http11:send_request_body.started request=<Request [b'GET']>
DEBUG:httpcore.http11:send_request_body.complete
DEBUG:httpcore.http11:receive_response_headers.started request=<Request [b'GET']>
DEBUG:httpcore.http11:receive_response_headers.complete return_value=(b'HTTP/1.1', 200, b'OK', [(b'Date', b'Sat, 07 Dec 2024 04:54:52 GMT'), (b'Content-Type', b'application/json'), (b'Content-Length', b'21'), (b'Connection', b'keep-alive'), (b'Server', b'nginx/1.18.0'), (b'Access-Control-Allow-Origin', b'*')])
INFO:httpx:HTTP Request: GET https://api.gradio.app/pkg-version "HTTP/1.1 200 OK"
DEBUG:httpcore.http11:receive_response_body.started request=<Request [b'GET']>
DEBUG:httpcore.http11:receive_response_body.complete
DEBUG:httpcore.http11:response_closed.started
DEBUG:httpcore.http11:response_closed.complete
DEBUG:httpcore.connection:close.started
DEBUG:httpcore.connection:close.complete
DEBUG:httpcore.connection:connect_tcp.started host='::' port=2858 local_address=None timeout=None socket_options=None
DEBUG:httpcore.connection:connect_tcp.failed exception=ConnectError(OSError(10049, 'The requested address is not valid in its context', None, 10049, None))
Traceback (most recent call last):
  File "C:\Users\irl_name\.pyenv\pyenv-win\versions\3.12.3\Lib\site-packages\httpx\_transports\default.py", line 101, in map_httpcore_exceptions
    yield
  File "C:\Users\irl_name\.pyenv\pyenv-win\versions\3.12.3\Lib\site-packages\httpx\_transports\default.py", line 250, in handle_request
    resp = self._pool.handle_request(req)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\irl_name\.pyenv\pyenv-win\versions\3.12.3\Lib\site-packages\httpcore\_sync\connection_pool.py", line 256, in handle_request
    raise exc from None
  File "C:\Users\irl_name\.pyenv\pyenv-win\versions\3.12.3\Lib\site-packages\httpcore\_sync\connection_pool.py", line 236, in handle_request
    response = connection.handle_request(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\irl_name\.pyenv\pyenv-win\versions\3.12.3\Lib\site-packages\httpcore\_sync\connection.py", line 101, in handle_request
    raise exc
  File "C:\Users\irl_name\.pyenv\pyenv-win\versions\3.12.3\Lib\site-packages\httpcore\_sync\connection.py", line 78, in handle_request
    stream = self._connect(request)
             ^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\irl_name\.pyenv\pyenv-win\versions\3.12.3\Lib\site-packages\httpcore\_sync\connection.py", line 124, in _connect
    stream = self._network_backend.connect_tcp(**kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\irl_name\.pyenv\pyenv-win\versions\3.12.3\Lib\site-packages\httpcore\_backends\sync.py", line 207, in connect_tcp
    with map_exceptions(exc_map):
  File "C:\Users\irl_name\.pyenv\pyenv-win\versions\3.12.3\Lib\contextlib.py", line 158, in __exit__
    self.gen.throw(value)
  File "C:\Users\irl_name\.pyenv\pyenv-win\versions\3.12.3\Lib\site-packages\httpcore\_exceptions.py", line 14, in map_exceptions
    raise to_exc(exc) from exc
httpcore.ConnectError: [WinError 10049] The requested address is not valid in its context

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Users\irl_name\program dev\py\gradio_test\main.py", line 16, in <module>
    demo.launch(debug=True, server_name="[::]", server_port=2858)
  File "C:\Users\irl_name\.pyenv\pyenv-win\versions\3.12.3\Lib\site-packages\gradio\blocks.py", line 2551, in launch
    httpx.get(
  File "C:\Users\irl_name\.pyenv\pyenv-win\versions\3.12.3\Lib\site-packages\httpx\_api.py", line 195, in get
    return request(
           ^^^^^^^^
  File "C:\Users\irl_name\.pyenv\pyenv-win\versions\3.12.3\Lib\site-packages\httpx\_api.py", line 109, in request
    return client.request(
           ^^^^^^^^^^^^^^^
  File "C:\Users\irl_name\.pyenv\pyenv-win\versions\3.12.3\Lib\site-packages\httpx\_client.py", line 825, in request
    return self.send(request, auth=auth, follow_redirects=follow_redirects)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\irl_name\.pyenv\pyenv-win\versions\3.12.3\Lib\site-packages\httpx\_client.py", line 914, in send
    response = self._send_handling_auth(
               ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\irl_name\.pyenv\pyenv-win\versions\3.12.3\Lib\site-packages\httpx\_client.py", line 942, in _send_handling_auth
    response = self._send_handling_redirects(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\irl_name\.pyenv\pyenv-win\versions\3.12.3\Lib\site-packages\httpx\_client.py", line 979, in _send_handling_redirects
    response = self._send_single_request(request)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\irl_name\.pyenv\pyenv-win\versions\3.12.3\Lib\site-packages\httpx\_client.py", line 1014, in _send_single_request
    response = transport.handle_request(request)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\irl_name\.pyenv\pyenv-win\versions\3.12.3\Lib\site-packages\httpx\_transports\default.py", line 249, in handle_request
    with map_httpcore_exceptions():
  File "C:\Users\irl_name\.pyenv\pyenv-win\versions\3.12.3\Lib\contextlib.py", line 158, in __exit__
    self.gen.throw(value)
  File "C:\Users\irl_name\.pyenv\pyenv-win\versions\3.12.3\Lib\site-packages\httpx\_transports\default.py", line 118, in map_httpcore_exceptions
    raise mapped_exc(message) from exc
httpx.ConnectError: [WinError 10049] The requested address is not valid in its context

System Info

Gradio Environment Information:
------------------------------
Operating System: Windows
gradio version: 5.8.0
gradio_client version: 1.5.1

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

aiofiles: 23.2.1
anyio: 4.7.0
audioop-lts is not installed.
fastapi: 0.115.6
ffmpy: 0.4.0
gradio-client==1.5.1 is not installed.
httpx: 0.28.1
huggingface-hub: 0.26.5
jinja2: 3.1.4
markupsafe: 2.1.5
numpy: 2.1.3
orjson: 3.10.12
packaging: 24.2
pandas: 2.2.3
pillow: 11.0.0
pydantic: 2.10.3
pydub: 0.25.1
python-multipart: 0.0.19
pyyaml: 6.0.2
ruff: 0.8.2
safehttpx: 0.1.6
semantic-version: 2.10.0
starlette: 0.41.3
tomlkit: 0.13.2
typer: 0.15.1
typing-extensions: 4.12.2
urllib3: 2.2.1
uvicorn: 0.32.1
authlib; extra == 'oauth' is not installed.
itsdangerous; extra == 'oauth' is not installed.


gradio_client dependencies in your environment:

fsspec: 2024.10.0
httpx: 0.28.1
huggingface-hub: 0.26.5
packaging: 24.2
typing-extensions: 4.12.2
websockets: 14.1

Severity

I can work around it

@BPplays BPplays added the bug Something isn't working label Dec 7, 2024
@BPplays BPplays changed the title gradio not working with ipv6 on windows gradio not binding to [::] on windows Dec 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant