Skip to content

Honor path_style for non-AWS S3 buckets - #52003

Merged
MichaelKatsoulis merged 5 commits into
elastic:mainfrom
MichaelKatsoulis:fix-awss3-non-aws-path-style
Jul 20, 2026
Merged

Honor path_style for non-AWS S3 buckets#52003
MichaelKatsoulis merged 5 commits into
elastic:mainfrom
MichaelKatsoulis:fix-awss3-non-aws-path-style

Conversation

@MichaelKatsoulis

Copy link
Copy Markdown
Contributor

Proposed commit message

The aws-s3 input set HostnameImmutable = (getBucketARN() != "") when a custom
endpoint was configured. getBucketARN() also returns the bucket name for
non_aws_bucket_name, so any non-AWS S3-compatible bucket with a custom
endpoint ended up with HostnameImmutable=true. In the AWS SDK v2 an immutable
hostname forces path-style requests and ignores path_style parameter.

This broke providers that require virtual-hosted addressing (e.g. Huawei Cloud
OBS): every ListObjectsV2 failed with VirtualHostDomainRequired (403) and no
data was ingested, with no config-side workaround.

The fix is scope the immutable hostname to AWS bucket-ARN / access-point polling only:

e.HostnameImmutable = (c.getBucketARN() != "" && c.NonAWSBucketName == "")

For non-AWS buckets the hostname is now mutable, so path_style controls
addressing: virtual-hosted when path_style: false (default), path-style when
path_style: true.

Disruptive user impact

path_style now takes effect for non-AWS buckets where it was previously
ignored. Non-AWS users who relied on the old forced path-style
behavior and did not set path_style may need to set path_style: true.
But this fixes a real bug.

Related SDH

@MichaelKatsoulis
MichaelKatsoulis requested a review from a team as a code owner July 16, 2026 08:49
@botelastic botelastic Bot added the needs_team Indicates that the issue/PR needs a Team:* label label Jul 16, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🤖 GitHub comments

Just comment with:

  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)
  • /test : Run the Buildkite pipeline.

@mergify

mergify Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

This pull request does not have a backport label.
If this is a bug or security fix, could you label this PR @MichaelKatsoulis? 🙏.
For such, you'll need to label your PR with:

  • The upcoming major version of the Elastic Stack
  • The upcoming minor version of the Elastic Stack (if you're not pushing a breaking change)

To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-8./d is the label to automatically backport to the 8./d branch. /d is the digit
  • backport-active-all is the label that automatically backports to all active branches.
  • backport-active-8 is the label that automatically backports to all active minor branches for the 8 major.
  • backport-active-9 is the label that automatically backports to all active minor branches for the 9 major.

@MichaelKatsoulis MichaelKatsoulis added the Team:obs-ds-hosted-services Label for the Observability Hosted Services team label Jul 16, 2026
@botelastic botelastic Bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Jul 16, 2026
@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

Pinging @elastic/obs-ds-hosted-services (Team:obs-ds-hosted-services)

@MichaelKatsoulis MichaelKatsoulis added needs_team Indicates that the issue/PR needs a Team:* label backport-active-all Automated backport with mergify to all the active branches labels Jul 16, 2026
@botelastic botelastic Bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Jul 16, 2026
@botelastic

botelastic Bot commented Jul 16, 2026

Copy link
Copy Markdown

This pull request doesn't have a Team:<team> label.

@MichaelKatsoulis

Copy link
Copy Markdown
Contributor Author

@Kavindu-Dodan I anonymized the test

@Kavindu-Dodan Kavindu-Dodan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mergify

mergify Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@MichaelKatsoulis
MichaelKatsoulis merged commit f78d5e8 into elastic:main Jul 20, 2026
33 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

@Mergifyio backport 9.5 9.4 9.3 8.19

@mergify

mergify Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

backport 9.5 9.4 9.3 8.19

✅ Backports have been created

Details

MichaelKatsoulis added a commit that referenced this pull request Jul 20, 2026
* Honor path_style for non-AWS S3 buckets

* update fragment

* fix linter issues

* anonymize data

(cherry picked from commit f78d5e8)

Co-authored-by: Michalis Katsoulis <michaelkatsoulis88@gmail.com>
MichaelKatsoulis added a commit that referenced this pull request Jul 20, 2026
* Honor path_style for non-AWS S3 buckets

* update fragment

* fix linter issues

* anonymize data

(cherry picked from commit f78d5e8)

Co-authored-by: Michalis Katsoulis <michaelkatsoulis88@gmail.com>
MichaelKatsoulis added a commit that referenced this pull request Jul 20, 2026
* Honor path_style for non-AWS S3 buckets

* update fragment

* fix linter issues

* anonymize data

(cherry picked from commit f78d5e8)

Co-authored-by: Michalis Katsoulis <michaelkatsoulis88@gmail.com>
MichaelKatsoulis added a commit that referenced this pull request Jul 20, 2026
* Honor path_style for non-AWS S3 buckets

* update fragment

* fix linter issues

* anonymize data

(cherry picked from commit f78d5e8)

Co-authored-by: Michalis Katsoulis <michaelkatsoulis88@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-active-all Automated backport with mergify to all the active branches bugfix Team:obs-ds-hosted-services Label for the Observability Hosted Services team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants