Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ambiguous error messages returned to user when experiencing API connection issues. #118

Open
zymergen-mbarton opened this issue Feb 19, 2019 · 1 comment

Comments

@zymergen-mbarton
Copy link

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:

  1. The SBG python library is trying to decode a response body when there is a
    non 2XX return code from the API.

  2. The upstream NGINX is API returning HTML pages when experiencing internal
    erors.

@christiansbg
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants