Project

General

Profile

Actions

Bug #10669

closed

googleapiclient.errors.InvalidJsonError retrieving discovery document

Added by Tom Morris over 7 years ago. Updated about 7 years ago.

Status:
Resolved
Priority:
Normal
Assigned To:
Category:
SDKs
Target version:
Story points:
1.0

Description

When logging in to a shell node, I got the error below, apparently because the cached version of the discovery document was corrupted. Deleting the contents of ~/.cache/discovery/ fixed the issue, but I think there are two things that need to be fixed:

1. Make sure that the file gets truncated to the new length if a shorter discovery document is downloaded. The fact that the corrupted version of the file ends with:
,"websocketUrl":"wss://ws.e51c5.arvadosapi.com/websocket"}om/web
makes me suspicious of the garbage at the end of the file.

2. If there's an error parsing the cached file, it should be deleted and re-downloaded to see if the problem can be cleared

No handlers could be found for logger "googleapiclient.discovery"
Traceback (most recent call last):
File "/usr/local/arvados/record-login.py", line 9, in <module>
arv = arvados.api('v1')
File "/usr/lib/python2.7/dist-packages/arvados/api.py", line 185, in api
return api_from_config(version=version, cache=cache, **kwargs)
File "/usr/lib/python2.7/dist-packages/arvados/api.py", line 244, in api_from_config
return api(version=version, host=host, token=token, insecure=insecure, **kwargs)
File "/usr/lib/python2.7/dist-packages/arvados/api.py", line 208, in api
svc = apiclient_discovery.build('arvados', version, **kwargs)
File "/usr/lib/python2.7/dist-packages/oauth2client/util.py", line 140, in positional_wrapper
return wrapped(*args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/googleapiclient/discovery.py", line 196, in build
tfmorris@shell:~$ cache)
File "/usr/local/lib/python2.7/dist-packages/googleapiclient/discovery.py", line 256, in _retrieve_discovery_doc
raise InvalidJsonError()
googleapiclient.errors.InvalidJsonError


Files

corrupt.json (160 KB) corrupt.json Tom Morris, 12/07/2016 03:20 AM

Subtasks 2 (0 open2 closed)

Task #11267: Review 10669-safe-http-cacheResolvedPeter Amstutz12/06/2016Actions
Task #11318: thread- and process-safe cacheResolvedTom Clegg12/06/2016Actions

Related issues

Related to Arvados - Bug #11226: [SDK] Python client tries to cache discovery document at the same local path regardless of userResolvedPeter Amstutz03/10/2017Actions
Is duplicate of Arvados - Bug #9521: Corrupt discovery document should be handled betterDuplicateTom Morris06/30/2016Actions
Actions

Also available in: Atom PDF