Skip to content

feat: let the S3 client address a bucket path-style - #378

Closed
nGervasyuk wants to merge 1 commit into
Visual-Regression-Tracker:masterfrom
nGervasyuk:feat/s3-path-style
Closed

nGervasyuk wants to merge 1 commit into
Visual-Regression-Tracker:masterfrom
nGervasyuk:feat/s3-path-style

Conversation

@nGervasyuk

Copy link
Copy Markdown
Collaborator

S3-compatible storage — MinIO, Ceph, Garage — is normally reached path-style (host/bucket/key). AWS uses virtual-host style (bucket.host/key), the SDK assumes that, and it has no environment variable for the switch. new S3Client() is constructed with no configuration, so there was no way to change it.

The result is that pointing VRT at anything other than AWS fails at the first upload:

Could not save file at AWS S3 : Error: getaddrinfo ENOTFOUND vrt.minio

The endpoint itself the SDK already reads from AWS_ENDPOINT_URL, so that half worked; only the addressing style was unreachable.

AWS_S3_FORCE_PATH_STYLE=true now turns it on. Unset, the SDK keeps deciding for itself, so nothing changes for an AWS deployment — the client is constructed with an empty config exactly as before.

Why it is worth having

Beyond self-hosters using their own object storage, this is what makes it possible to stand up a stack that behaves like production locally: images in S3-compatible storage, reached through the API's signed-URL redirect. That path — the redirect, the pre-signed URL, its caching — simply does not exist on the HDD backend, so a local HDD instance cannot reproduce or reveal anything about it. Verified here against MinIO end to end: uploads land in the bucket, /images/:name redirects to a path-style signed URL, and the browser follows it.

Tests

Two, watched failing first: the client is constructed with forcePathStyle when the variable is set, and is left to the SDK's own choice when it is not.

All backend spec files pass.

S3-compatible storage — MinIO, Ceph, Garage — is normally reached
path-style (host/bucket/key). AWS uses virtual-host style (bucket.host/key)
and the SDK assumes that, with no environment variable for the switch, so a
deployment pointing VRT at its own storage got requests for a hostname that
does not resolve. The endpoint itself the SDK already reads from
AWS_ENDPOINT_URL; only the addressing style was unreachable.

AWS_S3_FORCE_PATH_STYLE=true turns it on. Unset, the SDK keeps deciding for
itself, so nothing changes for an AWS deployment.
@coderabbitai

coderabbitai Bot commented Sep 4, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 11 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Team

Run ID: 84f7cc6c-7699-4dd4-8ee5-62a4f5d8a292

📥 Commits

Reviewing files that changed from the base of the PR and between 73dc6af and ad9a4fb.

📒 Files selected for processing (2)
  • src/static/aws/s3.service.spec.ts
  • src/static/aws/s3.service.ts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@nGervasyuk

Copy link
Copy Markdown
Collaborator Author

Closing — not wanted upstream for now. The change came out of standing up a production-shaped stack locally against MinIO, where the SDK's virtual-host addressing makes every upload fail; it is not needed by the deployment that prompted it, which is on AWS proper.

Leaving it here rather than deleting the reasoning: AWS_ENDPOINT_URL is already honoured, so pointing VRT at S3-compatible storage is half-supported today and fails only on the addressing style. If anyone self-hosting with MinIO/Ceph/Garage hits the same getaddrinfo ENOTFOUND <bucket>.<host>, this is the missing piece.

@nGervasyuk nGervasyuk closed this Sep 4, 2026
@nGervasyuk
nGervasyuk deleted the feat/s3-path-style branch September 4, 2026 09: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.

1 participant