Skip to content

🎥 Make videos programmatically with React

`@remotion/lambda`: Better text for Lambda errors

Jonny Burger19bb60f9d08b
diff --git a/packages/lambda/src/cli/helpers/find-function-name.ts b/packages/lambda/src/cli/helpers/find-function-name.ts
index 3f8cbbad5b..0b92236e1c 100644
--- a/packages/lambda/src/cli/helpers/find-function-name.ts
+++ b/packages/lambda/src/cli/helpers/find-function-name.ts
@@ -26,7 +26,7 @@ export const findFunctionName = async (logLevel: LogLevel) => {
if (lambdasWithMatchingVersion.length === 0) {
Log.error(
- `No lambda functions with version ${VERSION} found in your account.`,
+ `No Lambda functions with version ${VERSION} found in your account.`,
);
if (remotionLambdas.length > 0) {
Log.error(
@@ -51,7 +51,7 @@ export const findFunctionName = async (logLevel: LogLevel) => {
);
if (lambdasWithMatchingVersion.length === 0) {
Log.error(
- `No lambda function with name "${parsedLambdaCli['function-name']}" and version ${VERSION} found in your account.`,
+ `No Lambda function with name "${parsedLambdaCli['function-name']}" and version ${VERSION} found in your account.`,
);
Log.infoAdvanced(logOptions);
diff --git a/packages/lambda/src/cli/index.ts b/packages/lambda/src/cli/index.ts
index 9feecf2db7..86432d8623 100644
--- a/packages/lambda/src/cli/index.ts
+++ b/packages/lambda/src/cli/index.ts
@@ -182,11 +182,25 @@ AWS returned an "TooManyRequestsException" error message which could mean you re
'The security token included in the request is invalid',
)
) {
- Log.error(
- `
+ const keyButDoesntStartWithAki =
+ process.env.REMOTION_AWS_ACCESS_KEY_ID &&
+ !process.env.REMOTION_AWS_ACCESS_KEY_ID.startsWith('AKI');
+ const pureKeyButDoesntStartWithAki =
+ process.env.AWS_ACCESS_KEY_ID &&
+ !process.env.AWS_ACCESS_KEY_ID.startsWith('AKI');
+ if (keyButDoesntStartWithAki || pureKeyButDoesntStartWithAki) {
+ Log.error(
+ `
+ AWS returned an error message "The security token included in the request is invalid". A possible reason is that your AWS Access key ID is set but doesn't start with "AKI", which it usually should. The original message is:
+ `,
+ );
+ } else {
+ Log.error(
+ `
AWS returned an error message "The security token included in the request is invalid". A possible reason for this is that you did not enable the region in your AWS account under "Account". The original message is:
`,
- );
+ );
+ }
}
if (error instanceof RenderInternals.SymbolicateableError) {