From 9d45b46f4c53deeb37f2fa89acf37913ec066afd Mon Sep 17 00:00:00 2001 From: Nikolay Date: Tue, 27 Jul 2021 12:35:38 +0300 Subject: [PATCH] adds check for region with custom s3 endpoint (#1465) --- lib/backup/s3remote/s3.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/backup/s3remote/s3.go b/lib/backup/s3remote/s3.go index 9bfc1ecfb..ad8e60c5a 100644 --- a/lib/backup/s3remote/s3.go +++ b/lib/backup/s3remote/s3.go @@ -75,6 +75,11 @@ func (fs *FS) Init() error { if len(fs.CustomEndpoint) > 0 { // Use provided custom endpoint for S3 logger.Infof("Using provided custom S3 endpoint: %q", fs.CustomEndpoint) + // hack for https://github.com/VictoriaMetrics/VictoriaMetrics/issues/1449 + if sess.Config.Region == nil || *sess.Config.Region == "" { + logger.Infof("Region is not defined for custom S3 endpoint, using `us-east-1` as default") + sess.Config.WithRegion("us-east-1") + } sess.Config.WithEndpoint(fs.CustomEndpoint) // Disable prefixing endpoint with bucket name