googlemaps / google-maps-services-python

Python client library for Google Maps API Web Services
Apache License 2.0
4.56k stars 1.31k forks source link

Error about [urllib3.exceptions.ProtocolError: ('Connection aborted.', ConnectionResetError(10054, '远程主机强迫关闭了一个现有的连接。', None, 10054, None))] #496

Open sk502887185 opened 1 year ago

sk502887185 commented 1 year ago

PLEASE READ

If you have a support contract with Google, please create an issue in the support console. This will ensure a timely response.

Discover additional support services for the Google Maps Platform, including developer communities, technical guidance, and expert support at the Google Maps Platform support resources page.

If your bug or feature request is not related to this particular library, please visit the Google Maps Platform issue trackers.

Check for answers on StackOverflow with the google-maps tag.


The request in my code is:

vivo_client = googlemaps.Client(key='AIzaSyB9ZFOSv4U-QMJ-I-IeeVGRZf1zy_Im0iQ') cell_info = [{'cellId': 12828875, 'locationAreaCode': 43531, 'mobileCountryCode': 502, 'mobileNetworkCode': 16}] lat_lng_dict = geolocation.geolocate(client=vivo_client, cell_towers=cell_info)

All error message are like below, In my opinion, this problem is about handshaking failed with Google server.

Please help me about this problem. Thanks a lot.


Traceback (most recent call last): File "F:\ANACONDA\envs\Google_Cell_LatLongitude_Decode\lib\site-packages\urllib3\connectionpool.py", line 703, in urlopen httplib_response = self._make_request( File "F:\ANACONDA\envs\Google_Cell_LatLongitude_Decode\lib\site-packages\urllib3\connectionpool.py", line 386, in _make_request self._validate_conn(conn) File "F:\ANACONDA\envs\Google_Cell_LatLongitude_Decode\lib\site-packages\urllib3\connectionpool.py", line 1042, in _validate_conn conn.connect() File "F:\ANACONDA\envs\Google_Cell_LatLongitude_Decode\lib\site-packages\urllib3\connection.py", line 419, in connect self.sock = ssl_wrap_socket( File "F:\ANACONDA\envs\Google_Cell_LatLongitudeDecode\lib\site-packages\urllib3\util\ssl.py", line 449, in ssl_wrap_socket ssl_sock = _ssl_wrap_socket_impl( File "F:\ANACONDA\envs\Google_Cell_LatLongitudeDecode\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 "F:\ANACONDA\envs\Google_Cell_LatLongitude_Decode\lib\ssl.py", line 501, in wrap_socket return self.sslsocket_class._create( File "F:\ANACONDA\envs\Google_Cell_LatLongitude_Decode\lib\ssl.py", line 1041, in _create self.do_handshake() File "F:\ANACONDA\envs\Google_Cell_LatLongitude_Decode\lib\ssl.py", line 1310, in do_handshake self._sslobj.do_handshake() ConnectionResetError: [WinError 10054] 远程主机强迫关闭了一个现有的连接。

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "D:\Users\11137018\PycharmProjects\Google_Cell_LatLongitude_Decode\requests\adapters.py", line 439, in send resp = conn.urlopen( File "F:\ANACONDA\envs\Google_Cell_LatLongitude_Decode\lib\site-packages\urllib3\connectionpool.py", line 787, in urlopen retries = retries.increment( File "F:\ANACONDA\envs\Google_Cell_LatLongitude_Decode\lib\site-packages\urllib3\util\retry.py", line 550, in increment raise six.reraise(type(error), error, _stacktrace) File "F:\ANACONDA\envs\Google_Cell_LatLongitude_Decode\lib\site-packages\urllib3\packages\six.py", line 769, in reraise raise value.with_traceback(tb) File "F:\ANACONDA\envs\Google_Cell_LatLongitude_Decode\lib\site-packages\urllib3\connectionpool.py", line 703, in urlopen httplib_response = self._make_request( File "F:\ANACONDA\envs\Google_Cell_LatLongitude_Decode\lib\site-packages\urllib3\connectionpool.py", line 386, in _make_request self._validate_conn(conn) File "F:\ANACONDA\envs\Google_Cell_LatLongitude_Decode\lib\site-packages\urllib3\connectionpool.py", line 1042, in _validate_conn conn.connect() File "F:\ANACONDA\envs\Google_Cell_LatLongitude_Decode\lib\site-packages\urllib3\connection.py", line 419, in connect self.sock = ssl_wrap_socket( File "F:\ANACONDA\envs\Google_Cell_LatLongitudeDecode\lib\site-packages\urllib3\util\ssl.py", line 449, in ssl_wrap_socket ssl_sock = _ssl_wrap_socket_impl( File "F:\ANACONDA\envs\Google_Cell_LatLongitudeDecode\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 "F:\ANACONDA\envs\Google_Cell_LatLongitude_Decode\lib\ssl.py", line 501, in wrap_socket return self.sslsocket_class._create( File "F:\ANACONDA\envs\Google_Cell_LatLongitude_Decode\lib\ssl.py", line 1041, in _create self.do_handshake() File "F:\ANACONDA\envs\Google_Cell_LatLongitude_Decode\lib\ssl.py", line 1310, in do_handshake self._sslobj.do_handshake() urllib3.exceptions.ProtocolError: ('Connection aborted.', ConnectionResetError(10054, '远程主机强迫关闭了一个现有的连接。', None, 10054, None))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "D:\Users\11137018\PycharmProjects\Google_Cell_LatLongitude_Decode\googlemaps\client.py", line 315, in _request response = requests_method(base_url + authed_url, File "D:\Users\11137018\PycharmProjects\Google_Cell_LatLongitude_Decode\requests\sessions.py", line 590, in post return self.request('POST', url, data=data, json=json, kwargs) File "D:\Users\11137018\PycharmProjects\Google_Cell_LatLongitude_Decode\requests\sessions.py", line 542, in request resp = self.send(prep, send_kwargs) File "D:\Users\11137018\PycharmProjects\Google_Cell_LatLongitude_Decode\requests\sessions.py", line 655, in send r = adapter.send(request, **kwargs) File "D:\Users\11137018\PycharmProjects\Google_Cell_LatLongitude_Decode\requests\adapters.py", line 498, in send raise ConnectionError(err, request=request) requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionResetError(10054, '远程主机强迫关闭了一个现有的连接。', None, 10054, None))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "D:\Users\11137018\PycharmProjects\Google_Cell_LatLongitude_Decode\Cell_Decode.py", line 102, in lat_lng_dict = geolocation.geolocate(client=vivo_client, cell_towers=cell_info) File "F:\ANACONDA\Lib\site-packages\googlemaps\geolocation.py", line 104, in geolocate return client._request("/geolocation/v1/geolocate", {}, # No GET params File "D:\Users\11137018\PycharmProjects\Google_Cell_LatLongitude_Decode\googlemaps\client.py", line 320, in _request raise googlemaps.exceptions.TransportError(e) googlemaps.exceptions.TransportError: ('Connection aborted.', ConnectionResetError(10054, '远程主机强迫关闭了一个现有的连接。', None, 10054, None))

wangela commented 1 year ago

If you would like to upvote the priority of this issue, please comment below or react with :+1: so we can see what is popular when we triage.

@sk502887185 Thank you for opening this issue. 🙏 Please check out these other resources that might help you get to a resolution in the meantime:

This is an automated message, feel free to ignore.