{"record":{"id":"171e47d65c55ea97","repo":"apache/beam","slug":"failed-to-create-artifact-type-payload","errorCode":null,"errorMessage":"failed to create artifact type payload","messagePattern":"failed to create artifact type payload","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sdks/go/pkg/beam/artifact/materialize.go","lineNumber":128,"sourceCode":"\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,\n\t\t})\n\n\t\trolePayload, err := proto.Marshal(&pipepb.ArtifactStagingToRolePayload{\n\t\t\tStagedName: path,\n\t\t})\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrap(err, \"failed to create artifact role payload\")\n\t\t}\n\t\tlist = append(list, &artifact{\n\t\t\tclient: client,\n\t\t\tdep: &pipepb.ArtifactInformation{\n\t\t\t\tTypeUrn:     dep.TypeUrn,","sourceCodeStart":110,"sourceCodeEnd":146,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/go/pkg/beam/artifact/materialize.go#L110-L146","documentation":"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.","triggerScenarios":"proto.Marshal(&filePayload) fails — rare with proto3 scalar fields; typically indicates a corrupted proto runtime/state or required-field violation with proto2-style setups.","commonSituations":"Extremely rare in practice; seen with mixed proto library versions (e.g. gogo/golang proto conflicts) in custom builds of Beam.","solutions":["Check the wrapped err for the proto library's specific failure reason","Ensure a single consistent proto library version is linked into the build","Rebuild Beam vendored deps (go mod tidy / go mod vendor) to resolve proto runtime conflicts"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err := proto.Marshal(&filePayload); err != nil {\n    // check proto library versions; rebuild vendored deps\n    return err\n}","preventionTips":["Pin a single protobuf-go version across the module","Run go mod tidy/vendor to avoid duplicate proto runtimes","Marshal a sample ArtifactFilePayload in unit tests to catch proto setup issues early"],"tags":["protobuf","marshal","artifact","pipeline"],"backgroundTag":"json-marshal-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"}