Add opt-in path-style S3 addressing via MCAP_S3_FORCE_PATH_STYLE - #1600
Open
alexhilgart wants to merge 1 commit into
Open
Add opt-in path-style S3 addressing via MCAP_S3_FORCE_PATH_STYLE#1600alexhilgart wants to merge 1 commit into
alexhilgart wants to merge 1 commit into
Conversation
alexhilgart
requested review from
gasmith,
james-rms and
jtbandes
as code owners
March 13, 2026 08:33
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changelog
Add optional path-style S3 addressing support via the
MCAP_S3_FORCE_PATH_STYLEenvironment variable for S3-compatible storage endpoints.Docs
This PR updates the CLI documentation to include the new
MCAP_S3_FORCE_PATH_STYLEenvironment variable.Description
Some S3-compatible object storage systems (such as MinIO, Ceph, or custom S3 gateways) require path-style addressing:
instead of the default virtual-host style:
The MCAP CLI currently constructs its S3 client using:
which causes the AWS SDK for Go v2 to use virtual-host style addressing by default. When used with S3-compatible endpoints that do not support bucket subdomains, this can result in DNS errors such as:
This PR adds an optional environment variable:
When this variable is set, the S3 client is configured with:
This allows the CLI to work with S3-compatible object stores that require path-style addressing, while preserving the current default behavior for AWS S3 users.
The change is intentionally minimal:
Documentation has also been updated in
website/docs/guides/cli.md.Manual testing
Built the CLI locally and verified the behavior against an S3-compatible endpoint.
Without the environment variable, the CLI attempted requests using virtual-host style addressing:
With the environment variable enabled:
the CLI correctly used path-style addressing:
and successfully read the remote MCAP file.
MCAP CLI always used virtual-host style addressing when accessing S3:
This caused DNS failures when the endpoint did not support bucket subdomains.
Path-style addressing can be enabled when needed:
Resulting requests:
This allows the CLI to work with S3-compatible object stores that require path-style addressing.