Gateway Timeout all time

infotrade
Hi,

I am getting below errors most of the time and my algo doesn't execute any order during this time. Do I need to upgrade my subscription to avoid such errors.

Reconnecting
Error: Lost ticker connection.
Reconnecting
Error: Error while connecting. Message: Unable to connect to the remote server
Error: Error while connecting. Message: The remote server returned an error: (403) Forbidden.
Closed ticker
Error: Error while connecting. Message: Unable to connect to the remote server
Error: Error while connecting. Message: The remote server returned an error: (403) Forbidden.
Closed ticker
Reconnecting
Connected ticker
Reconnecting
Error: Lost ticker connection.
Error: Error while connecting. Message: Unable to connect to the remote server
Error: Error while connecting. Message: The remote server returned an error: (403) Forbidden.
Closed ticker
Reconnecting
Reconnecting
Error: Error while connecting. Message: Unable to connect to the remote server
Error: Error while connecting. Message: The remote server returned an error: (403) Forbidden.
Closed ticker
Error: Error while connecting. Message: Unable to connect to the remote server
Error: Error while connecting. Message: The remote server returned an error: (403) Forbidden.
Closed ticker
  • sujith
    This means your session seems to be expired and you need to log in and generate a new access token.
  • infotrade
    Algo stop working in between. Do we need to monitor screen all time to check Timeout or any other error from KITE API? Here is the log from todays' job. It was stopped working on 1:45 PM. Log time are based on EST as server is hosted on US datacenter.

    ==========================================================
    3/1/2019 3:13:29 AM
    OnReconnect: Reconnecting
    ==========================================================
    3/1/2019 3:13:31 AM
    OnError: Lost ticker connection.
    ==========================================================
    3/1/2019 3:13:35 AM
    OnReconnect: Reconnecting
    ==========================================================
    ==========================================================
    3/1/2019 3:13:45 AM
    OnError: Lost ticker connection.
    ==========================================================
    3/1/2019 3:13:50 AM
    OnReconnect: Reconnecting
    ==========================================================
    3/1/2019 3:14:09 AM
    OnReconnect: Reconnecting
    ==========================================================
    3/1/2019 3:14:10 AM
    OnError: Lost ticker connection.
    ==========================================================
    3/1/2019 3:14:43 AM
    ==========================================================
    3/1/2019 3:14:43 AM
    OnError: Lost ticker connection.
  • sujith
    A disconnection could be because of many reasons. It could be the connectivity at the client or server or thread overloaded or some network admin might close a long-standing connection. There are many more possibilities. You can enable reconnection and use it.
  • infotrade
    For enabling re-connection, do we need to authorize API with new token again ? please guide me to handle this condition as this is very critical part of whole code.
  • sujith
    Yes, whenever you are connecting to Kite Ticker, you need a valid access token. If it fails with 403 during reconnection then you should stop reconnection and start a connection with the new access token.
  • infotrade
    Do we have any API to get access token from console application which will fulfill two factor authentication automatically? Long story short, I need to make automation process to get new token and provide to job for re-start whole batch again where it is stopped.
  • sujith
    It is mandatory by the exchange that a user has to log in manually at least once a day. We don't recommend automating
  • infotrade
    Why does same token is not working for further login? It should work as per your forum posted in some of the threads.
    P.S. I am trying after hours.
  • sujith
    You can check out this thread.
This discussion has been closed.