apache/beam · error
coder with id not found
Error message
coder with id %v not found
What it means
CoderUnmarshaller.Coder looks up a coder by ID first in the already-unmarshaled coders map, then in the raw model map from the pipeline proto. If the ID is in neither, it throws "coder with id %v not found" wrapped with context 'unmarshalling coder <id>'. It means the pipeline graph references a coder that was never (or no longer) included in the coder definitions.
Solutions
- Check the coder ID in the error exists in the pipeline proto's components.coders map; re-marshal the pipeline if it was hand-built.
- Regenerate the pipeline with the same Beam SDK version as the runner to avoid dropped/mismatched coders.
- If constructing the pipeline programmatically, ensure every PCollection's coder is registered before unmarshaling.
- Upgrade or align beam Go SDK versions between job submission and runner/stager.
Defensive patterns
Strategy: validation
Validate before calling
// Before unmarshaling, verify referenced coder IDs exist:
for id, pc := range comps.GetPcollections() {
if _, ok := comps.GetCoders()[pc.GetCoderId()]; !ok {
return fmt.Errorf("pcollection %s references missing coder %s", id, pc.GetCoderId())
}
} Try / catch
c, err := um.Coder(id)
if err != nil && strings.Contains(err.Error(), "not found") {
log.Printf("missing coder %q in pipeline proto: %v", id, err)
} Prevention
- Never hand-edit or prune coder entries in serialized pipeline protos.
- Keep pipeline producer and runner SDK versions aligned.
- Validate pipeline protos with graphx round-trip tests before submitting.
When it happens
Trigger: Unmarshaling a pipeline whose components reference a coder ID absent from pipepb components' coders map — via UnmarshalCoders, makeCoderForPCollection, or makeLink during pipeline deserialization.
Common situations: A partially constructed or hand-edited pipeline proto; a runner/SDK version mismatch dropping coder definitions; a serialized pipeline (e.g. saved model) truncated or produced by an older SDK that pruned coders.
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/dd5b7ed69bfc9a96.
Report an issue: GitHub.
Appendix: source
Thrown at sdks/go/pkg/beam/core/runtime/graphx/coder.go:145
coders := make([]*coder.Coder, len(ids))
for i, id := range ids {
c, err := b.Coder(id)
if err != nil {
return nil, err
}
coders[i] = c
}
return coders, nil
}
// Coder unmarshals a coder with the given id.
func (b *CoderUnmarshaller) Coder(id string) (*coder.Coder, error) {
if c, exists := b.coders[id]; exists {
return c, nil
}
c, ok := b.models[id]
if !ok {
err := errors.Errorf("coder with id %v not found", id)
return nil, errors.WithContextf(err, "unmarshalling coder %v", id)
}
ret, err := b.makeCoder(id, c)
if err != nil {
return nil, errors.WithContextf(err, "unmarshalling coder %v", id)
}
ret.ID = id
b.coders[id] = ret
return ret, nil
}
// WindowCoder unmarshals a window coder with the given id.
func (b *CoderUnmarshaller) WindowCoder(id string) (*coder.WindowCoder, error) {
if w, exists := b.windowCoders[id]; exists {
return w, nil
}View on GitHub (pinned to 12126d8942)