apache/beam · error

failed to create artifact type payload

Error message

failed to create artifact type payload

What it means

After building the normalized ArtifactFilePayload, newMaterializeWithClient re-marshals it for the outgoing ArtifactInformation. proto.Marshal failure (practically only on internal/proto library errors) triggers this wrapped error.

Solutions

  1. Check the wrapped err for the proto library's specific failure reason
  2. Ensure a single consistent proto library version is linked into the build
  3. Rebuild Beam vendored deps (go mod tidy / go mod vendor) to resolve proto runtime conflicts
Defensive patterns

Strategy: try-catch

Try / catch

if err := proto.Marshal(&filePayload); err != nil {
    // check proto library versions; rebuild vendored deps
    return err
}

Prevention

When it happens

Trigger: proto.Marshal(&filePayload) fails — rare with proto3 scalar fields; typically indicates a corrupted proto runtime/state or required-field violation with proto2-style setups.

Common situations: Extremely rare in practice; seen with mixed proto library versions (e.g. gogo/golang proto conflicts) in custom builds of Beam.

Understand the failure class

Background: json.Marshal / "failed to marshal" errors in Go: why "unsupported type" happens and how to fix it — this error's family across 22 libraries.

Related errors


AI-assisted analysis of apache/beam@12126d8942 (2026-09-13). Data as JSON: /api/errors/171e47d65c55ea97. Report an issue: GitHub.

Appendix: source

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

		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,
		})

		rolePayload, err := proto.Marshal(&pipepb.ArtifactStagingToRolePayload{
			StagedName: path,
		})
		if err != nil {
			return nil, errors.Wrap(err, "failed to create artifact role payload")
		}
		list = append(list, &artifact{
			client: client,
			dep: &pipepb.ArtifactInformation{
				TypeUrn:     dep.TypeUrn,

View on GitHub (pinned to 12126d8942)