{"record":{"id":"f71bc9636a2d9af5","repo":"remotion-dev/remotion","slug":"could-not-invoke-lambda-function-q-w","errorCode":null,"errorMessage":"could not invoke Lambda function %q: %w","messagePattern":"could not invoke Lambda function %q: %w","errorType":"exception","errorClass":"error","httpStatus":null,"severity":"error","filePath":"packages/lambda-go/invocations.go","lineNumber":43,"sourceCode":"\tif validateError != nil {\n\t\treturn nil, validateError\n\t}\n\n\tinternalParamJsonObject, marshallingError := json.Marshal(internalParams)\n\tif marshallingError != nil {\n\t\treturn nil, fmt.Errorf(\"could not serialize render parameters: %w\", marshallingError)\n\t}\n\n\tinvocationPayload := &lambda.InvokeInput{\n\t\tFunctionName: new(options.FunctionName),\n\t\tPayload:      internalParamJsonObject,\n\t}\n\n\t// Invoke Lambda function\n\tinvocationResult, invocationError := svc.Invoke(context.Background(), invocationPayload)\n\n\tif invocationError != nil {\n\t\treturn nil, fmt.Errorf(\"could not invoke Lambda function %q: %w\", options.FunctionName, invocationError)\n\t}\n\n\t// Unmarshal response from Lambda function\n\tvar renderResponseOutput RemotionRenderResponse\n\n\tresponseMarshallingError := json.Unmarshal(invocationResult.Payload, &renderResponseOutput)\n\n\tif responseMarshallingError != nil {\n\t\treturn nil, fmt.Errorf(\"could not parse Lambda response: %w\", responseMarshallingError)\n\t}\n\n\treturn &renderResponseOutput, nil\n}\n\nfunc invokeRenderProgressLambda(config RenderConfig) (*RenderProgress, error) {\n\n\tawsConfig, configError := awsconfig.LoadDefaultConfig(\n\t\tcontext.Background(),","sourceCodeStart":25,"sourceCodeEnd":61,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/lambda-go/invocations.go#L25-L61","documentation":"Returned by invokeRenderLambda() / invokeRenderProgressLambda() in lambda-go when svc.Invoke() fails to call the Lambda function. The function name is interpolated with %q and the underlying AWS error is wrapped with %w. Causes include non-existent function, wrong region, permission denied, throttling, or network failure.","triggerScenarios":"Passing options.FunctionName that does not exist in the configured region; an IAM principal without lambda:InvokeFunction; hitting the Lambda invocation throttle limit; transient network errors; the function being in UPDATE_IN_PROGRESS state.","commonSituations":"Typo in the function name; deploying the Lambda to a different region than the one set on RemotionOptions; the caller's IAM role lacks invoke permission; high concurrency pushing past account concurrency limits.","solutions":["Verify the function name exists in the configured region: `aws lambda get-function --region <r> --function-name <n>`.","Check the caller's IAM policy includes lambda:InvokeFunction on the function ARN.","Inspect the wrapped error to distinguish NotFound vs. AccessDenied vs. TooManyRequestsException; retry only on throttle/transient errors."],"exampleFix":"// before\nresp, err := lambda_go_sdk.RenderMedia(lambda_go_sdk.RemotionOptions{Region: \"us-east-1\", FunctionName: \"remotion-render\"});\n\n// after\n// function actually deployed in us-west-2\nresp, err := lambda_go_sdk.RenderMedia(lambda_go_sdk.RemotionOptions{Region: \"us-west-2\", FunctionName: \"remotion-render-dev\"});","handlingStrategy":"retry","validationCode":"// Pre-flight: confirm the function is invocable.\nif _, err := lambdaClient.GetFunction(ctx, &lambda.GetFunctionInput{FunctionName: &name}); err != nil { return err }","typeGuard":null,"tryCatchPattern":"for i := 0; i < 3; i++ {\n  resp, err := lambda_go_sdk.RenderMedia(opts)\n  if err == nil { break }\n  var apiErr smithy.APIError\n  if errors.As(err, &apiErr) && (apiErr.ErrorCode() == \"TooManyRequestsException\" || apiErr.ErrorCode() == \"ServiceUnavailable\") {\n    time.Sleep(backoff(i)); continue\n  }\n  return err // NotFound, AccessDenied — do not retry\n}","preventionTips":["Verify the function name and region with `aws lambda get-function` before deploying your caller.","Grant lambda:InvokeFunction to the caller's IAM role.","Retry only on throttle/service-unavailable errors with exponential backoff; fail fast on NotFound/AccessDenied."],"tags":["lambda-go","aws","iam","network","go"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}