Repository navigation
[C++] Compatibility with newer aws sdk #45304
Description
Describe the enhancement requested
Not sure whether to classify this as a bug or as an enhancement. It feels like a regression, but likely in AWS itself. In conda-forge, we don't build all patch versions of the SDK, because it gets released way too often to migrate ever time. Recently we went from 1.11.458 to 1.11.488, which ran into consistent errors on unix. I didn't look too closely at first (looked just like a flaky failure), but it reproduces 100% of the time. As such, I'm reverting the bump across our maintenance branches again.
Failures look roughly like this
[----------] 28 tests from TestS3FS
[ RUN ] TestS3FS.GetFileInfoRoot
$SRC_DIR/cpp/src/arrow/filesystem/s3fs_test.cc:519: Failure
Failed
'PopulateTestBucket()' failed with IOError: AWS Error UNKNOWN (HTTP status 400) during PutObject operation: Unable to parse ExceptionName: BadRequest Message: malformed chunked encoding
[ FAILED ] TestS3FS.GetFileInfoRoot (43 ms)
[ RUN ] TestS3FS.GetFileInfoBucket
$SRC_DIR/cpp/src/arrow/filesystem/s3fs_test.cc:519: Failure
Failed
'PopulateTestBucket()' failed with IOError: AWS Error UNKNOWN (HTTP status 400) during PutObject operation: Unable to parse ExceptionName: BadRequest Message: malformed chunked encoding
[ FAILED ] TestS3FS.GetFileInfoBucket (52 ms)
all due to malformed chunked encoding
This also shows up in the python tests (these are from arrow v15, which is the last version where we built the python bindings on the same feedstock; since the errors are uniform across versions though, I strongly suspect this to be the case also for main, as well as v19 and down).
=========================== short test summary info ============================
FAILED pyarrow/tests/test_fs.py::test_filesystem_is_functional_after_pickling[builtin_pickle-S3FileSystem] - OSError: When creating key 'a/' in bucket 'pyarrow-filesystem': AWS Error UNKNOWN (HTTP status 400) during PutObject operation: Unable to parse ExceptionName: BadRequest Message: malformed chunked encoding
FAILED pyarrow/tests/test_fs.py::test_filesystem_is_functional_after_pickling[cloudpickle-S3FileSystem] - OSError: When creating key 'a/' in bucket 'pyarrow-filesystem': AWS Error UNKNOWN (HTTP status 400) during PutObject operation: Unable to parse ExceptionName: BadRequest Message: malformed chunked encoding
FAILED pyarrow/tests/test_dataset.py::test_write_dataset_s3 - OSError: When creating key 'dataset/' in bucket 'mybucket': AWS Error UNKNOWN (HTTP status 400) during PutObject operation: Unable to parse ExceptionName: BadRequest Message: malformed chunked encoding
FAILED pyarrow/tests/test_fs.py::test_create_dir[S3FileSystem] - OSError: When creating key 'test-directory/' in bucket 'pyarrow-filesystem': AWS Error UNKNOWN (HTTP status 400) during PutObject operation: Unable to parse ExceptionName: BadRequest Message: malformed chunked encoding
FAILED pyarrow/tests/test_fs.py::test_copy_file[S3FileSystem] - OSError: When uploading part for key 'test-copy-source-file' in bucket 'pyarrow-filesystem': AWS Error UNKNOWN (HTTP status 400) during UploadPart operation: Unable to parse ExceptionName: BadRequest Message: malformed chunked encoding
FAILED pyarrow/tests/test_fs.py::test_move_file[S3FileSystem] - OSError: When uploading part for key 'test-move-source-file' in bucket 'pyarrow-filesystem': AWS Error UNKNOWN (HTTP status 400) during UploadPart operation: Unable to parse ExceptionName: BadRequest Message: malformed chunked encoding
FAILED pyarrow/tests/test_fs.py::test_delete_file[S3FileSystem] - OSError: When uploading part for key 'test-delete-target-file' in bucket 'pyarrow-filesystem': AWS Error UNKNOWN (HTTP status 400) during UploadPart operation: Unable to parse ExceptionName: BadRequest Message: malformed chunked encoding
FAILED pyarrow/tests/test_fs.py::test_filesystem_from_uri_s3 - OSError: When creating key 'foo/' in bucket 'mybucket': AWS Error UNKNOWN (HTTP status 400) during PutObject operation: Unable to parse ExceptionName: BadRequest Message: malformed chunked encoding
Xref also #45195
Component(s)
C++, Python, Packaging
Activity
pitrou commentedon Jan 20, 2025
The error message comes from Minio. So this is probably an incompatibility between Minio and the official AWS SDK... :(
pitrou commentedon Jan 20, 2025
Ok, I can reproduce, and even with the latest Minio version is still occurs. So I'll probably have to run Wireshark on this...
pitrou commentedon Jan 20, 2025
I have it down to this HTTP exchange:
pitrou commentedon Jan 20, 2025
Interesting, another PUT request before (to create a bucket) is successful.
xhochy commentedon Jan 20, 2025
Would it help your debugging if I build some of the versions in between on conda-forge?
pitrou commentedon Jan 20, 2025
Probably not, thanks for the proposal.
pitrou commentedon Jan 20, 2025
It appears there might be an easy workaround for this.
pitrou commentedon Jan 20, 2025
Judging by https://httpwg.org/specs/rfc9112.html#chunked.encoding , this is really a bug in the AWS SDK. When using chunked encoding, there must be an explicit 0-sized chunk at the end, but it appears the AWS SDK client doesn't send one.
h-vetinari commentedon Jan 20, 2025
Thanks for digging into this so quickly! Could you open an issue in https://github.com/aws/aws-sdk-cpp? That would be useful for tracking/fixing this - if you want I can also do it, but I'd only be able to do a pale approximation, given that you understand the subject much better and did all the debugging.
pitrou commentedon Jan 20, 2025
I'll open an issue, yes. I think I've found the culprit.
pitrou commentedon Jan 20, 2025
Reported upstream at aws/aws-sdk-cpp#3259
pitrou commentedon Jan 22, 2025
Issue resolved by pull request 45310
#45310
GH-45304: [C++][S3] Workaround compatibility issue between AWS SDK an…
GH-45304: [C++][S3] Workaround compatibility issue between AWS SDK an…