KeyError: 'path' intermittent error
See original GitHub issueWe’ve been facing an intermittent error when trying to use oauth2 services. It was working fine until we deployed a new version on GAE. Notice that we haven’t changed anything related to this code or the google libraries versions.
That’s the exception:
Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1813, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1799, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "./route/auth.py", line 37, in google_auth_callback
user = service.userinfo().get().execute()
File "/usr/local/lib/python2.7/site-packages/googleapiclient/discovery.py", line 1121, in methodResource
schema=schema)
File "/usr/local/lib/python2.7/site-packages/googleapiclient/discovery.py", line 1026, in __init__
self._set_service_methods()
File "/usr/local/lib/python2.7/site-packages/googleapiclient/discovery.py", line 1061, in _set_service_methods
self._add_basic_methods(self._resourceDesc, self._rootDesc, self._schema)
File "/usr/local/lib/python2.7/site-packages/googleapiclient/discovery.py", line 1091, in _add_basic_methods
methodName, methodDesc, rootDesc, schema)
File "/usr/local/lib/python2.7/site-packages/googleapiclient/discovery.py", line 712, in createMethod
maxSize, mediaPathUrl) = _fix_up_method_description(methodDesc, rootDesc, schema)
File "/usr/local/lib/python2.7/site-packages/googleapiclient/discovery.py", line 580, in _fix_up_method_description
path_url = method_desc['path']
KeyError: 'path'
Environment details
- OS: Google App Engine Flexible,
debian:stretch-slim
docker image - Python version: 2.7.15
- pip version: 19.0.3
- versions:
google-api-core
==1.6.0google-api-python-client
==1.7.7google-auth
==1.6.1google-auth-httplib2
==0.0.3
Steps to reproduce
That’s the code, the error raises from service.userinfo().get().execute()
.
The error is intermittent and I haven’t figured out an specific scenario.
import httplib2
from googleapiclient.discovery import build
from oauth2client.client import AccessTokenCredentials
credentials = AccessTokenCredentials(<SOME ACCESS TOKEN>,
user_agent=str(request.user_agent))
http = httplib2.Http()
http = credentials.authorize(http)
service = build("oauth2", "v2", http=http, developerKey=<MY API KEY>)
user = service.userinfo().get().execute()
Issue Analytics
- State:
- Created 5 years ago
- Reactions:4
- Comments:15 (3 by maintainers)
Top Results From Across the Web
Python KeyError Exceptions and How to Handle Them
Python's official documentation says that the KeyError is raised when a mapping key is accessed and isn't found in the mapping. A mapping...
Read more >KeyError 'PATH' when running script from cron - Stack Overflow
I have a Python script that works when run from the normal Terminal (and from any location) but fails when running from cron,...
Read more >How to fix “Nessus failed to load the SSH private key” error?
You have generated the keys correctly, placed the public key on a remote server. You can connect to this server using the private...
Read more >How do I troubleshoot Lambda function failures? - AWS
To troubleshoot Lambda networking errors. 1. Confirm that there's a valid network path to the endpoint that your function is trying to reach ......
Read more >Error codes in Device Manager in Windows - Microsoft Support
If updating the driver does not work, see your hardware documentation for more information. Note You may be prompted to provide the path...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Clearing app engine cache fixed it for me. Are we expected to have more of this breaking awesomeness any time soon?
Clearing the App engine memcache solved the issue. Will keep an eye on it.