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
$ python debug/server.py INFO: Started server process [86782]INFO: Waiting for application startup.INFO: Application startup complete.Traceback (most recent call last): File "/Users/florimond/Developer/python-projects/httpx/debug/server.py", line 7, in <module> uvicorn.run( File "/Users/florimond/Developer/python-projects/httpx/venv/lib/python3.9/site-packages/uvicorn/main.py", line 391, in run server.run() File "/Users/florimond/Developer/python-projects/httpx/venv/lib/python3.9/site-packages/uvicorn/main.py", line 419, in run loop.run_until_complete(self.serve(sockets=sockets)) File "/Users/florimond/.pyenv/versions/3.9.0/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete return future.result() File "/Users/florimond/Developer/python-projects/httpx/venv/lib/python3.9/site-packages/uvicorn/main.py", line 436, in serve await self.startup(sockets=sockets) File "/Users/florimond/Developer/python-projects/httpx/venv/lib/python3.9/site-packages/uvicorn/main.py", line 526, in startup if isinstance(ip_address(config.host), IPv6Address): File "/Users/florimond/.pyenv/versions/3.9.0/lib/python3.9/ipaddress.py", line 53, in ip_address raise ValueError('%r does not appear to be an IPv4 or IPv6 address' %ValueError: 'localhost' does not appear to be an IPv4 or IPv6 address
Environment
OS / Python / Uvicorn version:
Running uvicorn 0.12.2 with CPython 3.9.0 on Darwin
The exact command you're running uvicorn with, all flags you passed included. If you run it with gunicorn please do the same. If there is a reverse-proxy involved and you cannot reproduce without it please give the minimal config of it to reproduce.
python server.py
Additional context
Found this while investigating a deadlock in the HTTPX test suite: encode/httpx#1366
Our HTTPS server fixture passes host="localhost" (not required, removing that flag makes the test suite pass again) which is causing the Uvicorn server to fail to start, and we're not checking for that potentiality so the fixture keeps checking for server.ready indefinitely, hence the deadlock.
The text was updated successfully, but these errors were encountered:
@euri10 Oops, just found out that there's a fix in master for this already — #827.
I'll close as a duplicate, but I'll take a look at the fix in #827 (you mentioned you were "not super happy" with it, and it does seem a bit complicated — maybe there's a way to simplify things).
Hey folks!
Checklist
master
.Describe the bug
When specifying
--host localhost
(or passinghost="localhost"
touvicorn.run()
), I'm getting aValueError
that prevents the server from starting.This seems to have been introduced by #803, since the error happens on this line:
https://github.com/encode/uvicorn/pull/803/files#diff-ab3f29e794a752a9514c33ce772320a2cfbeab571f5254207f096e2d8da7e077R506
To reproduce
Expected behavior
Server should start and listen on
localhost:8000
.Actual behavior
Server fails to start and raises exception.
Debugging material
Environment
Running uvicorn 0.12.2 with CPython 3.9.0 on Darwin
Additional context
Found this while investigating a deadlock in the HTTPX test suite: encode/httpx#1366
Our HTTPS server fixture passes
host="localhost"
(not required, removing that flag makes the test suite pass again) which is causing the Uvicorn server to fail to start, and we're not checking for that potentiality so the fixture keeps checking forserver.ready
indefinitely, hence the deadlock.The text was updated successfully, but these errors were encountered: