apache/beam · error
failed to create keyed iterable, got
Error message
failed to create keyed iterable, got %v
What it means
After validating the key argument, multiMapValue.invoke calls SideInputAdapter.NewKeyedIterable to materialize the iterable for that key from the side input state reader. If that adapter call returns an error, the library panics because there is no way to propagate an error through the reflect-made function. The wrapped message includes the underlying cause.
Solutions
- Read the wrapped cause in the panic message — fix the underlying NewKeyedIterable error first.
- Verify the side input PCollection was actually produced (check upstream stage logs for failures).
- Confirm the key passed to the multimap matches the side input's key type.
- Check windowing: ensure the query window matches how the side input was materialized.
- Enable runner/SDK side-input logging to see state read failures.
Defensive patterns
Strategy: try-catch
Try / catch
defer func() {
if r := recover(); r != nil {
if s, ok := r.(string); ok && strings.HasPrefix(s, "failed to create keyed iterable") {
log.Fatalf("multimap side input read failed: %s", s)
}
panic(r)
}
}() Prevention
- Ensure the side input producing stage completes successfully before dependent stages run.
- Verify side input key types match between producer and consumer.
- Check windowing strategy compatibility between main input and side input.
- Monitor runner logs for side input materialization failures.
When it happens
Trigger: Reading a keyed iterable for a multimap side input fails — the StateReader cannot fetch the side input data (missing/failed side input materialization, runner-side state read error, wrong window), or the adapter rejects the key's type.
Common situations: Side input not materialized because the producing stage failed or was skipped; key type not comparable/encodable for the state cache; runner removed or truncated side input data; window mismatch so the requested window has no data.
Understand the failure class
Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.
Related errors
- broken stream
- broken stream
- combine does not support side inputs
- expected WV coder for side input
- found inbound, want
AI-assisted analysis of apache/beam@12126d8942 (2026-09-13).
Data as JSON: /api/errors/f5d6166fa5016ed2.
Report an issue: GitHub.
Appendix: source
Thrown at sdks/go/pkg/beam/core/runtime/exec/input.go:239
func (v *multiMapValue) Init() error {
return nil
}
func (v *multiMapValue) Value() any {
return v.fn
}
func (v *multiMapValue) Reset() error {
return nil
}
func (v *multiMapValue) invoke(args []reflect.Value) []reflect.Value {
if len(args) != 1 {
panic(fmt.Sprintf("wanted one key value, got %v", args))
}
rs, err := v.adapter.NewKeyedIterable(v.ctx, v.reader, v.w, args[0].Interface())
if err != nil {
panic(fmt.Sprintf("failed to create keyed iterable, got %v", err))
}
iter := makeIter(v.t.Out(0), rs)
iter.Init()
return []reflect.Value{reflect.ValueOf(iter.Value())}
}
View on GitHub (pinned to 12126d8942)