Skip to content

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

@zymergen-mbarton

Description

@zymergen-mbarton

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions