-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Time out? #34
Comments
I have same issue, finnhub_client.aggregate_indicator fails half of the time |
I have the same issue with pattern_recognition. Is there no way to increase the timeout value? |
@enoch-prince , @jasonpolstein , @dejoski EDIT: So now instead of a read timeout, I'm running into a 504: Gateway time-out from the API. Seems that Finnhub may not be able to keep up with API requests.... Great service in theory but I may be moving onto different API until Finnhub can resolve these issues. |
I am still having the issues mentioned above. Has there been no fix for this? |
New to Finnhub. I am running the following simple code and getting an error message. What is causing this?
CODE
import finnhub
import time
import datetime
import pandas as pd
Setup client
finnhub_client = finnhub.Client(api_key="XXXXXXXXXXXXX")
Stock candles
res = finnhub_client.stock_candles('AAPL', 'D', 1590988249, 1591852249)
print(res)
ERROR MESSAGE
Traceback (most recent call last):
File "/Users/jasonpolstein/opt/anaconda3/lib/python3.8/site-packages/urllib3/connectionpool.py", line 426, in _make_request
six.raise_from(e, None)
File "", line 3, in raise_from
File "/Users/jasonpolstein/opt/anaconda3/lib/python3.8/site-packages/urllib3/connectionpool.py", line 421, in _make_request
httplib_response = conn.getresponse()
File "/Users/jasonpolstein/opt/anaconda3/lib/python3.8/http/client.py", line 1332, in getresponse
response.begin()
File "/Users/jasonpolstein/opt/anaconda3/lib/python3.8/http/client.py", line 303, in begin
version, status, reason = self._read_status()
File "/Users/jasonpolstein/opt/anaconda3/lib/python3.8/http/client.py", line 264, in _read_status
line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
File "/Users/jasonpolstein/opt/anaconda3/lib/python3.8/socket.py", line 669, in readinto
return self._sock.recv_into(b)
File "/Users/jasonpolstein/opt/anaconda3/lib/python3.8/ssl.py", line 1241, in recv_into
return self.read(nbytes, buffer)
File "/Users/jasonpolstein/opt/anaconda3/lib/python3.8/ssl.py", line 1099, in read
return self._sslobj.read(len, buffer)
socket.timeout: The read operation timed out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/jasonpolstein/opt/anaconda3/lib/python3.8/site-packages/requests/adapters.py", line 439, in send
resp = conn.urlopen(
File "/Users/jasonpolstein/opt/anaconda3/lib/python3.8/site-packages/urllib3/connectionpool.py", line 724, in urlopen
retries = retries.increment(
File "/Users/jasonpolstein/opt/anaconda3/lib/python3.8/site-packages/urllib3/util/retry.py", line 403, in increment
raise six.reraise(type(error), error, _stacktrace)
File "/Users/jasonpolstein/opt/anaconda3/lib/python3.8/site-packages/urllib3/packages/six.py", line 735, in reraise
raise value
File "/Users/jasonpolstein/opt/anaconda3/lib/python3.8/site-packages/urllib3/connectionpool.py", line 670, in urlopen
httplib_response = self._make_request(
File "/Users/jasonpolstein/opt/anaconda3/lib/python3.8/site-packages/urllib3/connectionpool.py", line 428, in _make_request
self._raise_timeout(err=e, url=url, timeout_value=read_timeout)
File "/Users/jasonpolstein/opt/anaconda3/lib/python3.8/site-packages/urllib3/connectionpool.py", line 335, in _raise_timeout
raise ReadTimeoutError(
urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='finnhub.io', port=443): Read timed out. (read timeout=10)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "timeout-test.py", line 11, in
res = finnhub_client.stock_candles('AAPL', 'D', 1590988249, 1591852249)
File "/Users/jasonpolstein/opt/anaconda3/lib/python3.8/site-packages/finnhub/client.py", line 206, in stock_candles
return self._get("/stock/candle", params=params)
File "/Users/jasonpolstein/opt/anaconda3/lib/python3.8/site-packages/finnhub/client.py", line 69, in _get
return self._request("get", path, **kwargs)
File "/Users/jasonpolstein/opt/anaconda3/lib/python3.8/site-packages/finnhub/client.py", line 38, in _request
response = getattr(self._session, method)(uri, **kwargs)
File "/Users/jasonpolstein/opt/anaconda3/lib/python3.8/site-packages/requests/sessions.py", line 543, in get
return self.request('GET', url, **kwargs)
File "/Users/jasonpolstein/opt/anaconda3/lib/python3.8/site-packages/requests/sessions.py", line 530, in request
resp = self.send(prep, **send_kwargs)
File "/Users/jasonpolstein/opt/anaconda3/lib/python3.8/site-packages/requests/sessions.py", line 643, in send
r = adapter.send(request, **kwargs)
File "/Users/jasonpolstein/opt/anaconda3/lib/python3.8/site-packages/requests/adapters.py", line 529, in send
raise ReadTimeout(e, request=request)
requests.exceptions.ReadTimeout: HTTPSConnectionPool(host='finnhub.io', port=443): Read timed out. (read timeout=10)
The text was updated successfully, but these errors were encountered: