apache/beam · critical

makeWindowedValueCoder: couldn't process coder for pcollecti

Error message

makeWindowedValueCoder: couldn't process coder for pcollection %q %v: %w

What it means

makeWindowedValueCoder wraps a PCollection's coder in a windowed value coder for the FnAPI boundary in the prism runner. This error means resolving/length-prefixing the PCollection's coder via lpUnknownCoders failed, so the runner cannot build a valid coder descriptor for that PCollection and pipeline execution cannot proceed.

Source

Thrown at sdks/go/pkg/beam/runners/prism/internal/coders.go:89

	// Exclude CoderLengthPrefix from the list. Even though it is a composite coder,
	// we never need to introspect its component.
	// urns.CoderLengthPrefix:     {},
}

func isKnownCompositeCoder(c *pipepb.Coder) bool {
	_, ok := knownCompositeCoders[c.GetSpec().GetUrn()]
	return ok
}

// makeWindowedValueCoder gets the coder for the PCollection, renders it safe, and adds it to the coders map.
//
// PCollection coders are not inherently WindowValueCoder wrapped, and they are added by the runner
// for crossing the FnAPI boundary at data sources and data sinks.
func makeWindowedValueCoder(pID string, comps *pipepb.Components, coders map[string]*pipepb.Coder) (string, error) {
	col := comps.GetPcollections()[pID]
	cID, err := lpUnknownCoders(col.GetCoderId(), coders, comps.GetCoders())
	if err != nil {
		return "", fmt.Errorf("makeWindowedValueCoder: couldn't process coder for pcollection %q %v: %w", pID, prototext.Format(col), err)
	}
	wcID := comps.GetWindowingStrategies()[col.GetWindowingStrategyId()].GetWindowCoderId()

	// The runner needs to be defensive, and tell the SDK to Length Prefix
	// any coders that it doesn't understand.
	// So here, we look at the coder and its components, and produce
	// new coders that we know how to deal with.

	// Produce ID for the Windowed Value Coder
	wvcID := "cwv_" + pID
	wInC := &pipepb.Coder{
		Spec: &pipepb.FunctionSpec{
			Urn: urns.CoderWindowedValue,
		},
		ComponentCoderIds: []string{cID, wcID},
	}
	// Populate the coders to send with the new windowed value coder.
	coders[wvcID] = wInC

View on GitHub (pinned to 12126d8942)

Solutions

  1. Read the wrapped %w error to find the root-cause coder that failed and fix its definition in the pipeline
  2. Ensure all coders referenced by PCollection coder IDs exist in the pipeline's coders map
  3. Upgrade the Beam SDK/runner versions so both sides agree on coder URNs
  4. For xlang expansions, confirm expansion service produced well-formed coders
Defensive patterns

Strategy: try-catch

Validate before calling

col := comps.GetPcollections()[pID]
if col == nil { return fmt.Errorf("pcollection %q missing", pID) }
if _, err := lpUnknownCoders(col.GetCoderId(), map[string]*pipepb.Coder{}, comps.GetCoders()); err != nil {
    return fmt.Errorf("pcollection %q coder unresolvable: %w", pID, err)
}

Try / catch

if _, err := makeWindowedValueCoder(pID, comps, coders); err != nil {
    return fmt.Errorf("pipeline prep failed: %w", err)
}

Prevention

When it happens

Trigger: executePipeline/buildDescriptor processes a pipeline containing a PCollection whose coder ID cannot be resolved in comps coders, or whose coder tree contains an unknown/unresolvable coder — the wrapped error from lpUnknownCoders carries the root cause.

Common situations: Pipelines submitted with hand-crafted or cross-language (xlang) coders the prism runner cannot canonicalize; corrupted or trimmed pipeline protos; SDK-side coder construction bugs.

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