apache/beam · error

unexpected inbound class

Error message

unexpected inbound class: %v

What it means

tryBindInbound validates the inbound FullType's class against a fixed switch; any class other than the supported ones (e.g. Single, Composite) falls to the default and throws. Beam's typex defines a closed set of FullType classes, and this binder only understands the subset valid for inputs. It fails fast at pipeline construction rather than at runtime.

Solutions

  1. Construct PCollections and inputs via the public beam package helpers instead of manual typex/graph types.
  2. Check t.Class() from the error message and use a FullType whose class is Single or Composite.
  3. Review custom graph-building code that creates typex.FullType values and fix the class used.
  4. Pin/upgrade the SDK so the binder supports all typex classes present in your version.

Example fix

// before: manual graph input with wrong typex class
in := graph.NewInput(t /* invalid class */)
// after: derive input from a PCollection
in := beam.ParDo(s, myFn, pcoll)
Defensive patterns

Strategy: type-guard

Type guard

// Go: only bind FullTypes of supported class
func isBindableClass(t typex.FullType) bool {
    c := t.Class()
    return c == typex.Single || c == typex.Composite
}

Prevention

When it happens

Trigger: Calling ParDo/side-input binding with an inbound type whose t.Class() is outside the supported set — typically a malformed or intentionally invalid FullType passed to graph construction.

Common situations: Hand-constructing typex types for custom graph manipulation; using internal APIs directly instead of the beam package helpers; corrupted pipeline graph after custom transforms.

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/c6d57affa50928d5. Report an issue: GitHub.

Appendix: source

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

				case funcx.FnReIter:
					values, _ := funcx.UnfoldReIter(args[i].T)
					trimmed := trimIllegal(values)
					if len(trimmed) != 1 {
						return nil, kind, errors.Errorf("values of %v cannot bind to %v", t, args[i])
					}
					components = append(components, typex.New(trimmed[0]))
				default:
					return nil, kind, errors.Errorf("values of %v cannot bind to %v", t, args[i])
				}
			}
			other = typex.NewCoGBK(components...)

		default:
			return nil, kind, errors.Errorf("unexpected inbound type: %v", t.Type())
		}

	default:
		return nil, kind, errors.Errorf("unexpected inbound class: %v", t.Class())
	}

	if !typex.IsStructurallyAssignable(t, other) {
		return nil, kind, errors.Errorf("%v is not assignable to %v", t, other)
	}
	return other, kind, nil
}

func inboundArity(t typex.FullType, isMain bool) (int, error) {
	if t.Class() == typex.Composite {
		switch t.Type() {
		case typex.KVType:
			if isMain {
				return 2, nil
			}
			// A KV side input must be a single iterator/map.
			return 1, nil
		case typex.CoGBKType:

View on GitHub (pinned to 12126d8942)