Error for Portfolio/positions API when getting called from apscheduler>BackgroundScheduler

deepaknesarikar
I am calling positions api every 30 mins to verify total PnL of my positons. Calling it directly is working fine. But when its getting called from python apscheduler>BackgroundScheduler its giving below error.

SSLError(MaxRetryError("HTTPSConnectionPool(host='api.kite.trade', port=443): Max retries exceeded with url: /portfolio/positions (Caused by SSLError(SSLEOFError(8, '[SSL: UNEXPECTED_EOF_WHILE_READING] EOF occurred in violation of protocol (_ssl.c:1002)')))"))}

After failing 4-5 times, it starts working.

What should be done
  • rakeshr
    Caused by SSLError(SSLEOFError(8, '[SSL: UNEXPECTED_EOF_WHILE_READING] EOF occurred in violation of protocol (_ssl.c:1002)')))"))
    Looks like, related to OpenSSL. This thread might be helpful.
Sign In or Register to comment.