Connection errors

occasionally get the following crashes in my REST API code after running for a few hours:
any ideas, gratefully received, thanks

TimeoutError Traceback (most recent call last)
~\AppData\Local\Programs\Python\Python36-32\lib\site-packages\requests\packages\urllib3\connection.py in _new_conn(self)
140 conn = connection.create_connection(
–> 141 (self.host, self.port), self.timeout, **extra_kw)
142

~\AppData\Local\Programs\Python\Python36-32\lib\site-packages\requests\packages\urllib3\util\connection.py in create_connection(address, timeout, source_address, socket_options)
82 if err is not None:
—> 83 raise err
84

~\AppData\Local\Programs\Python\Python36-32\lib\site-packages\requests\packages\urllib3\util\connection.py in create_connection(address, timeout, source_address, socket_options)
72 sock.bind(source_address)
—> 73 sock.connect(sa)
74 return sock

TimeoutError: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond

During handling of the above exception, another exception occurred:

NewConnectionError Traceback (most recent call last)
~\AppData\Local\Programs\Python\Python36-32\lib\site-packages\requests\packages\urllib3\connectionpool.py in urlopen(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, **response_kw)
599 body=body, headers=headers,
–> 600 chunked=chunked)
601

~\AppData\Local\Programs\Python\Python36-32\lib\site-packages\requests\packages\urllib3\connectionpool.py in _make_request(self, conn, method, url, timeout, chunked, **httplib_request_kw)
344 try:
–> 345 self._validate_conn(conn)
346 except (SocketTimeout, BaseSSLError) as e:

~\AppData\Local\Programs\Python\Python36-32\lib\site-packages\requests\packages\urllib3\connectionpool.py in _validate_conn(self, conn)
843 if not getattr(conn, ‘sock’, None): # AppEngine might not have .sock
–> 844 conn.connect()
845

@Femi.lewis looking into this on our side, but quick question: are you connecting via demo or live?

Hi @QN_Liza its the demo account

Thank you, and are you using the python wrapper to connect? If you could provide the snippet of your code showing how you establish connection that would be helpful.

Yes using wrapper code

Hi @Femi.lewis we are trying to replicate the error. Could you provide the code you are using to connect?

hi @QN_Liza

yes here it is

Connect to FXCM API

Connect to FXCM API

con = fxcmpy.fxcmpy(config_file=‘C:/Users/femi/AppData/Local/Programs/Python/Python36-32/fxcm.cfg’)

and this is the bit I use to get the data
new_pricedata = con.get_candles(symbol1, period=timeframe, number=numberofcandles)

bit to work out todays % rise/fall

prcdata = con.get_candles(sym , period = timeframe)
prcdata2 = con.get_candles(sym, period = ‘D1’)

Timeframe is m1 an candles is 300

do issues exist on the demo account…
as I received another timeout connection error this morning on the demo account at 03:00 am, see error below

Version:1.0 StartHTML:000000214 EndHTML:000077133 StartFragment:000073987 EndFragment:000077035 StartSelection:000073987 EndSelection:000077035 SourceURL:http://localhost:8888/notebooks/test-strategy.ipynb

--------------------------------------------------------------------------- TimeoutError Traceback (most recent call last) ~\AppData\Local\Programs\Python\Python36-32\lib\site-packages\requests\packages\urllib3\connection.py in _new_conn(self) 140 conn = connection.create_connection( --> 141 (self.host, self.port), self.timeout, **extra_kw) 142 ~\AppData\Local\Programs\Python\Python36-32\lib\site-packages\requests\packages\urllib3\util\connection.py in create_connection(address, timeout, source_address, socket_options) 82 if err is not None: —> 83 raise err 84 ~\AppData\Local\Programs\Python\Python36-32\lib\site-packages\requests\packages\urllib3\util\connection.py in create_connection(address, timeout, source_address, socket_options) 72 sock.bind(source_address) —> 73 sock.connect(sa) 74 return sock TimeoutError: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond During handling of the above exception, another exception occurred:

@QN_Liza just to add it crashes after a few hours of running an not straightaway

@Femi.lewis it sounds like the cause of the crashing could be due to network issues. As a test could you please run the following in your cmd prompt?

telnet api-demo.fxcm.com 443
tracert api-demo.fxcm.com

hi @QN_Liza

Telnet works an opens up a blank screen

Tracert works an uses 11 hops over 84ms

@Femi.lewis hmm, not sure what exactly is causing the problem. Can you revoke your token and generate a new one?

Ok will generate a new token