Uvicorn ignores --uds and --fd configs
See original GitHub issueI’m using uvicorn with supervisor and nginx
I’m trying to use the unix socket but it keep using the host and port
here is my supervisor conf file:
[fcgi-program:tas]
enviroment=DJANGO_SETTINGS_MODULE="maq_tasks.settings",DJANGO_ASGI_MODULE="maq_tasks.asgi",LOG_LEVEL="debug",WORKERS="3"
directory=/home/tas/src/
socket=unix:///home/tas/run/uvicorn.sock
command=/home/tas/bin/uvicorn maq_tasks.asgi:application --workers 3 --log-level debug --fd 0
user=tas
autostart=true
autorestart=true
redirect_stderr=true
stdout_logfile=/home/tas/logs/uvicorn-error.log
and here is my error
Traceback (most recent call last):
....
File "/home/tas/lib/python3.6/site-packages/click/core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "/home/tas/lib/python3.6/site-packages/click/core.py", line 717, in main
rv = self.invoke(ctx)
File "/home/tas/lib/python3.6/site-packages/click/core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/tas/lib/python3.6/site-packages/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
File "/home/tas/lib/python3.6/site-packages/uvicorn/main.py", line 257, in main
run(**kwargs)
File "/home/tas/lib/python3.6/site-packages/uvicorn/main.py", line 274, in run
socket = config.bind_socket()
File "/home/tas/lib/python3.6/site-packages/uvicorn/config.py", line 219, in bind_socket
sock.bind((self.host, self.port))
OSError: [Errno 98] Address already in use
Issue Analytics
- State:
- Created 4 years ago
- Comments:12 (3 by maintainers)
Top Results From Across the Web
Developers - Uvicorn ignores --uds and --fd configs - - Bountysource
I'm using uvicorn with supervisor and nginx. I'm trying to use the unix socket but it keep using the host and port. here...
Read more >Settings - Uvicorn
--uds <path> - Bind to a UNIX domain socket, for example --uds /tmp/uvicorn.sock . ... This option is ignored if the --log-config CLI...
Read more >How to use the uvicorn.main.Server function in uvicorn - Snyk
To help you get started, we've selected a few uvicorn.main. ... server = Server(config=config) config.load() CA.configure_trust(config.ssl) # Prepare the ...
Read more >FastAPI/uvicorn not working when specifying host
I'm running a FastAPI app in Python using uvicorn on a Windows machine. It works fine when I do any one of the...
Read more >How to unify uvicorn logging with endpoints logging?
Explanation When uvicorn's logging config has set ... This option is ignored if the --log-config CLI option is used.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It would be nice to add this to the documentation at least. The docs state that
--workers
doesn’t work with--reload
but does not mention issues with--uds
or '–fd`. So, the only way to understand why reload is not working when using a socket, is this closed ticket on GitHub.I believe this is an important feature to have. In my situation, I use a unix socket for production, and I want the reload functionality for development. Since I run my application like production while I develop, it would be useful to be able to use reload and a unix socket together so that I don’t have to implement special code to handle this case.