apache/beam · error
failed to parse artifact file payload
Error message
failed to parse artifact file payload
What it means
stageFiles returns this when proto.Unmarshal fails to decode the ArtifactFilePayload for a staged artifact whose type URN is graphx.URNArtifactFileType. The artifact request contained a TypePayload that is not a valid serialized ArtifactFilePayload protobuf.
Solutions
- Align Beam SDK and job server versions so payload schemas match
- Restart the staging session to regenerate artifact descriptors
- Inspect the artifact metadata returned by the server for anomalies
- Report/upgrade if the job server is emitting non-standard payloads
Example fix
// before
if err := proto.Unmarshal(request.GetArtifact().GetTypePayload(), &typePl); err != nil {
return errors.Wrap(err, "failed to parse artifact file payload")
}
// after: upgrade SDK and job server to matching Beam versions, then retry staging Defensive patterns
Strategy: try-catch
Try / catch
if err := submit(...); err != nil && strings.Contains(err.Error(), "failed to parse artifact file payload") {
// protobuf/schema skew: upgrade SDK and job server to matching versions
} Prevention
- Keep SDK and JobApi protobuf versions aligned
- Regenerate/refresh artifact descriptors per staging session
- Avoid mixing Beam releases between client and job server
When it happens
Trigger: The artifact request from the server has ArtifactTypePayload bytes that fail proto unmarshaling into pipepb.ArtifactFilePayload — corrupted payload or protocol incompatibility.
Common situations: SDK/JobService protobuf version mismatch producing incompatible payload encodings, or a corrupted artifact descriptor in the staging session.
Understand the failure class
Background: "cannot parse invalid wire-format data", "cannot unmarshal", "failed unmarshalling": protobuf unmarshal errors explained — this error's family across 10 libraries.
- Parsing and encoding errors: unexpected token, malformed input — why parsers reject input and how to find the real culprit.
Related errors
- request has unexpected type %T
- BytesValue unmarshal failed
- Cannot interpret a request received over control channel…
- Encountered unknown AtomicType…
- Error parsing deferred artifact payload.
AI-assisted analysis of apache/beam@12126d8942 (2026-09-13).
Data as JSON: /api/errors/047ecf790a3eaa32.
Report an issue: GitHub.
Appendix: source
Thrown at sdks/go/pkg/beam/runners/universal/runnerlib/stage.go:124
if err != nil {
return err
}
case *jobpb.ArtifactRequestWrapper_GetArtifact:
switch typeUrn := request.GetArtifact.Artifact.TypeUrn; typeUrn {
// TODO(https://github.com/apache/beam/issues/21459): Legacy Type URN. If requested, provide the binary.
// To be removed later in 2022, once thoroughly obsolete.
case graphx.URNArtifactGoWorker:
if err := stageFile(binary, stream); err != nil {
if err == io.EOF {
continue // so we can get the real error from stream.Recv.
}
return errors.Wrapf(err, "failed to stage Go worker binary: %v", binary)
}
case graphx.URNArtifactFileType:
typePl := pipepb.ArtifactFilePayload{}
if err := proto.Unmarshal(request.GetArtifact.Artifact.TypePayload, &typePl); err != nil {
return errors.Wrap(err, "failed to parse artifact file payload")
}
if err := stageFile(typePl.GetPath(), stream); err != nil {
if err == io.EOF {
continue // so we can get the real error from stream.Recv.
}
return errors.Wrapf(err, "failed to stage file %v", typePl.GetPath())
}
default:
return errors.Errorf("request has unexpected artifact type %s", typeUrn)
}
default:
return errors.Errorf("request has unexpected type %T", request)
}
}
}
View on GitHub (pinned to 12126d8942)