{"record":{"id":"317ae73800d412c0","repo":"temporalio/temporal","slug":"empty-aws-region","errorCode":null,"errorMessage":"empty aws region","messagePattern":"empty aws region","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"common/archiver/s3store/history_archiver.go","lineNumber":42,"sourceCode":"\t\"go.temporal.io/server/common/log\"\n\t\"go.temporal.io/server/common/log/tag\"\n\t\"go.temporal.io/server/common/metrics\"\n\t\"go.temporal.io/server/common/persistence\"\n)\n\nconst (\n\t// URIScheme is the scheme for the s3 implementation\n\tURIScheme               = \"s3\"\n\terrEncodeHistory        = \"failed to encode history batches\"\n\terrWriteKey             = \"failed to write history to s3\"\n\tdefaultBlobstoreTimeout = time.Minute\n\ttargetHistoryBlobSize   = 2 * 1024 * 1024 // 2MB\n)\n\nvar (\n\terrNoBucketSpecified = errors.New(\"no bucket specified\")\n\terrBucketNotExists   = errors.New(\"requested bucket does not exist\")\n\terrEmptyAwsRegion    = errors.New(\"empty aws region\")\n\n\t// the retryer is used to check if the error is retryable\n\tawsRetryer aws.Retryer = retry.NewStandard()\n)\n\ntype (\n\thistoryArchiver struct {\n\t\texecutionManager persistence.ExecutionManager\n\t\tlogger           log.Logger\n\t\tmetricsHandler   metrics.Handler\n\t\ts3cli            S3API\n\t\t// only set in test code\n\t\thistoryIterator archiver.HistoryIterator\n\t}\n\n\tgetHistoryToken struct {\n\t\tCloseFailoverVersion int64\n\t\tBatchIdx             int","sourceCodeStart":24,"sourceCodeEnd":60,"githubUrl":"https://github.com/temporalio/temporal/blob/bde624efd13fbd3843654058db6d9c716166318b/common/archiver/s3store/history_archiver.go#L24-L60","documentation":"errEmptyAwsRegion is an unexported sentinel in common/archiver/s3store returned by newHistoryArchiver when config.S3Archiver.Region is an empty string. Before loading AWS credentials/config it requires an explicit region, because S3 is regional and requests without one fail with confusing AWS-side errors.","triggerScenarios":"Calling s3store.NewHistoryArchiver (via provider.GetHistoryArchiver(\"s3\")) with an S3Archiver config whose Region field is empty — e.g. the s3store block present in config but the region key omitted or templated to an empty value.","commonSituations":"Region key missing from the config YAML; envsubst/config templating leaving {{ .Region }} empty; copying an S3 config example that relies on ambient AWS default region resolution which this code intentionally does not allow.","solutions":["Set region explicitly in the s3store archiver config (e.g. `s3store: { region: us-east-1 }`) and restart the history service.","Check templated config rendering so the region variable is actually substituted.","Ensure GetHistoryArchiver is called with the right config pointer — a nil or empty S3Archiver in tests should be given a Region before use."],"exampleFix":"// config before\ns3store:\n  logLevel: \"error\" // no region -> errEmptyAwsRegion\n\n// config after\ns3store:\n  region: \"us-east-1\"\n  logLevel: \"error\"","handlingStrategy":"validation","validationCode":"if s3ArchiverConfig.Region == \"\" {\n\treturn errors.New(\"s3store archiver config requires a non-empty region\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always set region explicitly in the s3store archiver config block; do not rely on AWS default region chains.","Validate rendered config files (after templating/env substitution) for empty required fields at startup.","Include the s3store region in config schema validation and CI checks."],"tags":["archival","s3","aws","configuration","missing-config"],"backgroundTag":"missing-env-var","analyzedSha":"bde624efd13fbd3843654058db6d9c716166318b","analyzedAt":"2026-09-01T07:18:39.080Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}