Gunicorn: OSError: getsockaddrlen: bad family starting 20.0.3 with systemd and unix socket

Created on 25 Nov 2019  Â·  13Comments  Â·  Source: benoitc/gunicorn

I am building a new Centos VM from scratch, pulling packages from pip. Previous VM builds worked. I am getting the following error, which makes me believe it is trying to bind to ipv6 somewhere, but I am starting gunicorn using a systemd service file binding to a systemd socket file. My gunicorn invocation line in the systemd service file is:

ExecStart=/usr/local/bin/gunicorn --pid /run/gunicorn/app.gunicorn.pid --worker-tmp-dir /tmpfs-gunicorn --bind unix:/run/gunicorn/app.gunicorn.socket --chdir /home/centos/app --config /home/centos/app/gunicorn.py app:app

Any ideas what has changed to cause this? Thank you!

Nov 25 22:49:26 test1125c-centos-server gunicorn: [2019-11-25 22:49:26 +0000] [30028] [INFO] Starting gunicorn 20.0.3
Nov 25 22:49:26 test1125c-centos-server gunicorn: Traceback (most recent call last):
Nov 25 22:49:26 test1125c-centos-server gunicorn: File "/usr/local/bin/gunicorn", line 11, in
Nov 25 22:49:26 test1125c-centos-server gunicorn: sys.exit(run())
Nov 25 22:49:26 test1125c-centos-server gunicorn: File "/usr/local/lib/python3.6/site-packages/gunicorn/app/wsgiapp.py", line 58, in run
Nov 25 22:49:26 test1125c-centos-server gunicorn: WSGIApplication("%(prog)s [OPTIONS] [APP_MODULE]").run()
Nov 25 22:49:26 test1125c-centos-server gunicorn: File "/usr/local/lib/python3.6/site-packages/gunicorn/app/base.py", line 228, in run
Nov 25 22:49:26 test1125c-centos-server gunicorn: super().run()
Nov 25 22:49:26 test1125c-centos-server gunicorn: File "/usr/local/lib/python3.6/site-packages/gunicorn/app/base.py", line 72, in run
Nov 25 22:49:26 test1125c-centos-server gunicorn: Arbiter(self).run()
Nov 25 22:49:26 test1125c-centos-server gunicorn: File "/usr/local/lib/python3.6/site-packages/gunicorn/arbiter.py", line 198, in run
Nov 25 22:49:26 test1125c-centos-server gunicorn: self.start()
Nov 25 22:49:26 test1125c-centos-server gunicorn: File "/usr/local/lib/python3.6/site-packages/gunicorn/arbiter.py", line 155, in start
Nov 25 22:49:26 test1125c-centos-server gunicorn: self.LISTENERS = sock.create_sockets(self.cfg, self.log, fds)
Nov 25 22:49:26 test1125c-centos-server gunicorn: File "/usr/local/lib/python3.6/site-packages/gunicorn/sock.py", line 172, in create_sockets
Nov 25 22:49:26 test1125c-centos-server gunicorn: sock_name = sock.getsockname()
Nov 25 22:49:26 test1125c-centos-server gunicorn: OSError: getsockaddrlen: bad family

( FeaturCore

Most helpful comment

20.0.4 is out. Thanks for the report and feedback all!

All 13 comments

from which version of gunicorn are you upgrading?

I last built a VM about 4-5 weeks ago, and my automation installed 19.9.0 gunicorn from pip. Thanks
On Monday, November 25, 2019, 05:00:51 PM CST, Benoit Chesneau notifications@github.com wrote:

from which version are you upgrading?

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

I confirm the issue. The code checking from the file descriptor type is not cross platform. A fix should land today.

Thank you!
On Monday, November 25, 2019, 06:53:48 PM CST, Benoit Chesneau notifications@github.com wrote:

I confirm the issue. The code checking from the file descriptor type is not cross platform. A fix should land today.

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

same here. excited to see there's a fix in the works!

please test #2208 and let me know :)

the same problem after update gunicorn module today

@q121212 did you try #2208 ?

2208 fixed it for me

fixed in latest master. release is coming

20.0.4 is out. Thanks for the report and feedback all!

in my case rollback to version 19.9.0 helped me. there was no time to test fix https://github.com/benoitc/gunicorn/pull/2208

@q121212 well this is not really hepful. Anyway problem is fixed. You can also upgrade to 19.10 is you don't want to go yet on 20.x.

Was this page helpful?
0 / 5 - 0 ratings