apache/beam · error

failed to parse artifact file payload

Error message

failed to parse artifact file payload

What it means

newMaterializeWithClient converts each dependency; for URNFileArtifact dependencies it unmarshals dep.TypePayload into ArtifactFilePayload. If the payload bytes are not a valid proto ArtifactFilePayload, it fails with this wrapped error.

Solutions

  1. Regenerate the pipeline with matching Beam SDK versions so TypePayload is a valid ArtifactFilePayload proto
  2. Inspect dep.TypePayload bytes and decode it against the right proto message type
  3. Upgrade/align the artifact materialization code and protos on both producer and consumer sides
Defensive patterns

Strategy: validation

Validate before calling

var p pipepb.ArtifactFilePayload
if err := proto.Unmarshal(dep.TypePayload, &p); err != nil {
    return fmt.Errorf("dependency %s has invalid file payload", dep.TypeUrn)
}

Try / catch

if _, err := newMaterialize(ctx, deps...); err != nil && strings.Contains(err.Error(), "failed to parse artifact file payload") {
    // align SDK versions and regenerate pipeline protos
}

Prevention

When it happens

Trigger: dep.TypeUrn == URNFileArtifact but dep.TypePayload was produced by a different/older schema, is empty, or is corrupt — proto.Unmarshal fails.

Common situations: Pipelines built by a Beam SDK whose TypePayload doesn't match the Go proto (version skew); payload generated by hand; cross-language pipelines where the other SDK serialized a different type payload.

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/3565b2a9c9aa64ce. Report an issue: GitHub.

Appendix: source

Thrown at sdks/go/pkg/beam/artifact/materialize.go:116

	resolution, err := client.ResolveArtifacts(ctx, &jobpb.ResolveArtifactsRequest{Artifacts: dependencies})
	if err != nil {
		return nil, err
	}

	var artifacts []*pipepb.ArtifactInformation
	var list []retrievable
	for _, dep := range resolution.Replacements {
		path, err := extractStagingToPath(dep)
		if err != nil {
			return nil, err
		}
		filePayload := pipepb.ArtifactFilePayload{
			Path: path,
		}
		if dep.TypeUrn == URNFileArtifact {
			typePayload := pipepb.ArtifactFilePayload{}
			if err := proto.Unmarshal(dep.TypePayload, &typePayload); err != nil {
				return nil, errors.Wrap(err, "failed to parse artifact file payload")
			}
			filePayload.Sha256 = typePayload.Sha256
		} else if dep.TypeUrn == URNUrlArtifact {
			typePayload := pipepb.ArtifactUrlPayload{}
			if err := proto.Unmarshal(dep.TypePayload, &typePayload); err != nil {
				return nil, errors.Wrap(err, "failed to parse artifact url payload")
			}
			filePayload.Sha256 = typePayload.Sha256
		}
		newTypePayload, err := proto.Marshal(&filePayload)
		if err != nil {
			return nil, errors.Wrap(err, "failed to create artifact type payload")
		}
		artifacts = append(artifacts, &pipepb.ArtifactInformation{
			TypeUrn:     URNFileArtifact,
			TypePayload: newTypePayload,
			RoleUrn:     dep.RoleUrn,
			RolePayload: dep.RolePayload,

View on GitHub (pinned to 12126d8942)