Getting error while getting instrument for NSE.

vukumail
vukumail edited May 2023 in Python client
I fetch instrument list once in 24 hours. But now it is giving this error quite frequently.

Error log

Traceback (most recent call last):
File "/root/AlgoApp/src/instruments/Instruments.py", line 61, in fetchInstrumentsFromServer
instrumentsList = brokerHandle.instruments('NSE')
File "/usr/local/lib/python3.7/site-packages/kiteconnect/connect.py", line 555, in instruments
return self._parse_instruments(self._get("market.instruments", url_args={"exchange": exchange}))
File "/usr/local/lib/python3.7/site-packages/kiteconnect/connect.py", line 836, in _get
return self._request(route, "GET", url_args=url_args, params=params, is_json=is_json)
File "/usr/local/lib/python3.7/site-packages/kiteconnect/connect.py", line 920, in _request
content=r.content))
kiteconnect.exceptions.DataException: Unknown Content-Type (application/xml) with response: (b'\nInvalidArgumentUnsupported Authorization TypeAuthorizationtoken 04z734e8r2c62xh9:pnh40p5Gvgrq3hTX5mAhT3k84wwczsWfHMK6XMSW3674M8TJjeLMjlNlhFMEf+6V12TqbXf2y/1fNv3M+g/UK+HOESdyks2KGWSvSCQ8Y9XTw+kNqyXXALeSl4Q=')
  • aneesh2312
    I am also seeing the same error. It works after retrying 5-6 times. I don't think this is related to rate-limiting at all as in my flow, I do this immediately after user logs in, with a delay of 15 seconds added for good measure.
    It seems to happen more frequently during morning (or at least I am not able to reproduce it at night time).

    Can someone please help?
  • sujith
    Is this still happening? We had informed the team to take a look at this.
  • vukumail
    Now it is not happening. Earlier it is used to happen but it was handled by my retry mechanism which tries to call 3 times with a back-off of 5 seconds.

    This time it failed for 15-20 times. I retried by logging in multiple times.
Sign In or Register to comment.