Ambiguous error messages returned to user when experiencing API connection issues.
It appears the that the python library is returning an ambiguous error message about decoding the response body, when the actual cause is being unable to connect to Seven Bridges. Intermittently we are seeing the following error message:
File "/Users/mbarton/.venv/lib/python3.7/site-packages/sevenbridges/models/file.py", line 149, in query
limit=limit, fields='_all', **query_params
File "/Users/mbarton/.venv/lib/python3.7/site-packages/sevenbridges/meta/resource.py", line 130, in _query
response = api.get(url=url, params=kwargs)
File "/Users/mbarton/.venv/lib/python3.7/site-packages/sevenbridges/http/client.py", line 239, in get
append_base=append_base, stream=stream
File "/Users/mbarton/.venv/lib/python3.7/site-packages/sevenbridges/decorators.py", line 138, in wrapper
raise SbgError(message=six.text_type(e))
sevenbridges.errors.SbgError: Expecting value: line 1 column 1 (char 0)
However if you run the code that raises this error in a python debugger the root cause appears to be something along the lines of trying to decode the following response body from SBG:
b'<html>\r\n<head><title>504 Gateway Time-out</title></head>\r\n<body
bgcolor="white">\r\n<center><h1>504 Gateway
Time-out</h1></center>\r\n<hr><center>nginx</center>\r\n</body>\r\n</html>\r\n'
This is from the URL: https://api.sbgenomics.com/v2/files?fields=_all&project=...
I think think there are two causes here:
-
The SBG python library is trying to decode a response body when there is a non 2XX return code from the API.
-
The upstream NGINX is API returning HTML pages when experiencing internal erors.
We looked into this issue and have the suspicion that it might be caused by a request URL that is too long when too many query parameters are provided.
Is this error somehow reproducible for you or is it completely stochastic? Also, can you please provide information what the exact API call was that triggered this error and if it is always the same one?