remotion-dev/remotion · error · TypeError

The 'expiresIn' parameter must be less or equal than ${MAX_P

Error message

The 'expiresIn' parameter must be less or equal than ${MAX_PRESIGN_EXPIRATION} (7 days) as enforced by AWS

What it means

Thrown by validatePresignExpiration() when expiresIn is an integer greater than 604800 (7 days). AWS S3 / Lambda presigned URLs cannot be valid for more than 7 days; this is a hard AWS-enforced ceiling, not a Remotion choice.

Source

Thrown at packages/lambda-client/src/validate-presign-expiration.ts:36

		throw new TypeError(`'expiresIn' should not be NaN, but is NaN`);
	}

	if (!Number.isFinite(presignExpiration)) {
		throw new TypeError(
			`'expiresIn' should be finite but is ${presignExpiration}`,
		);
	}

	if (presignExpiration % 1 !== 0) {
		throw new TypeError(
			`'expiresIn' should be an integer but is ${JSON.stringify(
				presignExpiration,
			)}`,
		);
	}

	if (presignExpiration > MAX_PRESIGN_EXPIRATION) {
		throw new TypeError(
			`The 'expiresIn' parameter must be less or equal than ${MAX_PRESIGN_EXPIRATION} (7 days) as enforced by AWS`,
		);
	}

	if (presignExpiration < MIN_PRESIGN_EXPIRATION) {
		throw new TypeError(
			`The 'expiresIn' parameter must be greater or equal than ${MIN_PRESIGN_EXPIRATION}`,
		);
	}
};

View on GitHub (pinned to 78fe4bb3fd)

Solutions

  1. Lower expiresIn to 604800 or less (e.g. 86400 for 24 hours).
  2. Double-check the unit: the value is in SECONDS, not minutes.
  3. If a longer-lived URL is truly needed, re-issue the presigned URL from your own backend before expiry instead of exceeding 7 days.

Example fix

// before
await renderMediaOnLambda({..., opts: {expiresIn: 7 * 24 * 3600 * 2}}); // 14 days

// after
await renderMediaOnLambda({..., opts: {expiresIn: 7 * 24 * 3600}}); // 7 days max
Defensive patterns

Strategy: validation

Validate before calling

const SEVEN_DAYS = 604800;
const expiresIn = Math.min(Math.round(Number(input)), SEVEN_DAYS);

Type guard

const isWithinAwsLimit = (v: unknown): v is number =>
  typeof v === 'number' && Number.isFinite(v) && v % 1 === 0 && v >= 1 && v <= 604800;

Prevention

When it happens

Trigger: Passing expiresIn: 604801, expiresIn computed as 8 days in seconds (691200), or a long-lived token value copied from another system.

Common situations: Wanting a 'permanent' download link; confusing seconds with minutes/hours (passing 6048000 = ~70 days); copying a TTL from a non-AWS presign implementation.

Related errors


AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12). Data as JSON: /api/errors/69d6a48f70204149. Report an issue: GitHub.