{"record":{"id":"3565b2a9c9aa64ce","repo":"apache/beam","slug":"failed-to-parse-artifact-file-payload","errorCode":null,"errorMessage":"failed to parse artifact file payload","messagePattern":"failed to parse artifact file payload","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/artifact/materialize.go","lineNumber":116,"sourceCode":"\tresolution, err := client.ResolveArtifacts(ctx, &jobpb.ResolveArtifactsRequest{Artifacts: dependencies})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar artifacts []*pipepb.ArtifactInformation\n\tvar list []retrievable\n\tfor _, dep := range resolution.Replacements {\n\t\tpath, err := extractStagingToPath(dep)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tfilePayload := pipepb.ArtifactFilePayload{\n\t\t\tPath: path,\n\t\t}\n\t\tif dep.TypeUrn == URNFileArtifact {\n\t\t\ttypePayload := pipepb.ArtifactFilePayload{}\n\t\t\tif err := proto.Unmarshal(dep.TypePayload, &typePayload); err != nil {\n\t\t\t\treturn nil, errors.Wrap(err, \"failed to parse artifact file payload\")\n\t\t\t}\n\t\t\tfilePayload.Sha256 = typePayload.Sha256\n\t\t} else if dep.TypeUrn == URNUrlArtifact {\n\t\t\ttypePayload := pipepb.ArtifactUrlPayload{}\n\t\t\tif err := proto.Unmarshal(dep.TypePayload, &typePayload); err != nil {\n\t\t\t\treturn nil, errors.Wrap(err, \"failed to parse artifact url payload\")\n\t\t\t}\n\t\t\tfilePayload.Sha256 = typePayload.Sha256\n\t\t}\n\t\tnewTypePayload, err := proto.Marshal(&filePayload)\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrap(err, \"failed to create artifact type payload\")\n\t\t}\n\t\tartifacts = append(artifacts, &pipepb.ArtifactInformation{\n\t\t\tTypeUrn:     URNFileArtifact,\n\t\t\tTypePayload: newTypePayload,\n\t\t\tRoleUrn:     dep.RoleUrn,\n\t\t\tRolePayload: dep.RolePayload,","sourceCodeStart":98,"sourceCodeEnd":134,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/artifact/materialize.go#L98-L134","documentation":"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.","triggerScenarios":"dep.TypeUrn == URNFileArtifact but dep.TypePayload was produced by a different/older schema, is empty, or is corrupt — proto.Unmarshal fails.","commonSituations":"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.","solutions":["Regenerate the pipeline with matching Beam SDK versions so TypePayload is a valid ArtifactFilePayload proto","Inspect dep.TypePayload bytes and decode it against the right proto message type","Upgrade/align the artifact materialization code and protos on both producer and consumer sides"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"var p pipepb.ArtifactFilePayload\nif err := proto.Unmarshal(dep.TypePayload, &p); err != nil {\n    return fmt.Errorf(\"dependency %s has invalid file payload\", dep.TypeUrn)\n}","typeGuard":null,"tryCatchPattern":"if _, err := newMaterialize(ctx, deps...); err != nil && strings.Contains(err.Error(), \"failed to parse artifact file payload\") {\n    // align SDK versions and regenerate pipeline protos\n}","preventionTips":["Use matching Beam SDK versions across pipeline producer and Go runner","Never hand-craft TypePayload bytes","Validate artifact protos round-trip in CI for cross-language pipelines"],"tags":["protobuf","artifact","pipeline"],"backgroundTag":"protobuf-unmarshal-failed","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-20T03:17:13.778Z"}