Hi, 75% of the time when my python script runs on the python anywhere server I get the exceptions below. This has never happened when I run locally, but I am really at a loss why it is occurring on the server. Can somebody shed some light here?
Traceback (most recent call last):
File "/usr/lib/python3.7/site-packages/urllib3/contrib/pyopenssl.py", line 444, in wrap_socket
cnx.do_handshake()
File "/usr/lib/python3.7/site-packages/OpenSSL/SSL.py", line 1907, in do_handshake
self._raise_ssl_error(self._ssl, result)
File "/usr/lib/python3.7/site-packages/OpenSSL/SSL.py", line 1631, in _raise_ssl_error
raise SysCallError(errno, errorcode.get(errno))
OpenSSL.SSL.SysCallError: (110, 'ETIMEDOUT')
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.7/site-packages/urllib3/connectionpool.py", line 600, in urlopen
chunked=chunked)
File "/usr/lib/python3.7/site-packages/urllib3/connectionpool.py", line 343, in _make_request
self._validate_conn(conn)
File "/usr/lib/python3.7/site-packages/urllib3/connectionpool.py", line 849, in _validate_conn
conn.connect()
File "/usr/lib/python3.7/site-packages/urllib3/connection.py", line 356, in connect
ssl_context=context)
File "/usr/lib/python3.7/site-packages/urllib3/util/ssl_.py", line 359, in ssl_wrap_socket
return context.wrap_socket(sock, server_hostname=server_hostname)
File "/usr/lib/python3.7/site-packages/urllib3/contrib/pyopenssl.py", line 450, in wrap_socket
raise ssl.SSLError('bad handshake: %r' % e)
ssl.SSLError: ("bad handshake: SysCallError(110, 'ETIMEDOUT')",)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.7/site-packages/requests/adapters.py", line 445, in send
timeout=timeout
File "/usr/lib/python3.7/site-packages/urllib3/connectionpool.py", line 638, in urlopen
_stacktrace=sys.exc_info()[2])
File "/usr/lib/python3.7/site-packages/urllib3/util/retry.py", line 398, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='api.tdameritrade.com', port=443): Max retries exceeded with url: /v1/marketdata/NFLX/quotes?apikey=ALEXRWILLIAM (Caused by SSLError(SSLError("bad handshake: SysCallError(110, 'ETIMEDOUT')")))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/alexrwilliam/Ameritrade.py", line 161, in <module>
DATA = DATA.append(pd.DataFrame(get_quotes('NFLX')['NFLX'],index=[0]))
File "/home/alexrwilliam/Ameritrade.py", line 142, in get_quotes
quote = request_data(ticker_url)
File "/home/alexrwilliam/Ameritrade.py", line 124, in request_data
response = requests.get(url, headers=headers, params=params)
File "/usr/lib/python3.7/site-packages/requests/api.py", line 72, in get
return request('get', url, params=params, **kwargs)
File "/usr/lib/python3.7/site-packages/requests/api.py", line 58, in request
return session.request(method=method, url=url, **kwargs)
File "/usr/lib/python3.7/site-packages/requests/sessions.py", line 512, in request
resp = self.send(prep, **send_kwargs)
File "/usr/lib/python3.7/site-packages/requests/sessions.py", line 622, in send
r = adapter.send(request, **kwargs)
File "/usr/lib/python3.7/site-packages/requests/adapters.py", line 511, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='api.tdameritrade.com', port=443): Max retries exceeded with url: /v1/marketdata/NFLX/quotes?apikey=ALEXRWILLIAM (Caused by SSLError(SSLError("bad handshake: SysCallError(110, 'ETIMEDOUT')")))
2019-07-10 13:52:31 -- Completed task, took 1312.00 seconds, return code was 1.
[edit by admin: formatting]