SSL error

shubham
shubham edited October 2017 in Python client
Python script runs for few minutes and gives this error :


Traceback (most recent call last):

File "", line 1, in
runfile('C:/Users/Shubham/SMI.py', wdir='C:/Users/Shubham')

File "C:\Users\Shubham\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 710, in runfile
execfile(filename, namespace)

File "C:\Users\Shubham\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 101, in execfile
exec(compile(f.read(), filename, 'exec'), namespace)

File "C:/Users/Shubham/SMI.py", line 224, in
strategy()

File "C:/Users/Shubham/SMI.py", line 97, in strategy
tick = tickdata()

File "C:/Users/Shubham/SMI.py", line 16, in tickdata
r = requests.get('https://api.kite.trade/instruments/NSE/RELCAPITAL?api_key&access_token')

File "C:\Users\Shubham\Anaconda3\lib\site-packages\requests\api.py", line 72, in get
return request('get', url, params=params, **kwargs)

File "C:\Users\Shubham\Anaconda3\lib\site-packages\requests\api.py", line 58, in request
return session.request(method=method, url=url, **kwargs)

File "C:\Users\Shubham\Anaconda3\lib\site-packages\requests\sessions.py", line 508, in request
resp = self.send(prep, **send_kwargs)

File "C:\Users\Shubham\Anaconda3\lib\site-packages\requests\sessions.py", line 618, in send
r = adapter.send(request, **kwargs)

File "C:\Users\Shubham\Anaconda3\lib\site-packages\requests\adapters.py", line 506, in send
raise SSLError(e, request=request)

SSLError: HTTPSConnectionPool(host='api.kite.trade', port=443): Max retries exceeded with url: /instruments/NSE/RELCAPITAL?api_key=vpnp4jb4qq36filo&access_token=abcdefghijklmnopqrstuvwxyz (Caused by SSLError(SSLError("bad handshake: SysCallError(-1, 'Unexpected EOF')",),))
  • tonystark
    Hi @shubham,

    It looks like you are getting rate limited. If you make more than 3 requests per second you will HTTP 429 status response. Can you check the status code of the responses?
  • shubham
    i am asking for data for every 1 sec by using time.sleep()
    so i think its something else
  • cisk
    Hi,
    Even I'm facing this issue. I've observed the issue to be common during 3-3.30pm. Attaching logs
Sign In or Register to comment.