{"record":{"id":"8d04aa728c3ac7a6","repo":"apache/beam","slug":"lpunknowncoders-coder-q-not-present-in-base-map","errorCode":null,"errorMessage":"lpUnknownCoders: coder %q not present in base map","messagePattern":"lpUnknownCoders: coder %q not present in base map","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"sdks/go/pkg/beam/runners/prism/internal/coders.go","lineNumber":149,"sourceCode":"// lpUnknownCoders takes a coder, and populates coders with any new coders\n// coders that the runner needs to be safe, and speedy.\n// It returns either the passed in coder id, or the new safe coder id.\nfunc lpUnknownCoders(cID string, bundle, base map[string]*pipepb.Coder) (string, error) {\n\t// First check if we've already added the LP version of this coder to coders already.\n\tlpcID := cID + \"_lp\"\n\t// Check if we've done this one before.\n\tif _, ok := bundle[lpcID]; ok {\n\t\treturn lpcID, nil\n\t}\n\t// All coders in the coders map have been processed.\n\tif _, ok := bundle[cID]; ok {\n\t\treturn cID, nil\n\t}\n\t// Look up the canonical location.\n\tc, ok := base[cID]\n\tif !ok {\n\t\t// We messed up somewhere.\n\t\treturn \"\", fmt.Errorf(\"lpUnknownCoders: coder %q not present in base map\", cID)\n\t}\n\t// Add the original coder to the coders map.\n\tbundle[cID] = c\n\t// If we don't know this coder, we must LP it, and we return the LP'd version.\n\tleaf := isLeafCoder(c)\n\tknownComposite := isKnownCompositeCoder(c)\n\tif !leaf && !knownComposite {\n\t\tlpc := &pipepb.Coder{\n\t\t\tSpec: &pipepb.FunctionSpec{\n\t\t\t\tUrn: urns.CoderLengthPrefix,\n\t\t\t},\n\t\t\tComponentCoderIds: []string{cID},\n\t\t}\n\t\tbundle[lpcID] = lpc\n\t\treturn lpcID, nil\n\t}\n\t// If it is a leaf, move its components (if any) to the coders map.\n\tif leaf {","sourceCodeStart":131,"sourceCodeEnd":167,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/runners/prism/internal/coders.go#L131-L167","documentation":"lpUnknownCoders looks up each coder ID in the pipeline's base coder map to decide whether it must be length-prefixed for the runner. This error means a coder ID was referenced but never defined in the base map — an internal consistency violation in the pipeline's coder graph, which the code comments as \"we messed up somewhere.\"","triggerScenarios":"Any of lpUnknownCoders' callers (makeWindowedValueCoder, recursive component traversal, collectionPullDecoder, getWindowValueCoders, handleTestStream) pass a coder ID absent from the base components' coders map.","commonSituations":"A PCollection or composite coder references a component coder ID that was never added when the pipeline proto was built; trimming logic dropped a coder still referenced; TestStream constructions with stale coder IDs.","solutions":["Dump the pipeline proto coders map and find which builder step omitted the referenced coder ID","Check for recent changes to pipeline construction/trimming that could drop coders still in use","Report to beam-dev or file a Beam issue with the pipeline proto if it comes from a standard SDK pipeline"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if _, ok := comps.GetCoders()[coderID]; !ok {\n    return fmt.Errorf(\"coder %q referenced but not defined\", coderID)\n}","typeGuard":null,"tryCatchPattern":"if _, err := lpUnknownCoders(cID, bundle, base); err != nil {\n    return fmt.Errorf(\"coder resolution failed: %w\", err)\n}","preventionTips":["Verify pipeline builders register every referenced coder","Re-check trimming/optimization passes that could drop still-referenced coders","Escalate reproducible cases to the Beam project as runner/SDK invariant bugs"],"tags":["beam","go","prism-runner","coders"],"backgroundTag":"internal-invariant-violation","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}