{"record":{"id":"4225c6850e31ec45","repo":"remotion-dev/remotion","slug":"could-not-parse-lambda-progress-response-w","errorCode":null,"errorMessage":"could not parse Lambda progress response: %w","messagePattern":"could not parse Lambda progress response: %w","errorType":"exception","errorClass":"error","httpStatus":null,"severity":"error","filePath":"packages/lambda-go/invocations.go","lineNumber":97,"sourceCode":"\n\tinvocationParams := &lambda.InvokeInput{\n\t\tFunctionName: new(config.FunctionName),\n\t\tPayload:      internalParamsJSON,\n\t}\n\n\t// Invoke Lambda function\n\tinvokeResult, invokeError := svc.Invoke(context.Background(), invocationParams)\n\n\tif invokeError != nil {\n\t\treturn nil, fmt.Errorf(\"could not invoke Lambda function %q: %w\", config.FunctionName, invokeError)\n\t}\n\n\t// Unmarshal response from Lambda function\n\tvar renderProgressOutput RenderProgress\n\n\tresultUnmarshallError := json.Unmarshal(invokeResult.Payload, &renderProgressOutput)\n\tif resultUnmarshallError != nil {\n\t\treturn nil, fmt.Errorf(\"could not parse Lambda progress response: %w\", resultUnmarshallError)\n\t}\n\n\treturn &renderProgressOutput, nil\n}\n","sourceCodeStart":79,"sourceCodeEnd":102,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/lambda-go/invocations.go#L79-L102","documentation":"Returned when json.Unmarshal cannot decode the Lambda function's response payload into the RenderProgress struct. The Invoke succeeded at the transport level, but the bytes returned are not the JSON shape the Go client expects — typically because the deployed function is a different Remotion version than the client, or because the function returned an error envelope or plain text instead of progress JSON.","triggerScenarios":"invokeResult.Payload is valid JSON but does not match RenderProgress (missing fields, wrong types), is invalid JSON entirely (function returned a stack trace), or is an AWS/Lambda error envelope. Common after upgrading the client without upgrading the deployed function.","commonSituations":"Client is on lambda-go 4.x but the deployed Remotion Lambda function is still 3.x. The function crashed and returned an error envelope like `{\"errorMessage\":\"...\",\"errorType\":\"Error\"}`. A non-Remotion function is bound to the same name.","solutions":["Print invokeResult.Payload before unmarshalling to see what the function actually returned.","Align versions: redeploy the Remotion Lambda function so its version matches the lambda-go client (`npx remotion lambda functions deploy`).","Confirm FunctionName points at a Remotion-render function, not an unrelated Lambda."],"exampleFix":"// before\nresultUnmarshallError := json.Unmarshal(invokeResult.Payload, &renderProgressOutput)\n\n// after - surface the raw payload so the cause is obvious in logs\nif len(invokeResult.Payload) == 0 {\n    return nil, fmt.Errorf(\"empty Lambda progress response (FunctionError: %s)\", aws.ToString(invokeResult.FunctionError))\n}\nresultUnmarshallError := json.Unmarshal(invokeResult.Payload, &renderProgressOutput)","handlingStrategy":"validation","validationCode":"// Before unmarshalling, sanity-check the payload shape.\nfunc isProgressPayload(b []byte) bool {\n    var probe map[string]json.RawMessage\n    if err := json.Unmarshal(b, &probe); err != nil {\n        return false\n    }\n    _, hasDone := probe[\"done\"]\n    _, hasChunks := probe[\"chunks\"]\n    return hasDone && hasChunks\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep the lambda-go client and deployed Remotion Lambda function on the same version.","Log invokeResult.FunctionError and the raw payload when unmarshal fails.","Confirm the FunctionName targets a Remotion-render function, not an unrelated Lambda."],"tags":["json","version-mismatch","lambda","go","lambda-go"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}