#python #ssl #redis #eventlet
Вопрос:
Получение этих ошибок при подключении к redis с помощью SSL. Нормальное действие работает нормально, похоже, у датчика возникли проблемы. Я действительно пытался использовать исправления, упомянутые в https://github.com/eventlet/eventlet/issues/371 но ни одна из различных комбинаций версий библиотеки, похоже, не подходит для моего случая.
021-08-17 14:32:25,839 WARNING [-] Sensor "XYZSensor" run method raised an exception: Error while reading from socket: ('timed out',).
Traceback (most recent call last):
File "/opt/stackstorm/st2/lib/python3.6/site-packages/redis/connection.py", line 198, in _read_from_socket
data = recv(self._sock, socket_read_size)
File "/opt/stackstorm/st2/lib/python3.6/site-packages/redis/_compat.py", line 72, in recv
return sock.recv(*args, **kwargs)
File "/opt/stackstorm/st2/lib/python3.6/site-packages/eventlet/green/ssl.py", line 231, in recv
return self._base_recv(buflen, flags, into=False)
File "/opt/stackstorm/st2/lib/python3.6/site-packages/eventlet/green/ssl.py", line 258, in _base_recv
read = self.read(nbytes)
File "/opt/stackstorm/st2/lib/python3.6/site-packages/eventlet/green/ssl.py", line 176, in read
super(GreenSSLSocket, self).read, *args, **kwargs)
File "/opt/stackstorm/st2/lib/python3.6/site-packages/eventlet/green/ssl.py", line 156, in _call_trampolining
timeout_exc=timeout_exc('timed out'))
File "/opt/stackstorm/st2/lib/python3.6/site-packages/eventlet/hubs/__init__.py", line 159, in trampoline
return hub.switch()
File "/opt/stackstorm/st2/lib/python3.6/site-packages/eventlet/hubs/hub.py", line 298, in switch
return self.greenlet.switch()
ssl.SSLError: ('timed out',)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/stackstorm/st2/lib/python3.6/site-packages/st2reactor/container/sensor_wrapper.py", line 229, in run
self._sensor_instance.run()
File "/opt/stackstorm/packs/st2sensors/sensors/vmc_event_notification_sensor.py", line 56, in run
self.pubsub.subscribe('XYZEvents')
File "/opt/stackstorm/st2/lib/python3.6/site-packages/redis/client.py", line 3580, in subscribe
ret_val = self.execute_command('SUBSCRIBE', *iterkeys(new_channels))
File "/opt/stackstorm/st2/lib/python3.6/site-packages/redis/client.py", line 3468, in execute_command
self.shard_hint
File "/opt/stackstorm/st2/lib/python3.6/site-packages/redis/connection.py", line 1203, in get_connection
if connection.can_read():
File "/opt/stackstorm/st2/lib/python3.6/site-packages/redis/connection.py", line 734, in can_read
return self._parser.can_read(timeout)
File "/opt/stackstorm/st2/lib/python3.6/site-packages/redis/connection.py", line 321, in can_read
return self._buffer and self._buffer.can_read(timeout)
File "/opt/stackstorm/st2/lib/python3.6/site-packages/redis/connection.py", line 231, in can_read
raise_on_timeout=False)
File "/opt/stackstorm/st2/lib/python3.6/site-packages/redis/connection.py", line 223, in _read_from_socket
(ex.args,))
```