{"record":{"id":"c4c19f1771eb2b0e","repo":"remotion-dev/remotion","slug":"could-not-serialize-progress-parameters-w","errorCode":null,"errorMessage":"could not serialize progress parameters: %w","messagePattern":"could not serialize progress parameters: %w","errorType":"exception","errorClass":"error","httpStatus":null,"severity":"error","filePath":"packages/lambda-go/invocations.go","lineNumber":77,"sourceCode":"\n\tawsConfig, configError := awsconfig.LoadDefaultConfig(\n\t\tcontext.Background(),\n\t\tawsconfig.WithRegion(config.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 := constructGetProgressInternals(&config)\n\n\tif validateError != nil {\n\t\treturn nil, validateError\n\t}\n\n\tinternalParamsJSON, marshallingError := json.Marshal(internalParams)\n\tif marshallingError != nil {\n\t\treturn nil, fmt.Errorf(\"could not serialize progress parameters: %w\", marshallingError)\n\t}\n\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)","sourceCodeStart":59,"sourceCodeEnd":95,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/lambda-go/invocations.go#L59-L95","documentation":"Returned by invokeRenderProgressLambda when json.Marshal fails on the internal progress parameters built by constructGetProgressInternals. The %w wraps the encoding/json error, which typically means a value of an unsupported type (channel, func, complex, or an infinitely-recursive struct) ended up inside the struct being marshaled. Because the parameters are constructed by the library, this usually indicates a version mismatch between the Go client and the deployed Lambda function.","triggerScenarios":"The progress-params struct contains a field that encoding/json cannot serialize — e.g. a func value, a chan, or a self-referential struct with no json tag to break the cycle. Also seen when a struct field is of type complex128 or an unsupported map key type.","commonSituations":"Upgrading lambda-go without redeploying the Remotion Lambda function, so the client sends a struct shape the function no longer expects. Forking the library and adding a non-marshalable field to the internals struct. Passing an unexported type through json.Marshal that json cannot see.","solutions":["Check the wrapped error: `&json.UnsupportedTypeError{Type: ...}` tells you exactly which field is at fault.","Make sure the lambda-go version matches the deployed Remotion Lambda function version (`npx remotion lambda versions`).","If you maintain a fork, ensure every field on the internals struct is a JSON-safe type (string, number, bool, slice, map[string]X, pointer).","Add `json:\"-\"` tags to any field that must not be serialized."],"exampleFix":"// before\ntype progressInternals struct {\n    Callback *func() error // json.Marshal fails on func type\n}\n\n// after\ntype progressInternals struct {\n    CallbackURL string `json:\"callbackUrl\"`\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"progress, err := client.GetRenderProgress(ctx, cfg)\nif err != nil {\n    var typeErr *json.UnsupportedTypeError\n    if errors.As(err, &typeErr) {\n        // library internals are not serializable: version mismatch with deployed function\n        log.Printf(\"progress params cannot be serialized: %s - realign lambda-go and deployed function versions\", typeErr.Type)\n    }\n    return nil, err\n}","preventionTips":["Pin the lambda-go client version to match the deployed Remotion Lambda function version.","If forking the library, run go test with -race and a marshal round-trip on every internal struct.","Treat a json.Marshal failure on library internals as a version-mismatch signal first."],"tags":["json","serialization","go","lambda-go"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}