Frequent 502: Bad gateway error

SITPL
SITPL edited April 2021 in Python client
Hello,

We are getting frequent 502 Bad gateway error

\Python39\lib\site-packages\kiteconnect\connect.py", line 904, in _request
raise ex.DataException("Unknown Content-Type ({content_type}) with response: ({content})".format(
kiteconnect.exceptions.DataException: Unknown Content-Type (text/html) with response: (b'\r\n502 Bad Gateway\r\n\r\n502 Bad Gateway\r\n\r\n\r\n')

This is happening frequently while starting the day after login while downloading the instruments dump.

Works fine post restart though
Tagged:
  • rakeshr
    We are getting frequent 502 Bad gateway error
    Are you trying to download it multiple times without a delay?
    If you are facing this issue frequently, you will need to handle this exception at your end. Have some delay and then try making the request again.
    As the downloaded file is a huge CSV dump, we will recommend you to download this once and store this at your end for further use.
  • SITPL
    We download the dump only once around 935 am. This is the first call of the day to api post login
  • rakeshr
    you will need to handle this exception at your end. Have some delay and then try making the request again.
    As said above, you can try this.
This discussion has been closed.