apache/beam · error

too many inputs

Error message

too many inputs

What it means

The mirror case of 4414: findInbound consumed all declared inputs but more parameters were supplied than the function can accept (index > len(params)). The transform was given too many inputs for its signature.

Source

Thrown at sdks/go/pkg/beam/core/graph/bind.go:167

		}
		if len(params)-index < arity {
			return nil, nil, addContext(errors.New("too few params"), params[index:], input)
		}

		paramsToBind := params[index : index+arity]
		elm, kind, err := tryBindInbound(input, paramsToBind, index == 0)
		if err != nil {
			return nil, nil, addContext(err, paramsToBind, input)
		}
		inbound = append(inbound, elm)
		kinds = append(kinds, kind)
		index += arity
	}
	if index < len(params) {
		return nil, nil, addContext(errors.New("too few inputs: forgot an input or to annotate options?"), params, in)
	}
	if index > len(params) {
		return nil, nil, addContext(errors.New("too many inputs"), params, in)
	}
	return inbound, kinds, nil
}

func tryBindInbound(t typex.FullType, args []funcx.FnParam, isMain bool) (typex.FullType, InputKind, error) {
	kind := Main
	var other typex.FullType

	switch t.Class() {
	case typex.Concrete, typex.Container:
		if isMain {
			other = typex.New(args[0].T)
		} else {
			// We accept various forms for side input. We have to disambiguate
			// []string into a Singleton of type []string or a Slice of type
			// string by matching up the incoming type and the param type.

			arg := args[0]

View on GitHub (pinned to 12126d8942)

Solutions

  1. Remove the extra input argument from the transform call.
  2. Extend the function signature with a parameter for the additional input if it is intentional.
  3. Check whether an argument was accidentally duplicated (e.g. passing the same PCollection twice).
  4. Confirm whether a CombineFn vs DoFn was intended — their arities differ.

Example fix

// before
beam.ParDo(s, &fn{}, a, b) // fn takes one input
// after
beam.ParDo(s, &fn{}, a)
Defensive patterns

Strategy: validation

Validate before calling

if len(inputs) > fnArity {
    return fmt.Errorf("%s accepts %d inputs, got %d", fnName, fnArity, len(inputs))
}

Prevention

When it happens

Trigger: Passing extra PCollections/side inputs to beam.ParDo, beam.Impulse-feeding combine functions, or calling a DoFn with more main inputs than ProcessElement declares and no remaining unbound slot.

Common situations: Copy-pasted transform calls where an extra collection argument was left in; combining functions given both a key and value collection while the signature only expects one.

Understand the failure class

Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.

Related errors


AI-assisted analysis of apache/beam@12126d8942 (2026-09-13). Data as JSON: /api/errors/c0dea707af075f53. Report an issue: GitHub.