Closed
Description
Apache Iceberg version
0.10.0 (latest release)
Please describe the bug 🐞
Description
When using PyIceberg with Aliyun OSS (Object Storage Service) via the S3-compatible endpoint, creating a table or appending data fails during the metadata/data upload phase. The underlying PyArrow S3 filesystem attempts to use aws-chunked encoding with x-amz-content-sha256, which is not supported by Aliyun OSS's S3 compatibility layer for certain operations.
This leads to the following error:
OSError: When uploading part for key '...' in bucket '...':
AWS Error UNKNOWN (HTTP status 400) during UploadPart operation:
Unable to parse ExceptionName: InvalidArgument
Message: aws-chunked encoding is not supported with the specified x-amz-content-sha256 value.
According to Aliyun OSS Documentation, the S3-compatible API has specific constraints regarding signature versions and chunked encoding.
Steps to Reproduce
Initialize a Catalog with Aliyun OSS S3-compatible endpoint.
-
Set s3.force-virtual-addressing: "true" as required by OSS.
-
Attempt to create a table or write data.
-
Reproducible Code Snippet:
import os
from pyiceberg.catalog import load_catalog
catalog = load_catalog(
"oss_catalog",
**{
"type": "sql",
"uri": "sqlite:///oss_catalog.db",
"warehouse": "s3://your-bucket/path/",
"s3.endpoint": "https://s3.oss-cn-wulanchabu.aliyuncs.com",
"s3.region": "cn-wulanchabu",
"s3.access-key-id": os.environ["OSS_AK"],
"s3.secret-access-key": os.environ["OSS_SK"],
"s3.force-virtual-addressing": "true",
}
)
# This triggers the UploadPart error during metadata write
catalog.create_table("default.test_table", schema=pa_schema)Willingness to contribute
- I can contribute a fix for this bug independently
- I would be willing to contribute a fix for this bug with guidance from the Iceberg community
- I cannot contribute a fix for this bug at this time
Metadata
Metadata
Assignees
Labels
No labels
Activity
kevinjqliu commentedon Dec 31, 2025
Thanks for reporting the issue!
Which FileIO implementation are you using? Fsspec or Pyarrow?
Are you using the S3 Signer? The only place in the codebase i see mentions of x-amz-content-sha256
Heres the translation from the aliyun docs, via claude:
Are you able to try one of the above? Would be helpful to see which one works. I do not have an Aliyun env 😄
Dludora commentedon Jan 5, 2026
Hello, I use PyArrowIO by default.
This is a more concise traceback.
Dludora commentedon Jan 5, 2026
This bug is handled when I set environment variable
martyngigg commentedon Jan 7, 2026
I'm also using PyArrowIO and on upgrading to 22.0.0 (it's fine with <= 21.0.0) I have received:
Using the same environment variables as @Dludora fixes the issue. See https://github.com/ISISNeutronMuon/analytics-data-platform/issues/183 for more details. We have a Ceph-based object store.
Just a note that something similar happened with botocore that required those environment variables. Perhaps this is a
pyarrowissue?kevinjqliu commentedon Jan 25, 2026
I believe #2827 resolves this.
@Dludora could you confirm? The change should already be in the nightly bulid https://test.pypi.org/project/pyiceberg
Closing for now, will reopen if necessary