{"record":{"id":"5515b6063900e29f","repo":"apache/beam","slug":"pcollection-v-not-found","errorCode":null,"errorMessage":"pcollection %v not found","messagePattern":"pcollection (.+?) not found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/core/runtime/exec/translate.go","lineNumber":350,"sourceCode":"\t\t// TODO[BEAM-6374): Properly handle the multiplex and flatten cases.\n\t\t// Right now we just stop datasink collection.\n\t\tswitch out := n.Out.(type) {\n\t\tcase *DataSink:\n\t\t\t// We don't remove the PCollection from units here, since we\n\t\t\t// want to ensure it's included in snapshots.\n\t\t\tout.PCol = n\n\t\t\tret = append(ret, out)\n\t\tdefault:\n\t\t\tret = append(ret, n)\n\t\t}\n\t}\n\treturn ret, nil\n}\n\nfunc (b *builder) makeCoderForPCollection(id string) (*coder.Coder, *coder.WindowCoder, error) {\n\tcol, ok := b.desc.GetPcollections()[id]\n\tif !ok {\n\t\treturn nil, nil, errors.Errorf(\"pcollection %v not found\", id)\n\t}\n\tc, err := b.coders.Coder(col.CoderId)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\tif coder.IsW(c) {\n\t\t// TODO(herohde) 3/16/2018: remove potential WindowedValue from Dataflow.\n\t\t// However, windowing strategies are not yet passed through, so the main\n\t\t// path always gives us GlobalWindows.\n\n\t\treturn coder.SkipW(c), c.Window, nil\n\t}\n\n\tws, ok := b.desc.GetWindowingStrategies()[col.GetWindowingStrategyId()]\n\tif !ok {\n\t\treturn nil, nil, errors.Errorf(\"windowing strategy %v not found\", id)\n\t}\n\twc, err := b.coders.WindowCoder(ws.GetWindowCoderId())","sourceCodeStart":332,"sourceCodeEnd":368,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/core/runtime/exec/translate.go#L332-L368","documentation":"makeCoderForPCollection looks up the PCollection by id in the pipeline description's Pcollections map. If the referenced id is absent, the builder cannot resolve coders for the node and fails with this error.","triggerScenarios":"A transform input/output link references a pcollection id that doesn't exist in desc.GetPcollections(), during newPCollectionNode or makeLink while unmarshalling a plan.","commonSituations":"Corrupt or hand-edited pipeline protos; runner bug dropping pcollection entries; version mismatch where ids were re-generated between plan submission and materialization.","solutions":["Verify every transform input/output in the pipeline proto has a corresponding entry in the Pcollections map","Regenerate the pipeline so ids are consistent (re-run pipeline construction)","Upgrade/align SDK and runner versions to avoid id mismatches"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Validate all link ids exist in the pcollections map\nfor _, t := range desc.GetTransforms() {\n    for id := range t.GetOutputs() {\n        if _, ok := desc.GetPcollections()[id]; !ok {\n            return fmt.Errorf(\"missing pcollection %s\", id)\n        }\n    }\n}","typeGuard":null,"tryCatchPattern":"if err := exec.UnmarshalPlan(desc); err != nil {\n    if strings.Contains(err.Error(), \"pcollection\") && strings.Contains(err.Error(), \"not found\") {\n        // regenerate pipeline description and retry\n    }\n}","preventionTips":["Build pipelines only through the standard Beam APIs so ids stay consistent","Never mutate generated pipeline protos by hand"],"tags":["go","apache-beam","pipeline-translation"],"backgroundTag":"entity-not-found","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"}