Skip to content

fix(s3): use virtual-hosted style for Aliyun OSS#151

Merged
overtrue merged 1 commit intomainfrom
codex/fix-aliyun-oss-auto-lookup-150
Apr 22, 2026
Merged

fix(s3): use virtual-hosted style for Aliyun OSS#151
overtrue merged 1 commit intomainfrom
codex/fix-aliyun-oss-auto-lookup-150

Conversation

@overtrue
Copy link
Copy Markdown
Contributor

@overtrue overtrue commented Apr 22, 2026

Related Issue

Fixes #150.

Background

Issue #150 reports that rc ls aliyun/fenxi-data/ fails against Alibaba Cloud OSS with SecondLevelDomainForbidden.

Alibaba Cloud documents this error as a bucket-scoped OSS request using an endpoint shape that does not include the bucket in the host. Bucket operations need virtual-hosted-style access such as bucket.oss-region.aliyuncs.com.

Root Cause

bucket_lookup = auto was treated the same as path, so rc sent Aliyun OSS object-list requests as path-style requests to the regional OSS endpoint. OSS rejects that shape for bucket operations.

Solution

  • Keep explicit --bucket-lookup path and --bucket-lookup dns behavior unchanged.
  • In auto mode, detect Aliyun OSS service endpoints like oss-cn-hangzhou.aliyuncs.com and use virtual-hosted-style addressing.
  • Preserve path-style auto behavior for custom/local endpoints such as RustFS and MinIO.

Validation

  • cargo test -p rc-s3 client::tests:: --lib
  • cargo fmt --all --check
  • cargo clippy --workspace -- -D warnings
  • cargo test --workspace

I could not run against the reporter private Aliyun bucket, but the failing error code, official OSS endpoint rule, and local address-selection tests cover the root cause.

@overtrue overtrue added bug Something isn't working codex codex-automation labels Apr 22, 2026
@overtrue overtrue merged commit 74deaac into main Apr 22, 2026
15 checks passed
@overtrue overtrue deleted the codex/fix-aliyun-oss-auto-lookup-150 branch April 22, 2026 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working codex codex-automation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rc list aliyun bucket error

1 participant