Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

socket.error: [Errno 54] Connection reset by peer #135

Open
Fravieror opened this issue Nov 9, 2022 · 0 comments
Open

socket.error: [Errno 54] Connection reset by peer #135

Fravieror opened this issue Nov 9, 2022 · 0 comments

Comments

@Fravieror
Copy link

Fravieror commented Nov 9, 2022

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant