remotion-dev/remotion · error · Error

Cannot get account ID

Error message

Cannot get account ID

What it means

After calling STS GetCallerIdentity, if callerIdentity.Account is falsy the function throws 'Cannot get account ID'. GetCallerIdentity normally always returns the 12-digit account, so a missing Account indicates an unexpected STS response or a credential/permission problem with sts:GetCallerIdentity.

Source

Thrown at packages/lambda-client/src/get-account-id.ts:18

import {GetCallerIdentityCommand} from '@aws-sdk/client-sts';
import type {GetAccountId} from '@remotion/serverless-client';
import {getStsClient} from './aws-clients';
import type {AwsProvider} from './aws-provider';
import type {AwsRegion} from './regions';
import {validateAwsRegion} from './validate-aws-region';

export const getAccountIdImplementation: GetAccountId<
	AwsProvider
> = async (options: {region: AwsRegion}) => {
	validateAwsRegion(options.region);

	const callerIdentity = await getStsClient(options.region, null).send(
		new GetCallerIdentityCommand({}),
	);

	if (!callerIdentity.Account) {
		throw new Error('Cannot get account ID');
	}

	return callerIdentity.Account;
};

View on GitHub (pinned to 78fe4bb3fd)

Solutions

  1. Confirm the IAM user/role has permission for sts:GetCallerIdentity
  2. Retry the call (transient STS issues)
  3. Verify the credentials are complete and not mixed (see UnrecognizedClientException)
  4. Hardcode the account id via the getAccountIdInput overrides if STS is unavailable
Defensive patterns

Strategy: try-catch

Try / catch

try {
  const accountId = await getAccountId({ region });
} catch (err) {
  if ((err as Error).message === 'Cannot get account ID') {
    // verify sts:GetCallerIdentity permission / retry / pass accountId override
  }
  throw err;
}

Prevention

When it happens

Trigger: Calling getAccountId when STS responds without an Account field. Often paired with unusual IAM configurations or STS service issues.

Common situations: Credentials without permission to call sts:GetCallerIdentity, transient STS failure, non-standard STS endpoint, regional STS misconfiguration.

Related errors


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