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

  1. Align Beam SDK and job server versions so payload schemas match
  2. Restart the staging session to regenerate artifact descriptors
  3. Inspect the artifact metadata returned by the server for anomalies
  4. 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

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.

Related errors


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)