django-rq icon indicating copy to clipboard operation
django-rq copied to clipboard

ConnectionError redis.connection in _read_from_socket when I reboot the server

Open pulse-mind opened this issue 2 years ago • 0 comments

Hello,

I am using ubuntu 20.04 django-rq is managed with supervisor

When I reboot the server I get this error:

Could not connect to Redis instance: Connection closed by server. Retrying in 1 seconds...
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()
  File "/webapps/myapp/lib/python3.8/site-packages/sentry_sdk/integrations/threading.py", line 69, in run
    reraise(*_capture_exception())
  File "/webapps/myapp/lib/python3.8/site-packages/sentry_sdk/_compat.py", line 54, in reraise
    raise value
  File "/webapps/myapp/lib/python3.8/site-packages/sentry_sdk/integrations/threading.py", line 67, in run
    return old_run_func(self, *a, **kw)
  File "/webapps/myapp/lib/python3.8/site-packages/redis/client.py", line 1695, in run
    pubsub.get_message(ignore_subscribe_messages=True, timeout=sleep_time)
  File "/webapps/myapp/lib/python3.8/site-packages/redis/client.py", line 1586, in get_message
    response = self.parse_response(block=False, timeout=timeout)
  File "/webapps/myapp/lib/python3.8/site-packages/redis/client.py", line 1436, in parse_response
    if not block and not self._execute(conn, conn.can_read, timeout=timeout):
  File "/webapps/myapp/lib/python3.8/site-packages/redis/client.py", line 1420, in _execute
    return conn.retry.call_with_retry(
  File "/webapps/myapp/lib/python3.8/site-packages/redis/retry.py", line 48, in call_with_retry
    fail(error)
  File "/webapps/myapp/lib/python3.8/site-packages/redis/client.py", line 1422, in <lambda>
    lambda error: self._disconnect_raise_connect(conn, error),
  File "/webapps/myapp/lib/python3.8/site-packages/redis/client.py", line 1409, in _disconnect_raise_connect
    raise error
  File "/webapps/myapp/lib/python3.8/site-packages/redis/retry.py", line 45, in call_with_retry
    return do()
  File "/webapps/myapp/lib/python3.8/site-packages/redis/client.py", line 1421, in <lambda>
    lambda: command(*args, **kwargs),
  File "/webapps/myapp/lib/python3.8/site-packages/redis/connection.py", line 804, in can_read
    return self._parser.can_read(timeout)
  File "/webapps/myapp/lib/python3.8/site-packages/redis/connection.py", line 317, in can_read
    return self._buffer and self._buffer.can_read(timeout)
  File "/webapps/myapp/lib/python3.8/site-packages/redis/connection.py", line 224, in can_read
    return bool(self.length) or self._read_from_socket(
  File "/webapps/myapp/lib/python3.8/site-packages/redis/connection.py", line 197, in _read_from_socket
    raise ConnectionError(SERVER_CLOSED_CONNECTION_ERROR)
redis.exceptions.ConnectionError: Connection closed by server.
Warm shut down requested
Error 111 connecting to localhost:6379. Connection refused.

I do not know how to solve this problem, is someone have an idea ?

Best regards Fred

pulse-mind avatar Feb 27 '22 12:02 pulse-mind