Hi Google team, I am facing an issue when executing this line in Python,

from googleapiclient.discovery import build

service = build('sheets', 'v4', credentials=creds,cache_discovery=False) 
sheet_metadata = service.spreadsheets().get(spreadsheetId=spreadsheet_id
).execute()

the final issue on the log is socket.timeout: The read operation timed out
this issue is very rare when executing this issue, as we run this code more 
than ten times per day. I want to know why this happens and what can I do 
to resolve this. 

we use this version of the module *google-api-python-client==2.90.0*
and we run this in a lambda on aws 

this is the full log of the issue.
Traceback (most recent call last):
File "/var/task/lambdas/createSheet.py", line 66, in _update_spreadsheet
sheet_metadata = 
service.spreadsheets().get(spreadsheetId=spreadsheet_id).execute()
File "/opt/python/lib/python3.9/site-packages/googleapiclient/_helpers.py", 
line 130, in positional_wrapper
return wrapped(*args, **kwargs)
File "/opt/python/lib/python3.9/site-packages/googleapiclient/http.py", 
line 923, in execute
resp, content = _retry_request(
File "/opt/python/lib/python3.9/site-packages/googleapiclient/http.py", 
line 222, in _retry_request
raise exception
File "/opt/python/lib/python3.9/site-packages/googleapiclient/http.py", 
line 191, in _retry_request
resp, content = http.request(uri, method, *args, **kwargs)
File "/opt/python/lib/python3.9/site-packages/google_auth_httplib2.py", 
line 218, in request
response, content = self.http.request(
File "/opt/python/lib/python3.9/site-packages/httplib2/__init__.py", line 
1701, in request
(response, content) = self._request(
File "/opt/python/lib/python3.9/site-packages/httplib2/__init__.py", line 
1421, in _request
(response, content) = self._conn_request(conn, request_uri, method, body, 
headers)
File "/opt/python/lib/python3.9/site-packages/httplib2/__init__.py", line 
1373, in _conn_request
response = conn.getresponse()
File "/var/lang/lib/python3.9/http/client.py", line 1377, in getresponse
response.begin()
File "/var/lang/lib/python3.9/http/client.py", line 320, in begin
version, status, reason = self._read_status()
File "/var/lang/lib/python3.9/http/client.py", line 281, in _read_status
line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
File "/var/lang/lib/python3.9/socket.py", line 704, in readinto
return self._sock.recv_into(b)
File "/var/lang/lib/python3.9/ssl.py", line 1242, in recv_into
return self.read(nbytes, buffer)
File "/var/lang/lib/python3.9/ssl.py", line 1100, in read
return self._sslobj.read(len, buffer)
socket.timeout: The read operation timed out


-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Google Ads API and AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/ff420eaf-9e42-4334-8fa0-717abae08fdan%40googlegroups.com.

Reply via email to