tg12/FAIG

TimeoutError: [Errno 60] Operation timed out error

Closed this issue · 6 comments

I get the following message which refers to 'DEBUG' and another which looks like a time out. Any help on what these means please?

No Trade This time
!!DEBUG shortPositionPercentage:57.0 longPositionPercentage:43.0 clientsentiment_value:69.0 hightrend_watermark:89.0
CS.D.AUDJPY.TODAY.IP: Price change -0.1%
CS.D.GBPSGD.TODAY.IP: Price change 0.07%
CS.D.USDSGD.TODAY.IP: Price change 0.18%
CS.D.GBPZAR.TODAY.IPTraceback (most recent call last):
File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 1318, in do_open
encode_chunked=req.has_header('Transfer-encoding'))
File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 1239, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 1285, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 1234, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 1026, in _send_output
self.send(msg)
File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 964, in send
self.connect()
File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 1392, in connect
super().connect()
File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 936, in connect
(self.host,self.port), self.timeout, self.source_address)
File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/socket.py", line 724, in create_connection
raise err
File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/socket.py", line 713, in create_connection
sock.connect(sa)
TimeoutError: [Errno 60] Operation timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Users/charlesglah/FAIG-master/faig.py", line 12, in
d = api.find_next_trade()
File "/Users/charlesglah/FAIG-master/ig.py", line 128, in find_next_trade
res = self.fetch_current_price(epic_id)
File "/Users/charlesglah/FAIG-master/ig.py", line 71, in fetch_current_price
res = self.igstreamclient.fetch_one(subscription)
File "/Users/charlesglah/FAIG-master/igstream.py", line 461, in fetch_one
self.unsubscribe(sub_key)
File "/Users/charlesglah/FAIG-master/igstream.py", line 478, in unsubscribe
self.lightstreamer_client.unsubscribe(sub_key)
File "/Users/charlesglah/FAIG-master/igstream.py", line 322, in unsubscribe
"LS_op": OP['DELETE']
File "/Users/charlesglah/FAIG-master/igstream.py", line 189, in _control
response = self._call(self._control_url, CONTROL_URL_PATH, params)
File "/Users/charlesglah/FAIG-master/igstream.py", line 170, in _call
return _urlopen(url, data=self._encode_params(body))
File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 223, in urlopen
return opener.open(url, data, timeout)
File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 526, in open
response = self._open(req, data)
File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 544, in _open
'_open', req)
File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 504, in _call_chain
result = func(*args)
File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 1361, in https_open
context=self._context, check_hostname=self._check_hostname)
File "/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 1320, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error [Errno 60] Operation timed out>

tg12 commented

It could be related to this.

https://labs.ig.com/faq

Why am I getting a Bad Request 400 on all DELETE operations?
Some HTTP client libraries do not support DELETE operations with a request body. Try using a POST operation instead, and add the header _method: DELETE

Or it could be your connection to IG Index servers, Have you done any latency tests? Where are you running it?

tg12 commented

Just a ping will do ;-)

The Endpoint is that of the API, The Application Programming Endpoint's. You would need to connect to it programatically (i.e with this script or any other) rather than a browser. So if you have network connectivity then I would suggest you verify your information with the API Companion.

https://labs.ig.com/sample-apps/api-companion/index.html

This is a great resource to see to match what you see returning from any script or program is indeed right.

tg12 commented

Changed it to TimeoutError: [Errno 60] Operation timed out from "bug", Bug is misleading and none descriptive.

tg12 commented

Potential network connectivity issue, Not related to code.