{"record":{"id":"fbbfc132d46780c1","repo":"remotion-dev/remotion","slug":"could-not-load-aws-config-w","errorCode":null,"errorMessage":"could not load AWS config: %w","messagePattern":"could not load AWS config: %w","errorType":"exception","errorClass":"error","httpStatus":null,"severity":"critical","filePath":"packages/lambda-go/invocations.go","lineNumber":19,"sourceCode":"package lambda_go_sdk\n\nimport (\n\t\"context\"\n\t\"encoding/json\"\n\t\"fmt\"\n\n\tawsconfig \"github.com/aws/aws-sdk-go-v2/config\"\n\t\"github.com/aws/aws-sdk-go-v2/service/lambda\"\n)\n\nfunc invokeRenderLambda(options RemotionOptions) (*RemotionRenderResponse, error) {\n\n\tawsConfig, configError := awsconfig.LoadDefaultConfig(\n\t\tcontext.Background(),\n\t\tawsconfig.WithRegion(options.Region),\n\t)\n\tif configError != nil {\n\t\treturn nil, fmt.Errorf(\"could not load AWS config: %w\", configError)\n\t}\n\tsvc := lambda.NewFromConfig(awsConfig)\n\n\tinternalParams, validateError := constructRenderInternals(&options)\n\n\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}","sourceCodeStart":1,"sourceCodeEnd":37,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/lambda-go/invocations.go#L1-L37","documentation":"Returned by the Go SDK (lambda-go) invokeRenderLambda() when awsconfig.LoadDefaultConfig() fails to build an AWS config for the given region. The Go error is wrapped with %w so the underlying AWS SDK error (missing credentials, invalid region, profile not found) is preserved for inspection via errors.Unwrap.","triggerScenarios":"Calling RenderMedia() with options.Region unset or invalid, no AWS credentials in the environment (no env vars, no ~/.aws/credentials, no attached IAM role), or AWS_PROFILE pointing at a non-existent profile.","commonSituations":"Running the Go binary locally without `aws configure`; deploying to a host without an instance/role credential; a typo in AWS_REGION; an SDK v2 upgrade that changed credential-chain precedence.","solutions":["Run `aws configure` (or set AWS_ACCESS_KEY_ID / AWS_SECRET_ACCESS_KEY / AWS_REGION) and retry.","Verify options.Region is one of the valid AWS regions before calling RenderMedia().","Inspect the wrapped error with errors.Unwrap or fmt.Printf(\"%+v\", err) to see the exact credential/config failure."],"exampleFix":"// before\nresp, err := lambda_go_sdk.RenderMedia(lambda_go_sdk.RemotionOptions{FunctionName: \"remotion-render-dev\"});\n\n// after\nos.Setenv(\"AWS_REGION\", \"us-east-1\");\nos.Setenv(\"AWS_ACCESS_KEY_ID\", \"AKIA...\");\nos.Setenv(\"AWS_SECRET_ACCESS_KEY\", \"...\");\nresp, err := lambda_go_sdk.RenderMedia(lambda_go_sdk.RemotionOptions{Region: \"us-east-1\", FunctionName: \"remotion-render-dev\"});","handlingStrategy":"try-catch","validationCode":"// Verify AWS config is loadable before calling RenderMedia.\ncfg, err := awsconfig.LoadDefaultConfig(ctx, awsconfig.WithRegion(\"us-east-1\"))\nif err != nil { log.Fatalf(\"aws config: %v\", err) }","typeGuard":null,"tryCatchPattern":"resp, err := lambda_go_sdk.RenderMedia(opts)\nif err != nil {\n  if strings.Contains(err.Error(), \"could not load AWS config\") {\n    // credential/config problem — surface to operator, do not retry.\n  }\n  var awsErr smithy.APIError; if errors.As(err, &awsErr) { /* classify */ }\n}","preventionTips":["Run `aws configure` or attach an IAM role on every host that runs the SDK.","Validate options.Region against the known region list before calling RenderMedia().","Inspect wrapped errors with errors.Unwrap to get the exact AWS SDK failure."],"tags":["lambda-go","aws","credentials","configuration","go"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}