This repository was archived by the owner on Mar 18, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 46
This repository was archived by the owner on Mar 18, 2025. It is now read-only.
socket.error: [Errno 54] Connection reset by peer #135
Copy link
Copy link
Open
Description
Hey team, I'm running the following code:
import signalfx
token = 'my token'
signalflow_program = "my program"
signalflow_client = signalfx.SignalFx().signalflow(token=token, endpoint="my endpoint")
try:
print('Executing {0} ...'.format(signalflow_program))
computation = signalflow_client.execute(signalflow_program)
for msg in computation.stream():
print("test")
if isinstance(msg, signalfx.signalflow.messages.DataMessage):
print('{0}: {1}'.format(msg.logical_timestamp_ms, msg.data))
if isinstance(msg, signalfx.signalflow.messages.EventMessage):
print('{0}: {1}'.format(msg.timestamp_ms, msg.properties))
finally:
signalflow_client.close()
But I'm getting this error:
Traceback (most recent call last):
File "/Users/PycharmProjects/pythonRateLimits27/main.py", line 9, in <module>
computation = signalflow_client.execute(signalflow_program)
File "/Users/.conda/envs/pythonRateLimits27/lib/python2.7/site-packages/signalfx/signalflow/__init__.py", line 52, in execute
c = computation.Computation(exec_fn)
File "/Users/.conda/envs/pythonRateLimits27/lib/python3.7/site-packages/signalfx/signalflow/computation.py", line 43, in __init__
self._stream = self._execute()
File "/Users/.conda/envs/pythonRateLimits27/lib/python3.7/site-packages/signalfx/signalflow/computation.py", line 46, in _execute
return self._exec_fn(self._last_logical_ts)
File "/Users/.conda/envs/pythonRateLimits27/lib/python3.7/site-packages/signalfx/signalflow/__init__.py", line 50, in exec_fn
return self._transport.execute(program, params)
File "/Users/.conda/envs/pythonRateLimits27/lib/python3.7/site-packages/signalfx/signalflow/ws.py", line 73, in execute
self._send(request)
File "/Users/.conda/envs/pythonRateLimits27/lib/python3.7/site-packages/signalfx/signalflow/ws.py", line 141, in _send
self.connect()
File "/Users/.conda/envs/pythonRateLimits27/lib/python3.7/site-packages/ws4py/client/__init__.py", line 217, in connect
self.sock.connect(self.bind_addr)
File "/Users/.conda/envs/pythonRateLimits27/lib/python3.7/ssl.py", line 864, in connect
self._real_connect(addr, False)
File "/Users/.conda/envs/pythonRateLimits27/lib/python3.7/ssl.py", line 855, in _real_connect
self.do_handshake()
File "/Users/.conda/envs/pythonRateLimits27/lib/python3.7/ssl.py", line 828, in do_handshake
self._sslobj.do_handshake()
socket.error: [Errno 54] Connection reset by peer
Using CURL works correctly. Could you shed any light to solve this? Thanks in advance!
Metadata
Metadata
Assignees
Labels
No labels