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

protocols.utils.get_local_addr ValueError with socket #733

Closed
bukowa opened this issue Jul 30, 2020 · 1 comment
Closed

protocols.utils.get_local_addr ValueError with socket #733

bukowa opened this issue Jul 30, 2020 · 1 comment

Comments

@bukowa
Copy link

bukowa commented Jul 30, 2020

version: 0.11.7

this line causes trouble https://github.com/encode/uvicorn/blob/master/uvicorn/protocols/utils.py#L39

value of info variable: /socket/socket.sock

command:

uvicorn --uds /socket/socket.sock --interface=asgi3 --lifespan=off --log-level=trace --use-colors --proxy-headers dim_django.asgi:application

trace line is different due to added logging

django_1  | INFO:     Started server process [10]
django_1  | INFO:uvicorn.error:Started server process [10]
django_1  | INFO:     Uvicorn running on unix socket /socket/socket.sock (Press CTRL+C to quit)
django_1  | INFO:uvicorn.error:Uvicorn running on unix socket /socket/socket.sock (Press CTRL+C to quit)
django_1  | INFO:root:/socket/socket.sock
django_1  | ERROR:asyncio:Exception in callback UVTransport._call_connection_made
django_1  | handle: <Handle UVTransport._call_connection_made>
django_1  | Traceback (most recent call last):
django_1  |   File "uvloop/cbhandles.pyx", line 73, in uvloop.loop.Handle._run
django_1  |   File "uvloop/handles/basetransport.pyx", line 134, in uvloop.loop.UVBaseTransport._call_connection_made
django_1  |   File "uvloop/handles/basetransport.pyx", line 131, in uvloop.loop.UVBaseTransport._call_connection_made
django_1  |   File "/usr/local/lib/python3.8/site-packages/uvicorn/protocols/http/httptools_impl.py", line 132, in connection_made
django_1  |     self.server = get_local_addr(transport)
django_1  |   File "/usr/local/lib/python3.8/site-packages/uvicorn/protocols/utils.py", line 45, in get_local_addr
django_1  |     return (str(info[0]), int(info[1]))
django_1  | ValueError: invalid literal for int() with base 10: 's'

#600

nginx config:

upstream django {
  server unix:/socket/socket.sock;
}
server {

  listen 9000;
  server_name localhost;

  location /static/ {
    autoindex off;
    alias /static/;
  }

  location / {
    proxy_pass http://django/;
  }
@euri10
Copy link
Member

euri10 commented Jul 31, 2020

thanks, going to close as a duplicate of #727
hopefully fixed soon

@euri10 euri10 closed this as completed Jul 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants