Connection refused while subscribing via Python

1 post / 0 new
maurimo
Connection refused while subscribing via Python

Hello,
I got a 'Connection refused' error while doing a subscribe operation (via Python, even if it doesn't appear to be too python-specific - backtrace follows), and the error persists even retrying a few times (up to 8). Can this happen, or am I doing something wrong? (I am using the demo.) I also noticed that this only happens around 20h UTC, during other moments of the day retrying to connect is generally OK. What is the expected behavior, something like waiting a few seconds and retrying? I would like to be able to have a program that does not need constant human supervision.

Thanks for the help
Kind regards

Traceback (most recent call last):
File "/usr/lib/python3.5/urllib/request.py", line 1254, in do_open
h.request(req.get_method(), req.selector, req.data, headers)
File "/usr/lib/python3.5/http/client.py", line 1107, in request
self._send_request(method, url, body, headers)
File "/usr/lib/python3.5/http/client.py", line 1152, in _send_request
self.endheaders(body)
File "/usr/lib/python3.5/http/client.py", line 1103, in endheaders
self._send_output(message_body)
File "/usr/lib/python3.5/http/client.py", line 934, in _send_output
self.send(msg)
File "/usr/lib/python3.5/http/client.py", line 877, in send
self.connect()
File "/usr/lib/python3.5/http/client.py", line 1253, in connect
super().connect()
File "/usr/lib/python3.5/http/client.py", line 849, in connect
(self.host,self.port), self.timeout, self.source_address)
File "/usr/lib/python3.5/socket.py", line 712, in create_connection
raise err
File "/usr/lib/python3.5/socket.py", line 703, in create_connection
sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "./bot.py", line 94, in
a.act()
File "/home/maurizio/chrysopoeia/agent.py", line 134, in act
self.act_apply_strategy()
File "/home/maurizio/chrysopoeia/agent.py", line 232, in act_apply_strategy
self.watch_key = self.comm.start_watch(self.op.target, self.watch)
File "/home/maurizio/chrysopoeia/communicator_ig.py", line 134, in start_watch
raise e
File "/home/maurizio/chrysopoeia/communicator_ig.py", line 126, in start_watch
key = self.ig_stream_service.ls_client.subscribe(subscription_active)
File "/home/maurizio/.local/lib/python3.5/site-packages/trading_ig-0.0.6-py3.5.egg/trading_ig/lightstreamer.py", line 282,
in subscribe
File "/home/maurizio/.local/lib/python3.5/site-packages/trading_ig-0.0.6-py3.5.egg/trading_ig/lightstreamer.py", line 163,
in _control
File "/home/maurizio/.local/lib/python3.5/site-packages/trading_ig-0.0.6-py3.5.egg/trading_ig/lightstreamer.py", line 144,
in _call
File "/usr/lib/python3.5/urllib/request.py", line 163, in urlopen
return opener.open(url, data, timeout)
File "/usr/lib/python3.5/urllib/request.py", line 466, in open
response = self._open(req, data)
File "/usr/lib/python3.5/urllib/request.py", line 484, in _open
'_open', req)
File "/usr/lib/python3.5/urllib/request.py", line 444, in _call_chain
result = func(*args)
File "/usr/lib/python3.5/urllib/request.py", line 1297, in https_open
context=self._context, check_hostname=self._check_hostname)
File "/usr/lib/python3.5/urllib/request.py", line 1256, in do_open
raise URLError(err)
urllib.error.URLError: