Comment 2 for bug 2020112

Revision history for this message
Michał Górny (mgorny) wrote :

Thanks for the fix. However, I'm afraid that doesn't resolve all the issues. After installing betamax from https://github.com/jhatler/betamax/, I get:

==============================
Failed 1 tests - output below:
==============================

keystoneauth1.tests.unit.test_betamax_fixture.TestBetamaxFixture.test_keystoneauth_betamax_fixture
--------------------------------------------------------------------------------------------------

Captured traceback:
~~~~~~~~~~~~~~~~~~~
    Traceback (most recent call last):

      File "/tmp/keystoneauth/.tox/py311/lib/python3.11/site-packages/urllib3/response.py", line 712, in _error_catcher
    yield

      File "/tmp/keystoneauth/.tox/py311/lib/python3.11/site-packages/urllib3/response.py", line 833, in _raw_read
    raise IncompleteRead(self._fp_bytes_read, self.length_remaining)

    urllib3.exceptions.IncompleteRead: IncompleteRead(780 bytes read, 1904 more expected)

The above exception was the direct cause of the following exception:

    Traceback (most recent call last):

      File "/tmp/keystoneauth/.tox/py311/lib/python3.11/site-packages/requests/models.py", line 816, in generate
    yield from self.raw.stream(chunk_size, decode_content=True)

      File "/tmp/keystoneauth/.tox/py311/lib/python3.11/site-packages/urllib3/response.py", line 934, in stream
    data = self.read(amt=amt, decode_content=decode_content)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

      File "/tmp/keystoneauth/.tox/py311/lib/python3.11/site-packages/urllib3/response.py", line 905, in read
    data = self._raw_read(amt)
           ^^^^^^^^^^^^^^^^^^^

      File "/tmp/keystoneauth/.tox/py311/lib/python3.11/site-packages/urllib3/response.py", line 811, in _raw_read
    with self._error_catcher():

      File "/usr/lib/python3.11/contextlib.py", line 158, in __exit__
    self.gen.throw(typ, value, traceback)

      File "/tmp/keystoneauth/.tox/py311/lib/python3.11/site-packages/urllib3/response.py", line 729, in _error_catcher
    raise ProtocolError(f"Connection broken: {e!r}", e) from e

    urllib3.exceptions.ProtocolError: ('Connection broken: IncompleteRead(780 bytes read, 1904 more expected)', IncompleteRead(780 bytes read, 1904 more expected))

During handling of the above exception, another exception occurred:

    Traceback (most recent call last):

      File "/tmp/keystoneauth/keystoneauth1/session.py", line 1021, in _send_request
    resp = self.session.request(method, url, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

      File "/tmp/keystoneauth/.tox/py311/lib/python3.11/site-packages/requests/sessions.py", line 589, in request
    resp = self.send(prep, **send_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

      File "/tmp/keystoneauth/.tox/py311/lib/python3.11/site-packages/requests/sessions.py", line 747, in send
    r.content

      File "/tmp/keystoneauth/.tox/py311/lib/python3.11/site-packages/requests/models.py", line 899, in content
    self._content = b"".join(self.iter_content(CONTENT_CHUNK_SIZE)) or b""
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

      File "/tmp/keystoneauth/.tox/py311/lib/python3.11/site-packages/requests/models.py", line 818, in generate
    raise ChunkedEncodingError(e)

    requests.exceptions.ChunkedEncodingError: ('Connection broken: IncompleteRead(780 bytes read, 1904 more expected)', IncompleteRead(780 bytes read, 1904 more expected))

During handling of the above exception, another exception occurred:

    Traceback (most recent call last):

      File "/tmp/keystoneauth/keystoneauth1/tests/unit/test_betamax_fixture.py", line 54, in test_keystoneauth_betamax_fixture
    self._replay_cassette()

      File "/tmp/keystoneauth/keystoneauth1/tests/unit/test_betamax_fixture.py", line 51, in _replay_cassette
    s.get_token(auth=plugin)

      File "/tmp/keystoneauth/keystoneauth1/session.py", line 1236, in get_token
    return (self.get_auth_headers(auth) or {}).get('X-Auth-Token')
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^

      File "/tmp/keystoneauth/keystoneauth1/session.py", line 1214, in get_auth_headers
    return auth.get_headers(self, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

      File "/tmp/keystoneauth/keystoneauth1/plugin.py", line 106, in get_headers
    token = self.get_token(session)
            ^^^^^^^^^^^^^^^^^^^^^^^

      File "/tmp/keystoneauth/keystoneauth1/identity/base.py", line 85, in get_token
    return self.get_access(session).auth_token
           ^^^^^^^^^^^^^^^^^^^^^^^^

      File "/tmp/keystoneauth/keystoneauth1/identity/base.py", line 131, in get_access
    self.auth_ref = self.get_auth_ref(session)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^

      File "/tmp/keystoneauth/keystoneauth1/identity/v2.py", line 59, in get_auth_ref
    resp = session.post(url, json=params, headers=headers,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

      File "/tmp/keystoneauth/keystoneauth1/session.py", line 1162, in post
    return self.request(url, 'POST', **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

      File "/tmp/keystoneauth/keystoneauth1/session.py", line 930, in request
    resp = send(**kwargs)
           ^^^^^^^^^^^^^^

      File "/tmp/keystoneauth/keystoneauth1/session.py", line 1041, in _send_request
    raise exceptions.UnknownConnectionError(msg, e)

    keystoneauth1.exceptions.connection.UnknownConnectionError: Unexpected exception for http://keystoneauth-betamax.test/v2.0/tokens: ('Connection broken: IncompleteRead(780 bytes read, 1904 more expected)', IncompleteRead(780 bytes read, 1904 more expected))