Skip to content

Allow blank S3 regions to be used

Stan Hu requested to merge sh-allow-blank-s3-region into master

If consolidated object storage is used without a region, Workhorse will fall back to making a direct HTTP PUT call to the S3 endpoint because GitLab Rails does not send the multipart upload URLs in this mode.

However, this will result a 411 Length Required error because multipart upload URLs must be used when the Content-Length header is not available.

An S3 region is not strictly required, particularly with Minio (though the SDK requires it: https://github.com/aws/aws-sdk-go/blob/9f84ca2f2a54bf5f92d6945e9264ba07a3a868de/aws/corehandlers/handlers.go#L224-L229). With Amazon S3, the region will default to US East (us-east-1). If the bucket does not exist in the region, S3 will return with a more informative error:

{"error":"MissingRegion: could not find region configuration","level":"error","msg":"error uploading S3 session","time":"2021-01-11T23:12:20Z"}

Relates to gitlab#297227 (closed)

Edited by Stan Hu

Merge request reports