RocketChat/Rocket.Chat · warning

FileUpload_S3_Region is empty and AWS_REGION is not set; def

Error message

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.

What it means

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.

Source

Thrown at apps/meteor/server/lib/media/file-upload/config/AmazonS3.ts:103

		connection: {
			forcePathStyle: ForcePathStyle,
			followRegionRedirects: true,
		},
		params: {
			Bucket,
			ACL: Acl,
		},
		URLExpiryTimeSpan,
	};

	if (Region) {
		config.connection.region = Region;
	}

	// Back-compat: AWS SDK v2 defaulted unset region to us-east-1; v3 throws.
	if (!Region && !process.env.AWS_REGION) {
		config.connection.region = 'us-east-1';
		SystemLogger.warn(
			'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.',
		);
	}

	if (AWSAccessKeyId && AWSSecretAccessKey) {
		config.connection.credentials = {
			accessKeyId: AWSAccessKeyId,
			secretAccessKey: AWSSecretAccessKey,
		};
	}

	// Back-compat: AWS SDK v2 accepted scheme-less endpoints; v3 throws.
	if (BucketURL) {
		const isValidScheme = hasScheme(BucketURL);
		config.connection.endpoint = isValidScheme ? BucketURL : `https://${BucketURL}`;
		if (!isValidScheme) {
			SystemLogger.warn(`FileUpload_S3_BucketURL "${BucketURL}" has no scheme; defaulting to "https://${BucketURL}".`);
		}

View on GitHub (pinned to b2c16d5842)

Solutions

  1. Set FileUpload_S3_Region in Administration > File Upload > Amazon S3 to the bucket's region (e.g. 'us-east-1', 'eu-west-1')
  2. Or export AWS_REGION in the server environment if you want one region for all AWS clients
  3. Even if the bucket is us-east-1, set the value explicitly to silence the warning and pin the behavior
  4. Re-save the S3 settings so the FileUpload_S3_ watcher re-runs and picks up the region

Example fix

// before
FileUpload_S3_Region: ''
// env: AWS_REGION unset

// after
FileUpload_S3_Region: 'eu-west-1'
Defensive patterns

Strategy: validation

Validate before calling

const region = settings.get<string>('FileUpload_S3_Region')?.trim() || process.env.AWS_REGION;
if (!region) {
  // refuse to select S3 storage (or block saving) until a region is provided
  throw new Error('FileUpload_S3_Region (or AWS_REGION) must be set before enabling Amazon S3 storage');
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of RocketChat/Rocket.Chat@b2c16d5842 (2026-08-18). Data as JSON: /api/errors/c6291a009b751e4e. Report an issue: GitHub.