{"record":{"id":"14ad3ee0f07f2ea2","repo":"apache/beam","slug":"panic-err-propagating-lpunknowncoders-error-handlerunner","errorCode":null,"errorMessage":"panic(err) propagating lpUnknownCoders error","messagePattern":"panic\\(err\\) propagating lpUnknownCoders error","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/runners/prism/internal/handlerunner.go","lineNumber":233,"sourceCode":"\t// Return the new components which is the transforms consumer\n\treturn prepareResult{\n\t\tSubbedComps:   nil, // Replace the reshuffle with nothing.\n\t\tRemovedLeaves: toRemove,\n\t\tForcedRoots:   forcedRoots,\n\t}\n}\n\nfunc (h *runner) handleTestStream(tid string, t *pipepb.PTransform, comps *pipepb.Components) prepareResult {\n\tvar pyld pipepb.TestStreamPayload\n\tif err := proto.Unmarshal(t.GetSpec().GetPayload(), &pyld); err != nil {\n\t\tpanic(\"Failed to decode TestStreamPayload: \" + err.Error())\n\t}\n\tcoders := map[string]*pipepb.Coder{}\n\t// Ensure awareness of the coder used for the teststream.\n\tocID := pyld.GetCoderId()\n\tcID, err := lpUnknownCoders(ocID, coders, comps.GetCoders())\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// If the TestStream coder needs to be LP'ed or if it is a coder that has different\n\t// behaviors between nested context and outer context (in Java SDK), then we must\n\t// LP this coder and the TestStream data elements.\n\tforceLP := (cID != ocID && coders[ocID].GetSpec().GetUrn() != \"beam:go:coder:custom:v1\") ||\n\t\tcoders[ocID].GetSpec().GetUrn() == urns.CoderStringUTF8 ||\n\t\tcoders[ocID].GetSpec().GetUrn() == urns.CoderBytes ||\n\t\tcoders[ocID].GetSpec().GetUrn() == urns.CoderKV\n\n\tif !forceLP {\n\t\treturn prepareResult{SubbedComps: &pipepb.Components{\n\t\t\tTransforms: map[string]*pipepb.PTransform{tid: t},\n\t\t}}\n\t}\n\n\tvar mustLP func(v []byte) []byte\n\tif coders[ocID].GetSpec().GetUrn() != urns.CoderKV {","sourceCodeStart":215,"sourceCodeEnd":251,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/runners/prism/internal/handlerunner.go#L215-L251","documentation":"After decoding the TestStreamPayload, handleTestStream calls lpUnknownCoders to bring the TestStream's coder into the runner's known-coder set. Any error returned is re-raised as a panic because without a resolvable coder the TestStream's elements cannot be decoded or planned.","triggerScenarios":"The TestStream's coder ID refers to a coder missing from components.coders, or references nested/unknown coders that lpUnknownCoders fails to look up or convert.","commonSituations":"Cross-SDK TestStream pipelines where coder definitions weren't shipped in the job components; hand-rolled TestStream pipelines that reference a coder ID not registered in the pipeline graph.","solutions":["Check the TestStream's coder_id resolves to a coder present in the job's components.","Rebuild the pipeline through the SDK's teststream APIs so all referenced coders are registered in components.","Align SDK and prism versions so coder URNs used by the TestStream are understood by lpUnknownCoders.","Log/inspect the wrapped err for the specific missing coder ID and add or fix that coder definition."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if comps.GetCoders()[pyld.GetCoderId()] == nil { /* coder missing from components; fix graph */ }","typeGuard":null,"tryCatchPattern":"defer func(){ if r := recover(); r != nil { if e, ok := r.(error); ok { /* log e (lpUnknownCoders failure) */ } } }()","preventionTips":["Ensure every coder referenced by a TestStream is registered in pipeline components","Use SDK APIs so coders ship automatically","Match SDK/runner versions for coder URN support"],"tags":["go","apache-beam","prism-runner","coders"],"backgroundTag":"resource-not-found","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"}