{"record":{"id":"c6291a009b751e4e","repo":"RocketChat/Rocket.Chat","slug":"fileupload-s3-region-is-empty-and-aws-region-is-no","errorCode":null,"errorMessage":"FileUpload_S3_Region is empty and AWS_REGION is not set; defaulting to us-east-1. Set FileUpload_S3_Region or AWS_REGION to silence this warning.","messagePattern":"FileUpload_S3_Region is empty and AWS_REGION is not set; defaulting to us-east-1\\. Set FileUpload_S3_Region or AWS_REGION to silence this warning\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"apps/meteor/server/lib/media/file-upload/config/AmazonS3.ts","lineNumber":103,"sourceCode":"\t\tconnection: {\n\t\t\tforcePathStyle: ForcePathStyle,\n\t\t\tfollowRegionRedirects: true,\n\t\t},\n\t\tparams: {\n\t\t\tBucket,\n\t\t\tACL: Acl,\n\t\t},\n\t\tURLExpiryTimeSpan,\n\t};\n\n\tif (Region) {\n\t\tconfig.connection.region = Region;\n\t}\n\n\t// Back-compat: AWS SDK v2 defaulted unset region to us-east-1; v3 throws.\n\tif (!Region && !process.env.AWS_REGION) {\n\t\tconfig.connection.region = 'us-east-1';\n\t\tSystemLogger.warn(\n\t\t\t'FileUpload_S3_Region is empty and AWS_REGION is not set; defaulting to us-east-1. Set FileUpload_S3_Region or AWS_REGION to silence this warning.',\n\t\t);\n\t}\n\n\tif (AWSAccessKeyId && AWSSecretAccessKey) {\n\t\tconfig.connection.credentials = {\n\t\t\taccessKeyId: AWSAccessKeyId,\n\t\t\tsecretAccessKey: AWSSecretAccessKey,\n\t\t};\n\t}\n\n\t// Back-compat: AWS SDK v2 accepted scheme-less endpoints; v3 throws.\n\tif (BucketURL) {\n\t\tconst isValidScheme = hasScheme(BucketURL);\n\t\tconfig.connection.endpoint = isValidScheme ? BucketURL : `https://${BucketURL}`;\n\t\tif (!isValidScheme) {\n\t\t\tSystemLogger.warn(`FileUpload_S3_BucketURL \"${BucketURL}\" has no scheme; defaulting to \"https://${BucketURL}\".`);\n\t\t}","sourceCodeStart":85,"sourceCodeEnd":121,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0/apps/meteor/server/lib/media/file-upload/config/AmazonS3.ts#L85-L121","documentation":"Emitted while configuring the Amazon S3 upload store when FileUpload_S3_Region is empty and the AWS_REGION environment variable is not set. AWS SDK v2 silently defaulted the region to us-east-1, but v3 throws when no region is configured — so Rocket.Chat applies the old default explicitly and warns to make the implicit choice visible.","triggerScenarios":"Selecting Amazon S3 as file upload storage without filling the Region field, on a server without AWS_REGION exported. The watcher (settings.watchByRegex(/^FileUpload_S3_/)) re-runs the config and hits this on every S3 settings change while Region stays blank.","commonSituations":"Deployments migrated from older Rocket.Chat versions where Region was optional and never set; buckets actually in us-east-1 where admins relied on the SDK default; self-hosted S3-compatible stores where region seems irrelevant but the v3 SDK still requires one.","solutions":["Set FileUpload_S3_Region in Administration > File Upload > Amazon S3 to the bucket's region (e.g. 'us-east-1', 'eu-west-1')","Or export AWS_REGION in the server environment if you want one region for all AWS clients","Even if the bucket is us-east-1, set the value explicitly to silence the warning and pin the behavior","Re-save the S3 settings so the FileUpload_S3_ watcher re-runs and picks up the region"],"exampleFix":"// before\nFileUpload_S3_Region: ''\n// env: AWS_REGION unset\n\n// after\nFileUpload_S3_Region: 'eu-west-1'","handlingStrategy":"validation","validationCode":"const region = settings.get<string>('FileUpload_S3_Region')?.trim() || process.env.AWS_REGION;\nif (!region) {\n  // refuse to select S3 storage (or block saving) until a region is provided\n  throw new Error('FileUpload_S3_Region (or AWS_REGION) must be set before enabling Amazon S3 storage');\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Set FileUpload_S3_Region explicitly on every environment, even us-east-1","Standardize on AWS_REGION in infrastructure env files when multiple AWS integrations run","Smoke-test file upload after switching storage to S3"],"tags":["s3","aws","file-upload","configuration","aws-sdk-v3"],"backgroundTag":"missing-aws-region","analyzedSha":"b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0","analyzedAt":"2026-08-18T15:26:39.429Z","contentChangedAt":"2026-08-18T15:26:39.429Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}