Skip to content

AttributeError: 'StreamingChecksumBody' object has no attribute 'strip' #4754

@yifat-n2ws

Description

@yifat-n2ws

Describe the bug

When attempting to download an object from s3-compatibale storage provider (Wasabi), some requests fails wit the following stack:

File "python/lib/python3.13/site-packages/botocore/client.py", line 601, in _api_call
return self._make_api_call(operation_name, kwargs)
~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^
File "python/lib/python3.13/site-packages/botocore/context.py", line 123, in wrapper
return func(*args, **kwargs)
File "python/lib/python3.13/site-packages/botocore/client.py", line 1056, in _make_api_call
http, parsed_response = self._make_request(
~~~~~~~~~~~~~~~~~~^
operation_model, request_dict, request_context
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "python/lib/python3.13/site-packages/botocore/client.py", line 1080, in _make_request
return self._endpoint.make_request(operation_model, request_dict)
~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "python/lib/python3.13/site-packages/botocore/endpoint.py", line 118, in make_request
return self._send_request(request_dict, operation_model)
~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "python/lib/python3.13/site-packages/botocore/endpoint.py", line 196, in _send_request
success_response, exception = self._get_response(
~~~~~~~~~~~~~~~~~~^
request, operation_model, context
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "python/lib/python3.13/site-packages/botocore/endpoint.py", line 238, in _get_response
success_response, exception = self._do_get_response(
~~~~~~~~~~~~~~~~~~~~~^
request, operation_model, context
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
)
^
File "python/lib/python3.13/site-packages/botocore/endpoint.py", line 312, in _do_get_response
parsed_response = parser.parse(
response_dict, operation_model.output_shape
)
File "python/lib/python3.13/site-packages/botocore/parsers.py", line 258, in parse
if self._is_generic_error_response(response):
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^
File "python/lib/python3.13/site-packages/botocore/parsers.py", line 312, in _is_generic_error_response
body = response['body'].strip()
^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'StreamingChecksumBody' object has no attribute 'strip'

This may or may not be related to the latest checksum algorithm changes. It seems that the request itself has returned error 500, and the failure is in the error handling path. Nonetheless, this seems like regression, since we have never encountered this error in botocore version 1.33.6

Regression Issue

  • Select this option if this issue appears to be a regression.

Expected Behavior

If indeed the issue is triggered by an error 500, the usual error handling should apply.

Current Behavior

exception is raised and the rest of the error handling does not happen.

Reproduction Steps

This seems to happen sporadically, which enforce my assumption that the root cause is an intermittent error 500 on the server side.

Possible Solution

No response

Additional Information/Context

the requested object size is only 26KB, so no chunking is done.

SDK version used

1.39.17

Environment details (OS name and version, etc.)

ubuntu 22

Metadata

Metadata

Labels

bugThis issue is a confirmed bug.p1This is a high priority issuepotential-regressionMarking this issue as a potential regression to be checked by team memberresponse-requestedWaiting on additional information or feedback.s3

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions