gunicorn icon indicating copy to clipboard operation
gunicorn copied to clipboard

Gunicorn errors on WSL when binding to unix socket

Open andb0t opened this issue 2 years ago • 2 comments

Hello there!

My system:

Windows version: 10.0.19045 WSL version: Ubuntu 20.04.3 LTS Python version: 3.9.3 My installed python packages: requirements.txt

My observation

I'm following this tutorial and everything works fine - I can run my flask app using flast itself:

python app.py

It works fine using gunicorn with an IP address:

gunicorn --bind 0.0.0.0:5000 wsgi:app

But when I execute the next step binding it to a unix socket the following error happens:

gunicorn --bind=unix:/mnt/c/Users/myapp/app.sock -m 777 wsgi:app
[2022-11-26 19:30:44 +0100] [2738] [INFO] Starting gunicorn 20.1.0
[2022-11-26 19:30:44 +0100] [2738] [ERROR] Retrying in 1 second.
[2022-11-26 19:30:45 +0100] [2738] [ERROR] Retrying in 1 second.
[2022-11-26 19:30:46 +0100] [2738] [ERROR] Retrying in 1 second.
[2022-11-26 19:30:47 +0100] [2738] [ERROR] Retrying in 1 second.
[2022-11-26 19:30:48 +0100] [2738] [ERROR] Retrying in 1 second.
[2022-11-26 19:30:49 +0100] [2738] [ERROR] Can't connect to /mnt/c/Users/myapp/app.sock

Also while this runs, there is no app.sock showing up in the directory.

Any idea what this could be about? I was thinking of some problem with sockets on WSL?

andb0t avatar Nov 28 '22 22:11 andb0t

same here

ashasanm avatar Dec 14 '23 11:12 ashasanm

@ashasanm Only --log-level debug gives you the error (PR #3191 is one suggestion how making this easier to figure out). You probably did not want to create a Win32 (C:) Unix socket anyway, they are different from WSL Unix sockets.

pajod avatar Dec 14 '23 13:12 pajod

no activity since awhile. closing feel free to create a new ticket if needed.

benoitc avatar Aug 06 '24 17:08 benoitc