Skip to content

fix(s3): add path-style support to fix Ceph RGW S3 compatibility#874

Open
SJoon99 wants to merge 2 commits intopydio:v5-devfrom
SJoon99:fix/s3-path-style-ceph-rgw
Open

fix(s3): add path-style support to fix Ceph RGW S3 compatibility#874
SJoon99 wants to merge 2 commits intopydio:v5-devfrom
SJoon99:fix/s3-path-style-ceph-rgw

Conversation

@SJoon99
Copy link

@SJoon99 SJoon99 commented Mar 18, 2026

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 request
and the signed string, the signature never matches.

Root Cause

path_style and force_path_style are correctly stored in
DataSource.StorageConfiguration when a custom S3 endpoint is configured.
However, FactorizeMinioServers() only copied signatureVersion into
GatewayConfiguration, silently dropping these values. They never reached
MinioConfig.ClientConfig() and therefore never reached the minio-go
Options.BucketLookup field — so the client always fell back to virtual-host
style, breaking Ceph RGW entirely.

Changes

common/proto/object/datasource.go

  • Add StorageKeyPathStyle and StorageKeyForcePathStyle constants
  • Propagate path_style/force_path_style through DataSource.ClientConfig()
    and MinioConfig.ClientConfig()

common/config/datasources.go

  • In all 3 S3 cases of FactorizeMinioServers(), propagate path_style and
    force_path_style into GatewayConfiguration alongside signatureVersion

common/nodes/objects/mc/client.go

  • In New(), set options.BucketLookup = minio.BucketLookupPath when
    path_style or force_path_style is set

common/sync/endpoints/cells/transport/config.go

  • Add ForcePathStyle field to S3 transport config struct

common/sync/endpoints/cells/transport/mc/s3_client.go

  • Set opts.BucketLookup = minio.BucketLookupPath when ForcePathStyle is set,
    applied consistently across all minio client instantiations in the sync transport

discovery/install/lib/datasource.go

  • Set path_style and force_path_style in StorageConfiguration when a
    custom S3 endpoint is configured during installation

discovery/install/lib/installer.go

  • Apply path_style/force_path_style in the pre-flight S3 connection check
    during 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 SignatureDoesNotMatch errors after this fix.

@CLAassistant
Copy link

CLAassistant commented Mar 18, 2026

CLA assistant check
All committers have signed the CLA.

@SJoon99 SJoon99 changed the title fix(s3): propagate path_style/force_path_style for S3-compatible backends (Ceph RGW) fix(s3): add path-style support to fix Ceph RGW S3 compatibility Mar 18, 2026
@SJoon99 SJoon99 force-pushed the fix/s3-path-style-ceph-rgw branch 2 times, most recently from bebfe4f to b049f2f Compare March 19, 2026 06:36
SJoon99 added 2 commits March 19, 2026 07:02
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.
@SJoon99 SJoon99 force-pushed the fix/s3-path-style-ceph-rgw branch from b049f2f to c839afa Compare March 19, 2026 07:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants