From 09fced7dfee0774e3d66283631762f9b6c0de96f Mon Sep 17 00:00:00 2001 From: jedarden Date: Sat, 25 Apr 2026 11:07:08 -0400 Subject: [PATCH] fix(worker,index-builder): use us-east-1 region for S3-compatible endpoints The AWS SDK requires a valid AWS region name even when using custom S3-compatible endpoints (ARMOR/B2). Using "auto" as the region causes an error: "Invalid region: region was not a valid DNS name." This fixes the replay upload pipeline which was failing with the invalid region error. Replays should now upload successfully to B2 via the ARMOR proxy. Related to ai-code-battle-o43: Replay viewer verification task. --- cmd/acb-index-builder/s3.go | 2 +- cmd/acb-worker/b2.go | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/cmd/acb-index-builder/s3.go b/cmd/acb-index-builder/s3.go index 1084bcb..a3b5311 100644 --- a/cmd/acb-index-builder/s3.go +++ b/cmd/acb-index-builder/s3.go @@ -26,7 +26,7 @@ func NewS3Client(endpoint, accessKey, secretKey, bucket string) (*S3Client, erro config.WithCredentialsProvider(credentials.NewStaticCredentialsProvider( accessKey, secretKey, "", )), - config.WithRegion("auto"), + config.WithRegion("us-east-1"), ) if err != nil { return nil, fmt.Errorf("failed to load AWS config: %w", err) diff --git a/cmd/acb-worker/b2.go b/cmd/acb-worker/b2.go index 543ab4d..60349c5 100644 --- a/cmd/acb-worker/b2.go +++ b/cmd/acb-worker/b2.go @@ -22,14 +22,15 @@ type B2Client struct { // NewB2Client creates a new B2 client. func NewB2Client(cfg *Config) *B2Client { // Load AWS config with B2 credentials - // Use region "auto" for custom S3-compatible endpoints (ARMOR/B2) + // For S3-compatible endpoints (ARMOR/B2), use us-east-1 as a placeholder region + // The actual endpoint is overridden via BaseEndpoint in the S3 client awsCfg, err := config.LoadDefaultConfig(context.TODO(), config.WithCredentialsProvider(credentials.NewStaticCredentialsProvider( cfg.B2AccessKey, cfg.B2SecretKey, "", )), - config.WithRegion("auto"), + config.WithRegion("us-east-1"), ) if err != nil { panic(fmt.Sprintf("failed to load AWS config: %v", err))