{"record":{"id":"3fbf66ca43572c8a","repo":"apache/beam","slug":"opcode-should-be-one-of-pardo-or-combine-but-it-is-v","errorCode":null,"errorMessage":"Opcode should be one of ParDo or Combine, but it is: %v","messagePattern":"Opcode should be one of ParDo or Combine, but it is: (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/core/runtime/exec/translate.go","lineNumber":700,"sourceCode":"\t\t\t\t\tma := &MergeAccumulators{Combine: cn}\n\t\t\t\t\tif pc, ok := ma.Out.(*PCollection); ok {\n\t\t\t\t\t\tif eo, ok := pc.Out.(*ExtractOutput); ok {\n\t\t\t\t\t\t\t// Strip PCollections from between MergeAccumulators and ExtractOutputs\n\t\t\t\t\t\t\t// as it's a synthetic PCollection.\n\t\t\t\t\t\t\tb.units = b.units[:len(b.units)-1]\n\t\t\t\t\t\t\tma.Out = eo\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tu = ma\n\t\t\t\tcase urnPerKeyCombineExtract:\n\t\t\t\t\tu = &ExtractOutput{Combine: cn}\n\t\t\t\tcase urnPerKeyCombineConvert:\n\t\t\t\t\tu = &ConvertToAccumulators{Combine: cn}\n\t\t\t\tdefault: // For unlifted combines\n\t\t\t\t\tu = cn\n\t\t\t\t}\n\t\t\tdefault:\n\t\t\t\tpanic(fmt.Sprintf(\"Opcode should be one of ParDo or Combine, but it is: %v\", op))\n\t\t\t}\n\n\t\tcase graphx.URNIterableSideInputKey:\n\t\t\tu = &FixedKey{UID: b.idgen.New(), Key: []byte(iterableSideInputKey), Out: out[0]}\n\n\t\tcase graphx.URNInject:\n\t\t\tc, _, err := b.makeCoderForPCollection(from)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tif !coder.IsKV(c) {\n\t\t\t\treturn nil, errors.Errorf(\"unexpected inject coder: %v\", c)\n\t\t\t}\n\t\t\tvalCoder := c.Components[1]\n\t\t\t// JIRA BEAM-12438 - an extra LP coder can get added here, but isn't added\n\t\t\t// on decode. Strip them until we get a better fix.\n\t\t\tif valCoder.Kind == coder.LP {\n\t\t\t\t// strip unexpected length prefix coder.","sourceCodeStart":682,"sourceCodeEnd":718,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/core/runtime/exec/translate.go#L682-L718","documentation":"makeLink in the exec translator maps graph nodes to executable units. It only knows how to lower nodes whose opcode is ParDo or Combine; any other opcode reaching makeLink violates the translator's expectations and panics with this message. This is an internal translation invariant — such nodes should have been handled earlier in translation.","triggerScenarios":"A plan/pipe element with an unexpected opcode (e.g. Impulse, Flatten, or a runner-specific opcode) reaching makeLink; corrupted or hand-crafted pipeline plans; SDK/runner version skew producing opcodes this translator doesn't recognize.","commonSituations":"Running pipelines through custom runners or external environments that emit raw plans; mixing SDK versions (worker older than frontend); hand-built graphs in tests bypassing the graph package's validation.","solutions":["Align the Go SDK version used by the worker with the one that built the pipeline (use --workerHarnessContainerImage or matching releases)","Inspect the opcode value in the message and find which transform produced it in the graph dump","Remove/handle hand-constructed plan nodes; build pipelines only through the beam package APIs","If all versions match and a normal pipeline triggers it, file a Beam bug with the pipeline proto"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if op != graph.OpcodeParDo && op != graph.OpcodeCombine {\n    return fmt.Errorf(\"unsupported opcode for link: %v\", op)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Match worker and pipeline-builder SDK versions exactly","Build plans only through the beam/graph public APIs","Dump the plan when debugging custom runners and check opcodes before link building","Pin worker container images in CI to the SDK release used for submission"],"tags":["go","apache-beam","translation","panic"],"backgroundTag":"unsupported-enum-value","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"}