{"record":{"id":"35a78cebf86769e4","repo":"apache/beam","slug":"forcelpcoders-coder-q-not-present-in-base-map","errorCode":null,"errorMessage":"forceLpCoders: coder %q not present in base map","messagePattern":"forceLpCoders: coder %q not present in base map","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/runners/prism/internal/coders.go","lineNumber":213,"sourceCode":"\t\tbundle[lpcID] = lpc\n\t\treturn lpcID, nil\n\t}\n\treturn cID, nil\n}\n\n// forceLpCoder always add a new LP-coder for a given coder into the \"base\" map\nfunc forceLpCoder(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 + \"_flp\"\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// Look up the canonical location.\n\t_, ok := base[cID]\n\tif !ok {\n\t\t// We messed up somewhere.\n\t\treturn \"\", fmt.Errorf(\"forceLpCoders: coder %q not present in base map\", cID)\n\t}\n\n\tlpc := &pipepb.Coder{\n\t\tSpec: &pipepb.FunctionSpec{\n\t\t\tUrn: urns.CoderLengthPrefix,\n\t\t},\n\t\tComponentCoderIds: []string{cID},\n\t}\n\tbundle[lpcID] = lpc\n\treturn lpcID, nil\n}\n\n// retrieveCoders recursively ensures that the coder along with all its direct\n// and indirect component coders, are present in the `bundle` map.\n// If a coder is already in `bundle`, it's skipped. Returns an error if any\n// required coder ID is not found.\nfunc retrieveCoders(cID string, bundle, base map[string]*pipepb.Coder) error {\n\t// Look up the canonical location.","sourceCodeStart":195,"sourceCodeEnd":231,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/runners/prism/internal/coders.go#L195-L231","documentation":"forceLpCoder (message prefix \"forceLpCoders\") forcibly wraps a coder in a length-prefix coder for TestStream handling in the prism runner. This error means the coder ID it was asked to force-LP does not exist in the base coder map, so no wrapping can be produced — a broken coder reference in the test stream setup.","triggerScenarios":"handleTestStream builds a TestStream source whose declared coder ID is not present in the pipeline components' coders map.","commonSituations":"Test stream fixtures written against coders that were renamed/removed; hand-constructed test pipelines where the TestStream coder ID was never added to the components.","solutions":["Ensure the TestStream's coder ID is registered in the pipeline's coders map before handling the test stream","Update test fixtures to reference existing coder IDs after SDK coder changes","Compare the coder ID in the TestStream proto against the base map keys logged at failure"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if _, ok := base[cID]; !ok {\n    return fmt.Errorf(\"TestStream coder %q not registered\", cID)\n}","typeGuard":null,"tryCatchPattern":"if _, err := forceLpCoder(cID, bundle, base); err != nil {\n    t.Fatalf(\"test stream setup failed: %v\", err)\n}","preventionTips":["Register TestStream coder IDs in pipeline components before handling","Update test fixtures when SDK coder IDs change","Assert fixture coder IDs exist in the base map in test setup"],"tags":["beam","go","prism-runner","coders","test-stream"],"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"}