apache/beam · error

windowing strategy %v not found

Error message

windowing strategy %v not found

What it means

When a PCollection's coder is not itself windowed, the builder resolves the windowing strategy from desc.GetWindowingStrategies() using the pcollection's WindowingStrategyId. A missing id means the windowing info cannot be reconstructed, so this error is returned.

Source

Thrown at sdks/go/pkg/beam/core/runtime/exec/translate.go:366

	col, ok := b.desc.GetPcollections()[id]
	if !ok {
		return nil, nil, errors.Errorf("pcollection %v not found", id)
	}
	c, err := b.coders.Coder(col.CoderId)
	if err != nil {
		return nil, nil, err
	}
	if coder.IsW(c) {
		// TODO(herohde) 3/16/2018: remove potential WindowedValue from Dataflow.
		// However, windowing strategies are not yet passed through, so the main
		// path always gives us GlobalWindows.

		return coder.SkipW(c), c.Window, nil
	}

	ws, ok := b.desc.GetWindowingStrategies()[col.GetWindowingStrategyId()]
	if !ok {
		return nil, nil, errors.Errorf("windowing strategy %v not found", id)
	}
	wc, err := b.coders.WindowCoder(ws.GetWindowCoderId())
	if err != nil {
		return nil, nil, errors.Errorf("could not unmarshal window coder for pcollection %v: %w", id, err)
	}
	return c, wc, nil
}

func (b *builder) makePCollection(id string) (*PCollection, error) {
	if n, exists := b.nodes[id]; exists {
		return n, nil
	}

	list := b.succ[id]

	var u Node
	switch len(list) {
	case 0:

View on GitHub (pinned to 12126d8942)

Solutions

  1. Ensure the pipeline proto populates WindowingStrategies for every referenced WindowingStrategyId
  2. Regenerate the pipeline description via the standard graphx encoding path
  3. Align runner and Beam Go SDK versions
Defensive patterns

Strategy: validation

Validate before calling

// Ensure each pcollection's windowing strategy resolves
for id, col := range desc.GetPcollections() {
    if _, ok := desc.GetWindowingStrategies()[col.GetWindowingStrategyId()]; !ok {
        return fmt.Errorf("pcollection %s: missing windowing strategy %s", id, col.GetWindowingStrategyId())
    }
}

Try / catch

if err := exec.UnmarshalPlan(desc); err != nil {
    if strings.Contains(err.Error(), "windowing strategy") && strings.Contains(err.Error(), "not found") {
        // re-emit pipeline with complete windowing strategies
    }
}

Prevention

When it happens

Trigger: Pipeline description contains a PCollection whose WindowingStrategyId points to a non-existent windowing strategy entry, encountered in makeCoderForPCollection during plan unmarshal.

Common situations: Runner stripping or failing to serialize windowing strategies; hand-built protos in tests omitting the strategies map; SDK/runner protocol version skew.

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


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