{"record":{"id":"18b333f931f3b035","repo":"remotion-dev/remotion","slug":"cannot-get-account-id","errorCode":null,"errorMessage":"Cannot get account ID","messagePattern":"Cannot get account ID","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/lambda-client/src/get-account-id.ts","lineNumber":18,"sourceCode":"import {GetCallerIdentityCommand} from '@aws-sdk/client-sts';\nimport type {GetAccountId} from '@remotion/serverless-client';\nimport {getStsClient} from './aws-clients';\nimport type {AwsProvider} from './aws-provider';\nimport type {AwsRegion} from './regions';\nimport {validateAwsRegion} from './validate-aws-region';\n\nexport const getAccountIdImplementation: GetAccountId<\n\tAwsProvider\n> = async (options: {region: AwsRegion}) => {\n\tvalidateAwsRegion(options.region);\n\n\tconst callerIdentity = await getStsClient(options.region, null).send(\n\t\tnew GetCallerIdentityCommand({}),\n\t);\n\n\tif (!callerIdentity.Account) {\n\t\tthrow new Error('Cannot get account ID');\n\t}\n\n\treturn callerIdentity.Account;\n};\n","sourceCodeStart":1,"sourceCodeEnd":23,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/lambda-client/src/get-account-id.ts#L1-L23","documentation":"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.","triggerScenarios":"Calling getAccountId when STS responds without an Account field. Often paired with unusual IAM configurations or STS service issues.","commonSituations":"Credentials without permission to call sts:GetCallerIdentity, transient STS failure, non-standard STS endpoint, regional STS misconfiguration.","solutions":["Confirm the IAM user/role has permission for sts:GetCallerIdentity","Retry the call (transient STS issues)","Verify the credentials are complete and not mixed (see UnrecognizedClientException)","Hardcode the account id via the getAccountIdInput overrides if STS is unavailable"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  const accountId = await getAccountId({ region });\n} catch (err) {\n  if ((err as Error).message === 'Cannot get account ID') {\n    // verify sts:GetCallerIdentity permission / retry / pass accountId override\n  }\n  throw err;\n}","preventionTips":["Ensure the IAM principal can call sts:GetCallerIdentity","Provide an explicit account id override when STS is unavailable","Retry transient STS failures before surfacing"],"tags":["aws","sts","iam","account"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}