Skip to content

fix(s3): default S3_REGION to us-east-1 instead of empty string#495

Merged
hjball merged 1 commit into
kanbn:mainfrom
10xdeca:fix/s3-region-default
May 16, 2026
Merged

fix(s3): default S3_REGION to us-east-1 instead of empty string#495
hjball merged 1 commit into
kanbn:mainfrom
10xdeca:fix/s3-region-default

Conversation

@nickmeinhold

Copy link
Copy Markdown
Contributor

Summary

The AWS SDK throws Region is missing when S3Client is constructed with an empty-string region, so any S3 feature (avatars, attachments, presigned URL generation) is silently broken when S3_REGION is unset — even though .env.example ships it unset and apps/web/src/env.ts declares it optional(). The schema and the runtime disagreed about whether the var was required.

This PR defaults to us-east-1 in createS3Client. S3-compatible providers (MinIO, Backblaze B2, R2, DigitalOcean Spaces, Wasabi) ignore the region entirely; real AWS S3 users should set S3_REGION explicitly to their bucket's actual region (clarified in .env.example).

Found while debugging an unrelated PDF-attachment issue (#494) — couldn't reproduce locally because the smoke harness exploded on Region is missing before reaching the actual code path.

Test plan

  • With S3_REGION unset, attachment upload no longer 500s on S3Client construction
  • With S3_REGION explicitly set (e.g. eu-west-1), behaviour is unchanged
  • MinIO / R2 / Spaces deployments unaffected

🤖 Generated with Claude Code

The AWS SDK throws "Region is missing" when S3Client is constructed
with an empty-string region, so any S3 feature (avatars, attachments,
presigned URL generation) is silently broken when S3_REGION is unset
— even though .env.example ships it unset and env.ts declares it
optional. The schema and the runtime disagreed about whether the var
was required.

Default to "us-east-1" in createS3Client. S3-compatible providers
(MinIO, Backblaze B2, R2, DigitalOcean Spaces, Wasabi) ignore the
region entirely; real AWS S3 users should set S3_REGION explicitly
to their bucket's actual region (clarified in .env.example).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

@hjball hjball 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.

Seems sensible to me @nickmeinhold

@hjball hjball merged commit f801d2a into kanbn:main May 16, 2026
1 check passed
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