{"record":{"id":"87eb0800bd4b0b91","repo":"apache/beam","slug":"failed-to-serialize-v","errorCode":null,"errorMessage":"failed to serialize %v","messagePattern":"failed to serialize (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/core/runtime/graphx/translate.go","lineNumber":1483,"sourceCode":"\t\treturn nil, errors.Errorf(\"unexpected windowing strategy: %v\", w)\n\t}\n}\n\nfunc makeWindowCoder(w *window.Fn) (*coder.WindowCoder, error) {\n\tswitch w.Kind {\n\tcase window.GlobalWindows:\n\t\treturn coder.NewGlobalWindow(), nil\n\tcase window.FixedWindows, window.SlidingWindows, window.Sessions, URNSlidingWindowsWindowFn:\n\t\treturn coder.NewIntervalWindow(), nil\n\tdefault:\n\t\treturn nil, errors.Errorf(\"unexpected windowing strategy for coder: %v\", w)\n\t}\n}\n\nfunc mustEncodeMultiEdgeBase64(edge *graph.MultiEdge) (string, error) {\n\tref, err := EncodeMultiEdge(edge)\n\tif err != nil {\n\t\treturn \"\", errors.Wrapf(err, \"failed to serialize %v\", edge)\n\t}\n\treturn protox.MustEncodeBase64(&v1pb.TransformPayload{\n\t\tUrn:  URNDoFn,\n\t\tEdge: ref,\n\t}), nil\n}\n\nfunc edgeID(edge *graph.MultiEdge) string {\n\treturn fmt.Sprintf(\"e%v\", edge.ID())\n}\n\nfunc nodeID(n *graph.Node) string {\n\treturn fmt.Sprintf(\"n%v\", n.ID())\n}\n\nfunc scopeID(s *graph.Scope) string {\n\treturn fmt.Sprintf(\"s%v\", s.ID())\n}","sourceCodeStart":1465,"sourceCodeEnd":1501,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/core/runtime/graphx/translate.go#L1465-L1501","documentation":"mustEncodeMultiEdgeBase64 wraps any failure from EncodeMultiEdge (serializing a transform/MultiEdge into a proto ref) with this message. It indicates the DoFn or transform payload could not be serialized during pipeline graph encoding.","triggerScenarios":"EncodeMultiEdge returns an error (e.g. a DoFn with unsupported parameters, unserializable side input/state, or an invalid graph edge) while encoding a multi-edge for the runner payload.","commonSituations":"Using a DoFn whose signature or fields are not serializable; passing unsupported side inputs or custom coders; graph construction bugs from misuse of the beam scope API.","solutions":["Inspect the wrapped cause (errors.Wrapf preserves it) for the real serialization failure.","Verify the DoFn conforms to beam.DoFn requirements (ProcessElement signature, exportable fields).","Remove or replace custom coders/side inputs that fail to serialize, and rebuild the pipeline with a supported transform."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"ref, err := graphx.EncodeMultiEdge(edge)\nif err != nil {\n    return fmt.Errorf(\"transform %v not serializable: %w\", edge, err)\n}","preventionTips":["Keep DoFn structs simple and free of unserializable fields (channels, funcs, open handles).","Test pipeline construction locally with a direct runner before submitting.","Read the wrapped cause first; graphx errors nest the real failure."],"tags":["go","apache-beam","serialization","pipeline-translation"],"backgroundTag":"json-marshal-failed","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-20T03:17:13.778Z"}