fix(s3): add path-style support to fix Ceph RGW S3 compatibility#874
Open
SJoon99 wants to merge 2 commits intopydio:v5-devfrom
Open
fix(s3): add path-style support to fix Ceph RGW S3 compatibility#874SJoon99 wants to merge 2 commits intopydio:v5-devfrom
SJoon99 wants to merge 2 commits intopydio:v5-devfrom
Conversation
bebfe4f to
b049f2f
Compare
FactorizeMinioServers() was only copying signatureVersion to GatewayConfiguration, omitting path_style and force_path_style. This caused minio-go to use virtual-host style URLs instead of path-style, resulting in SignatureDoesNotMatch errors when using Ceph RGW or other S3-compatible backends that require path-style access. - common/proto/object/datasource.go: add StorageKeyPathStyle and StorageKeyForcePathStyle constants; propagate path_style through both DataSource.ClientConfig() and MinioConfig.ClientConfig() - common/config/datasources.go: propagate path_style/force_path_style in all 3 S3 cases of FactorizeMinioServers() - common/nodes/objects/mc/client.go: read path_style to set BucketLookupPath on minio client options fix(s3): propagate path_style to all S3 client creation paths for Ceph RGW Extends the path-style fix to additional S3 client creation sites: - common/sync/endpoints/cells/transport/config.go: add ForcePathStyle field to S3Config struct - common/sync/endpoints/cells/transport/mc/s3_client.go: set BucketLookupPath when ForcePathStyle is set (GetObject, PutObject, CopyObject) - discovery/install/lib/datasource.go: set path_style and force_path_style when a custom S3 endpoint is configured at install - discovery/install/lib/installer.go: set path_style and force_path_style in S3_KEYS and S3_BUCKETS pre-flight checks when a custom endpoint is used
Tests cover DataSource.ClientConfig, MinioConfig.ClientConfig, FactorizeMinioServers, and addDatasourceS3 path_style/force_path_style propagation using GoConvey.
b049f2f to
c839afa
Compare
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.
Problem
Ceph RGW (and other self-hosted S3-compatible backends) are effectively
incompatible with Cells when used as a custom S3 endpoint. Every datasource
sync operation and pre-flight connection check fails with
SignatureDoesNotMatch.The underlying issue is that Ceph RGW does not support virtual-host-style bucket
addressing (
http://bucket.endpoint/key). It requires path-style URLs(
http://endpoint/bucket/key). When the URL format differs between the requestand the signed string, the signature never matches.
Root Cause
path_styleandforce_path_styleare correctly stored inDataSource.StorageConfigurationwhen a custom S3 endpoint is configured.However,
FactorizeMinioServers()only copiedsignatureVersionintoGatewayConfiguration, silently dropping these values. They never reachedMinioConfig.ClientConfig()and therefore never reached the minio-goOptions.BucketLookupfield — so the client always fell back to virtual-hoststyle, breaking Ceph RGW entirely.
Changes
common/proto/object/datasource.goStorageKeyPathStyleandStorageKeyForcePathStyleconstantspath_style/force_path_stylethroughDataSource.ClientConfig()and
MinioConfig.ClientConfig()common/config/datasources.goFactorizeMinioServers(), propagatepath_styleandforce_path_styleintoGatewayConfigurationalongsidesignatureVersioncommon/nodes/objects/mc/client.goNew(), setoptions.BucketLookup = minio.BucketLookupPathwhenpath_styleorforce_path_styleis setcommon/sync/endpoints/cells/transport/config.goForcePathStylefield to S3 transport config structcommon/sync/endpoints/cells/transport/mc/s3_client.goopts.BucketLookup = minio.BucketLookupPathwhenForcePathStyleis set,applied consistently across all minio client instantiations in the sync transport
discovery/install/lib/datasource.gopath_styleandforce_path_styleinStorageConfigurationwhen acustom S3 endpoint is configured during installation
discovery/install/lib/installer.gopath_style/force_path_stylein the pre-flight S3 connection checkduring install, so the installer validates connectivity correctly against
Ceph RGW from the start
Testing
Verified with Ceph RGW as the S3 backend — all datasource sync operations
succeed with no
SignatureDoesNotMatcherrors after this fix.