{"record":{"id":"1ecb3a183ded8b92","repo":"apache/beam","slug":"found-v-inbound-want-v","errorCode":null,"errorMessage":"found %v inbound, want %v","messagePattern":"found (.+?) inbound, want (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/core/runtime/exec/fn.go","lineNumber":451,"sourceCode":"// ret5 handles processing five return values.\nfunc (n *invoker) ret5(pn typex.PaneInfo, ws []typex.Window, ts typex.EventTime, r0, r1, r2, r3, r4 any) (*FullValue, error) {\n\tif r4 != nil {\n\t\treturn nil, r4.(error)\n\t}\n\tif r3 == nil {\n\t\tpanic(fmt.Sprintf(\"invoker.ret5: cannot return a nil process continuation from function %v\", n.fn))\n\t}\n\tn.ret = FullValue{Windows: ws, Timestamp: r0.(typex.EventTime), Elm: r1, Elm2: r2, Continuation: r3.(sdf.ProcessContinuation)}\n\treturn &n.ret, nil\n}\n\nfunc makeSideInputs(ctx context.Context, w typex.Window, side []SideInputAdapter, reader StateReader, fn *funcx.Fn, in []*graph.Inbound) ([]ReusableInput, error) {\n\tif len(side) == 0 {\n\t\treturn nil, nil // ok: no side input\n\t}\n\n\tif len(in) != len(side)+1 {\n\t\treturn nil, errors.Errorf(\"found %v inbound, want %v\", len(in), len(side)+1)\n\t}\n\tparam := fn.Params(funcx.FnValue | funcx.FnIter | funcx.FnReIter | funcx.FnMultiMap)\n\tif len(param) <= len(side) {\n\t\treturn nil, errors.Errorf(\"found %v params, want >%v\", len(param), len(side))\n\t}\n\n\t// The side input are last of the above params, so we can compute the offset easily.\n\toffset := len(param) - len(side)\n\n\tvar ret []ReusableInput\n\tfor i, adapter := range side {\n\t\tinKind := in[i+1].Kind\n\t\tparams := fn.Param[param[i+offset]].T\n\t\t// Handle MultiMaps separately since they require more/different information\n\t\t// than the other side inputs\n\t\tif inKind == graph.MultiMap {\n\t\t\ts := makeMultiMap(ctx, params, side[i], reader, w)\n\t\t\tret = append(ret, s)","sourceCodeStart":433,"sourceCodeEnd":469,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/core/runtime/exec/fn.go#L433-L469","documentation":"makeSideInputs validates that a DoFn's inbound edges match its side inputs: there must be exactly len(side)+1 inbound edges (the main input plus each side input). If the counts disagree, the pipeline graph does not match the function signature, so the library refuses to build the side inputs and fails the stage at construction time.","triggerScenarios":"Calling initSideInput (during exec.Plan Up/processing-time setup) for a DoFn whose graph.Inbound list does not equal len(side)+1, e.g. a DoFn declares 2 side inputs but the node has 2 or 4 inbound edges.","commonSituations":"A DoFn was changed to accept an extra side input (or an extra main-input param) but the pipeline wiring in beam.ParDo/beam.TryParDo was not updated; a miscount when passing side inputs to beam.ParDo; pipeline graph produced by an older SDK version being re-expanded by a newer runner.","solutions":["Count the side inputs declared in the DoFn signature and ensure exactly one beam.SideInput is passed per side-input parameter to beam.ParDo, with exactly one main input.","Re-run the pipeline so expansion and execution use the same SDK version; stale expansion artifacts can produce mismatched inbound counts.","Inspect the DoFn signature for extra/missing parameters (context, emit functions) that shift the main vs side input split."],"exampleFix":"// before\nbeam.ParDo(s, &myFn{ /* declares 1 side input */ }, col, beam.SideInput{Input: other1}, beam.SideInput{Input: other2})\n\n// after (fn has only 1 side input param)\nbeam.ParDo(s, &myFn{}, col, beam.SideInput{Input: other1})","handlingStrategy":"validation","validationCode":"sideInputs := /* count beam.SideInput args passed to beam.ParDo */\ninbounds := /* inbound edges of the node, from pipeline graph or expansion output */\nif inboundCount != sideInputs+1 {\n    return fmt.Errorf(\"ParDo %T: %d side inputs require %d inbound edges, got %d\", fn, sideInputs, sideInputs+1, inboundCount)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep one beam.SideInput option per side-input DoFn parameter.","Rebuild expansion artifacts after changing DoFn signatures.","Test pipelines end-to-end after adding side inputs."],"tags":["go","apache-beam","pipeline-construction","side-input"],"backgroundTag":"invalid-argument-value","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"}