[uWSGI] Error on uwsgi worker spawn

Vitaly Trifanov vitaly.trifanov at gmail.com
Sat Jun 17 23:42:44 UTC 2017


Hello. I am running nginx + uwsgi 2.0.15 + mysql 5.5.55 application. Each
time uwsgi respawns worker I get following error in logs (and 502 in
browser):

Sat Jun 17 16:38:22 2017 - Respawned uWSGI worker 1 (new pid: 9021)Sat
Jun 17 16:38:22 2017 - SIGPIPE: writing to a closed pipe/socket/fd
(probably the client disconnected) !!!Traceback (most recent call
last):
  File "/home/hikesadmin/.local/lib/python3.4/site-packages/django/core/handlers/wsgi.py",
line 157, in __call__
    signals.request_started.send(sender=self.__class__, environ=environ)
  File "/home/hikesadmin/.local/lib/python3.4/site-packages/django/dispatch/dispatcher.py",
line 191, in send
    response = receiver(signal=self, sender=sender, **named)
  File "/home/hikesadmin/.local/lib/python3.4/site-packages/django/db/__init__.py",
line 61, in close_old_connections
    conn.close_if_unusable_or_obsolete()
  File "/home/hikesadmin/.local/lib/python3.4/site-packages/django/db/backends/base/base.py",
line 504, in close_if_unusable_o
r_obsolete
    self.close()
  File "/home/hikesadmin/.local/lib/python3.4/site-packages/django/db/backends/base/base.py",
line 272, in close
    self._close()
  File "/home/hikesadmin/.local/lib/python3.4/site-packages/django/db/backends/base/base.py",
line 221, in _close
    return self.connection.close()
  File "/home/hikesadmin/.local/lib/python3.4/site-packages/pymysql/connections.py",
line 734, in close
    sock.close()AttributeError: 'NoneType' object has no attribute 'close'


After worker is started the application works properly.

UWSGI app config:

[uwsgi]
uid = hikesadmin
env = HOME=/home/hikesadmin
env = LANG=en_US.UTF-8

processes = 1
threads = 2auto-procname = 1

cheap = 1
idle = 60
harakiri = 30
vacuum = 1

chdir = /home/hikesadmin/engine
wsgi-file = hike_engine/wsgi.py
touch-reload = hike_engine/wsgi.py
logto=/tmp/hikes.log# log-maxsize=1048576
daemonize=/tmp/hikes.log
disable-logging=True

*Why these errors occur? How can I trace the roots of the problem?*

Thanks :)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.unbit.it/pipermail/uwsgi/attachments/20170618/e7c5906d/attachment-0001.html>


More information about the uWSGI mailing list