HumanCellAtlas / dcp-cli

DEPRECATED - HCA Data Coordination Platform Command Line Interface
https://hca.readthedocs.io/
MIT License
6 stars 8 forks source link

Unable to login due to headers #524

Open amarjandu opened 4 years ago

amarjandu commented 4 years ago

I am unable to login to the dcp-cli tool. dss-swagger-endpoint used: "https://dss.data.humancellatlas.org/v1/swagger.json"

Steps to Produce:

hca dss logout
hca dss login

Error Found:

Traceback (most recent call last):
  File "/Users/amar/dev/venv/venv-dcp-cli/lib/python3.6/site-packages/urllib3/response.py", line 400, in _decode
    data = self._decoder.decompress(data)
  File "/Users/amar/dev/venv/venv-dcp-cli/lib/python3.6/site-packages/urllib3/response.py", line 86, in decompress
    ret += self._obj.decompress(data)
zlib.error: Error -3 while decompressing data: incorrect header check

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/amar/dev/venv/venv-dcp-cli/lib/python3.6/site-packages/requests/models.py", line 751, in generate
    for chunk in self.raw.stream(chunk_size, decode_content=True):
  File "/Users/amar/dev/venv/venv-dcp-cli/lib/python3.6/site-packages/urllib3/response.py", line 576, in stream
    data = self.read(amt=amt, decode_content=decode_content)
  File "/Users/amar/dev/venv/venv-dcp-cli/lib/python3.6/site-packages/urllib3/response.py", line 548, in read
    data = self._decode(data, decode_content, flush_decoder)
  File "/Users/amar/dev/venv/venv-dcp-cli/lib/python3.6/site-packages/urllib3/response.py", line 406, in _decode
    e,
urllib3.exceptions.DecodeError: ('Received response with content-encoding: gzip, but failed to decode it.', error('Error -3 while decompressing data: incorrect header check',))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/amar/dev/venv/venv-dcp-cli/bin/hca", line 8, in <module>
    sys.exit(main())
  File "/Users/amar/dev/venv/venv-dcp-cli/lib/python3.6/site-packages/hca/cli.py", line 132, in main
    result = parsed_args.entry_point(parsed_args)
  File "/Users/amar/dev/venv/venv-dcp-cli/lib/python3.6/site-packages/hca/util/__init__.py", line 587, in arg_forwarder
    return command(**command_args)
  File "/Users/amar/dev/venv/venv-dcp-cli/lib/python3.6/site-packages/hca/util/__init__.py", line 391, in login
    credentials = flow.run_local_server(success_message=msg, audience=self._audience)
  File "/Users/amar/dev/venv/venv-dcp-cli/lib/python3.6/site-packages/google_auth_oauthlib/flow.py", line 460, in run_local_server
    self.fetch_token(authorization_response=authorization_response)
  File "/Users/amar/dev/venv/venv-dcp-cli/lib/python3.6/site-packages/google_auth_oauthlib/flow.py", line 281, in fetch_token
    self.client_config['token_uri'], **kwargs)
  File "/Users/amar/dev/venv/venv-dcp-cli/lib/python3.6/site-packages/requests_oauthlib/oauth2_session.py", line 344, in fetch_token
    **request_kwargs
  File "/Users/amar/dev/venv/venv-dcp-cli/lib/python3.6/site-packages/requests_oauthlib/oauth2_session.py", line 516, in request
    method, url, headers=headers, data=data, **kwargs
  File "/Users/amar/dev/venv/venv-dcp-cli/lib/python3.6/site-packages/requests/sessions.py", line 530, in request
    resp = self.send(prep, **send_kwargs)
  File "/Users/amar/dev/venv/venv-dcp-cli/lib/python3.6/site-packages/requests/sessions.py", line 683, in send
    r.content
  File "/Users/amar/dev/venv/venv-dcp-cli/lib/python3.6/site-packages/requests/models.py", line 829, in content
    self._content = b''.join(self.iter_content(CONTENT_CHUNK_SIZE)) or b''
  File "/Users/amar/dev/venv/venv-dcp-cli/lib/python3.6/site-packages/requests/models.py", line 756, in generate
    raise ContentDecodingError(e)
requests.exceptions.ContentDecodingError: ('Received response with content-encoding: gzip, but failed to decode it.', error('Error -3 while decompressing data: incorrect header check',))
amarjandu commented 4 years ago

The issue here appears to be with the interaction between Fusillade and Auth0. When changing the token_uri within the hca/config.json file to be the auth0 endpoint rather than the fusillade proxy the issue does not persist.

Either the DSS Application Secret can be changed to use the auth0 token endpoint, or the Fus proxy service would need to be investigated. Not sure of the implications of removing the proxy service for just the token_uri.