Hello, I've gotten really far in creating a script but now I'm getting a handshake error, the time varies from upon startup to 12 hours later but eventually if I leave my script running long enough I get the error. Any clues as to how to fix it or what I could do? Pretty positive it's not an issue with my internet so I'm out of ideas.
Enter 'q' To quit program: Exception in thread Thread-5:
Traceback (most recent call last):
File "C:\Users\santi\AppData\Local\Programs\Python\Python37\lib\site-packages\urllib3\connectionpool.py", line 710, in urlopen
chunked=chunked,
File "C:\Users\santi\AppData\Local\Programs\Python\Python37\lib\site-packages\urllib3\connectionpool.py", line 386, in _make_request
self._validate_conn(conn)
File "C:\Users\santi\AppData\Local\Programs\Python\Python37\lib\site-packages\urllib3\connectionpool.py", line 1042, in _validate_conn
conn.connect()
File "C:\Users\santi\AppData\Local\Programs\Python\Python37\lib\site-packages\urllib3\connection.py", line 429, in connect
tls_in_tls=tls_intls,
File "C:\Users\santi\AppData\Local\Programs\Python\Python37\lib\site-packages\urllib3\util\ssl.py", line 450, in ssl_wrap_socket
sock, context, tls_in_tls, server_hostname=serverhostname
File "C:\Users\santi\AppData\Local\Programs\Python\Python37\lib\site-packages\urllib3\util\ssl.py", line 493, in _ssl_wrap_socket_impl
return ssl_context.wrap_socket(sock, server_hostname=server_hostname)
File "C:\Users\santi\AppData\Local\Programs\Python\Python37\lib\ssl.py", line 423, in wrap_socket
session=session
File "C:\Users\santi\AppData\Local\Programs\Python\Python37\lib\ssl.py", line 870, in _create
self.do_handshake()
File "C:\Users\santi\AppData\Local\Programs\Python\Python37\lib\ssl.py", line 1139, in do_handshake
self._sslobj.do_handshake()
ConnectionResetError: [WinError 10054] An existing connection was forcibly closed by the remote host
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\santi\AppData\Local\Programs\Python\Python37\lib\site-packages\requests\adapters.py", line 497, in send
chunked=chunked,
File "C:\Users\santi\AppData\Local\Programs\Python\Python37\lib\site-packages\urllib3\connectionpool.py", line 788, in urlopen
method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
File "C:\Users\santi\AppData\Local\Programs\Python\Python37\lib\site-packages\urllib3\util\retry.py", line 550, in increment
raise six.reraise(type(error), error, _stacktrace)
File "C:\Users\santi\AppData\Local\Programs\Python\Python37\lib\site-packages\urllib3\packages\six.py", line 769, in reraise
raise value.with_traceback(tb)
File "C:\Users\santi\AppData\Local\Programs\Python\Python37\lib\site-packages\urllib3\connectionpool.py", line 710, in urlopen
chunked=chunked,
File "C:\Users\santi\AppData\Local\Programs\Python\Python37\lib\site-packages\urllib3\connectionpool.py", line 386, in _make_request
self._validate_conn(conn)
File "C:\Users\santi\AppData\Local\Programs\Python\Python37\lib\site-packages\urllib3\connectionpool.py", line 1042, in _validate_conn
conn.connect()
File "C:\Users\santi\AppData\Local\Programs\Python\Python37\lib\site-packages\urllib3\connection.py", line 429, in connect
tls_in_tls=tls_intls,
File "C:\Users\santi\AppData\Local\Programs\Python\Python37\lib\site-packages\urllib3\util\ssl.py", line 450, in ssl_wrap_socket
sock, context, tls_in_tls, server_hostname=serverhostname
File "C:\Users\santi\AppData\Local\Programs\Python\Python37\lib\site-packages\urllib3\util\ssl.py", line 493, in _ssl_wrap_socket_impl
return ssl_context.wrap_socket(sock, server_hostname=server_hostname)
File "C:\Users\santi\AppData\Local\Programs\Python\Python37\lib\ssl.py", line 423, in wrap_socket
session=session
File "C:\Users\santi\AppData\Local\Programs\Python\Python37\lib\ssl.py", line 870, in _create
self.do_handshake()
File "C:\Users\santi\AppData\Local\Programs\Python\Python37\lib\ssl.py", line 1139, in do_handshake
self._sslobj.do_handshake()
urllib3.exceptions.ProtocolError: ('Connection aborted.', ConnectionResetError(10054, 'An existing connection was forcibly closed by the remote host', None, 10054, None))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\santi\AppData\Local\Programs\Python\Python37\lib\threading.py", line 926, in _bootstrap_inner
self.run()
File "C:\Users\santi\AppData\Local\Programs\Python\Python37\lib\threading.py", line 870, in run
self._target(*self._args, self._kwargs)
File "C:\Users\santi\OneDrive\Desktop\webot\weball2.py", line 392, in holding_thread
positions = wb_client.get_positions()
File "C:\Users\santi\AppData\Local\Programs\Python\Python37\lib\site-packages\webull\webull.py", line 344, in get_positions
data = self.get_account()
File "C:\Users\santi\AppData\Local\Programs\Python\Python37\lib\site-packages\webull\webull.py", line 336, in get_account
response = requests.get(self._urls.account(self._account_id), headers=headers, timeout=self.timeout)
File "C:\Users\santi\AppData\Local\Programs\Python\Python37\lib\site-packages\requests\api.py", line 73, in get
return request("get", url, params=params, kwargs)
File "C:\Users\santi\AppData\Local\Programs\Python\Python37\lib\site-packages\requests\api.py", line 59, in request
return session.request(method=method, url=url, kwargs)
File "C:\Users\santi\AppData\Local\Programs\Python\Python37\lib\site-packages\requests\sessions.py", line 589, in request
resp = self.send(prep, send_kwargs)
File "C:\Users\santi\AppData\Local\Programs\Python\Python37\lib\site-packages\requests\sessions.py", line 703, in send
r = adapter.send(request, **kwargs)
File "C:\Users\santi\AppData\Local\Programs\Python\Python37\lib\site-packages\requests\adapters.py", line 501, in send
raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionResetError(10054, 'An existing connection was forcibly closed by the remote host', None, 10054, None))
Hello, I've gotten really far in creating a script but now I'm getting a handshake error, the time varies from upon startup to 12 hours later but eventually if I leave my script running long enough I get the error. Any clues as to how to fix it or what I could do? Pretty positive it's not an issue with my internet so I'm out of ideas.
Enter 'q' To quit program: Exception in thread Thread-5: Traceback (most recent call last): File "C:\Users\santi\AppData\Local\Programs\Python\Python37\lib\site-packages\urllib3\connectionpool.py", line 710, in urlopen chunked=chunked, File "C:\Users\santi\AppData\Local\Programs\Python\Python37\lib\site-packages\urllib3\connectionpool.py", line 386, in _make_request self._validate_conn(conn) File "C:\Users\santi\AppData\Local\Programs\Python\Python37\lib\site-packages\urllib3\connectionpool.py", line 1042, in _validate_conn conn.connect() File "C:\Users\santi\AppData\Local\Programs\Python\Python37\lib\site-packages\urllib3\connection.py", line 429, in connect tls_in_tls=tls_intls, File "C:\Users\santi\AppData\Local\Programs\Python\Python37\lib\site-packages\urllib3\util\ssl.py", line 450, in ssl_wrap_socket sock, context, tls_in_tls, server_hostname=serverhostname File "C:\Users\santi\AppData\Local\Programs\Python\Python37\lib\site-packages\urllib3\util\ssl.py", line 493, in _ssl_wrap_socket_impl return ssl_context.wrap_socket(sock, server_hostname=server_hostname) File "C:\Users\santi\AppData\Local\Programs\Python\Python37\lib\ssl.py", line 423, in wrap_socket session=session File "C:\Users\santi\AppData\Local\Programs\Python\Python37\lib\ssl.py", line 870, in _create self.do_handshake() File "C:\Users\santi\AppData\Local\Programs\Python\Python37\lib\ssl.py", line 1139, in do_handshake self._sslobj.do_handshake() ConnectionResetError: [WinError 10054] An existing connection was forcibly closed by the remote host
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "C:\Users\santi\AppData\Local\Programs\Python\Python37\lib\site-packages\requests\adapters.py", line 497, in send chunked=chunked, File "C:\Users\santi\AppData\Local\Programs\Python\Python37\lib\site-packages\urllib3\connectionpool.py", line 788, in urlopen method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2] File "C:\Users\santi\AppData\Local\Programs\Python\Python37\lib\site-packages\urllib3\util\retry.py", line 550, in increment raise six.reraise(type(error), error, _stacktrace) File "C:\Users\santi\AppData\Local\Programs\Python\Python37\lib\site-packages\urllib3\packages\six.py", line 769, in reraise raise value.with_traceback(tb) File "C:\Users\santi\AppData\Local\Programs\Python\Python37\lib\site-packages\urllib3\connectionpool.py", line 710, in urlopen chunked=chunked, File "C:\Users\santi\AppData\Local\Programs\Python\Python37\lib\site-packages\urllib3\connectionpool.py", line 386, in _make_request self._validate_conn(conn) File "C:\Users\santi\AppData\Local\Programs\Python\Python37\lib\site-packages\urllib3\connectionpool.py", line 1042, in _validate_conn conn.connect() File "C:\Users\santi\AppData\Local\Programs\Python\Python37\lib\site-packages\urllib3\connection.py", line 429, in connect tls_in_tls=tls_intls, File "C:\Users\santi\AppData\Local\Programs\Python\Python37\lib\site-packages\urllib3\util\ssl.py", line 450, in ssl_wrap_socket sock, context, tls_in_tls, server_hostname=serverhostname File "C:\Users\santi\AppData\Local\Programs\Python\Python37\lib\site-packages\urllib3\util\ssl.py", line 493, in _ssl_wrap_socket_impl return ssl_context.wrap_socket(sock, server_hostname=server_hostname) File "C:\Users\santi\AppData\Local\Programs\Python\Python37\lib\ssl.py", line 423, in wrap_socket session=session File "C:\Users\santi\AppData\Local\Programs\Python\Python37\lib\ssl.py", line 870, in _create self.do_handshake() File "C:\Users\santi\AppData\Local\Programs\Python\Python37\lib\ssl.py", line 1139, in do_handshake self._sslobj.do_handshake() urllib3.exceptions.ProtocolError: ('Connection aborted.', ConnectionResetError(10054, 'An existing connection was forcibly closed by the remote host', None, 10054, None))
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "C:\Users\santi\AppData\Local\Programs\Python\Python37\lib\threading.py", line 926, in _bootstrap_inner self.run() File "C:\Users\santi\AppData\Local\Programs\Python\Python37\lib\threading.py", line 870, in run self._target(*self._args, self._kwargs) File "C:\Users\santi\OneDrive\Desktop\webot\weball2.py", line 392, in holding_thread positions = wb_client.get_positions() File "C:\Users\santi\AppData\Local\Programs\Python\Python37\lib\site-packages\webull\webull.py", line 344, in get_positions data = self.get_account() File "C:\Users\santi\AppData\Local\Programs\Python\Python37\lib\site-packages\webull\webull.py", line 336, in get_account response = requests.get(self._urls.account(self._account_id), headers=headers, timeout=self.timeout) File "C:\Users\santi\AppData\Local\Programs\Python\Python37\lib\site-packages\requests\api.py", line 73, in get return request("get", url, params=params, kwargs) File "C:\Users\santi\AppData\Local\Programs\Python\Python37\lib\site-packages\requests\api.py", line 59, in request return session.request(method=method, url=url, kwargs) File "C:\Users\santi\AppData\Local\Programs\Python\Python37\lib\site-packages\requests\sessions.py", line 589, in request resp = self.send(prep, send_kwargs) File "C:\Users\santi\AppData\Local\Programs\Python\Python37\lib\site-packages\requests\sessions.py", line 703, in send r = adapter.send(request, **kwargs) File "C:\Users\santi\AppData\Local\Programs\Python\Python37\lib\site-packages\requests\adapters.py", line 501, in send raise ConnectionError(err, request=request) requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionResetError(10054, 'An existing connection was forcibly closed by the remote host', None, 10054, None))