Gunicorn: OSError: [Errno 92] Protocol not available

Created on 12 Apr 2017  路  10Comments  路  Source: benoitc/gunicorn

Gunicorn version: 19.7.1
Operating system: Ubuntu 14.04.5

$ /webapps/genida/virtualenv/bin/gunicorn_start
[2017-04-12-06:56:04] Starting genida as mazzucotelli
Traceback (most recent call last):
  File "/webapps/genida/virtualenv/lib/python3.5/site-packages/gunicorn/sock.py", line 44, in set_options
    sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT, 1)
OSError: [Errno 92] Protocol not available

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/webapps/genida/virtualenv/bin/gunicorn", line 11, in <module>
    sys.exit(run())
  File "/webapps/genida/virtualenv/lib/python3.5/site-packages/gunicorn/app/wsgiapp.py", line 74, in run
    WSGIApplication("%(prog)s [OPTIONS] [APP_MODULE]").run()
  File "/webapps/genida/virtualenv/lib/python3.5/site-packages/gunicorn/app/base.py", line 203, in run
    super(Application, self).run()
  File "/webapps/genida/virtualenv/lib/python3.5/site-packages/gunicorn/app/base.py", line 72, in run
    Arbiter(self).run()
  File "/webapps/genida/virtualenv/lib/python3.5/site-packages/gunicorn/arbiter.py", line 198, in run
    self.start()
  File "/webapps/genida/virtualenv/lib/python3.5/site-packages/gunicorn/arbiter.py", line 157, in start
    self.LISTENERS = sock.create_sockets(self.cfg, self.log, fds)
  File "/webapps/genida/virtualenv/lib/python3.5/site-packages/gunicorn/sock.py", line 180, in create_sockets
    sock = sock_type(addr, conf, log)
  File "/webapps/genida/virtualenv/lib/python3.5/site-packages/gunicorn/sock.py", line 117, in __init__
    super(UnixSocket, self).__init__(addr, conf, log, fd=fd)
  File "/webapps/genida/virtualenv/lib/python3.5/site-packages/gunicorn/sock.py", line 32, in __init__
    self.sock = self.set_options(sock, bound=bound)
  File "/webapps/genida/virtualenv/lib/python3.5/site-packages/gunicorn/sock.py", line 46, in set_options
    if err[0] not in (errno.ENOPROTOOPT, errno.EINVAL):
TypeError: 'OSError' object is not subscriptable

Downgrading to 19.6.0 works fine.

Is there some library missing on my system?

( Investigation

All 10 comments

I have the same issue!

@berkerpeksag i guess #1491 is fixing it?

Note that the TypeError was raised during handling of OSError here. It's like 2 issues in 1 but I was more pointing at the OSError :relaxed:

Yes, #1491 should fix TypeError.

@Pawamoy that depends on the value of err.errno. If it's not ENOPROTOOPT or EINVAL there might be second error. Could you please try again with the current master?

Hi @berkerpeksag , I cloned master branch and installed it in my venv instead of 19.6.0 and it worked.

@Pawamoy that's great, thanks for trying it out! Closing this as fixed.

Any plan for a release with this fix? Thanks in advance.

@xrmx 19.8.0 is released!

still happening
gevent==20.12.1

still happening
gevent==20.12.1

how do you reproduce it? Please open a new tickets with logs and possibly a way to help us to reproduce the issue.

Was this page helpful?
0 / 5 - 0 ratings