{"record":{"id":"2ed44a66323eef0b","repo":"github/github-mcp-server","slug":"failed-to-marshal-labels-w-2ed44a","errorCode":null,"errorMessage":"failed to marshal labels: %w","messagePattern":"failed to marshal labels: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"pkg/github/ui_tools.go","lineNumber":175,"sourceCode":"\t\tif !query.Repository.Labels.PageInfo.HasNextPage {\n\t\t\tbreak\n\t\t}\n\t\tif page >= uiGetMaxPages {\n\t\t\thasMore = true\n\t\t\tbreak\n\t\t}\n\t\tvars[\"cursor\"] = githubv4.NewString(query.Repository.Labels.PageInfo.EndCursor)\n\t}\n\n\tresponse := map[string]any{\n\t\t\"labels\":     labels,\n\t\t\"totalCount\": totalCount,\n\t\t\"has_more\":   hasMore,\n\t}\n\n\tout, err := json.Marshal(response)\n\tif err != nil {\n\t\treturn nil, nil, fmt.Errorf(\"failed to marshal labels: %w\", err)\n\t}\n\n\treturn utils.NewToolResultText(string(out)), nil, nil\n}\n\nfunc uiGetAssignees(ctx context.Context, deps ToolDependencies, args map[string]any, owner string) (*mcp.CallToolResult, any, error) {\n\trepo, err := RequiredParam[string](args, \"repo\")\n\tif err != nil {\n\t\treturn utils.NewToolResultError(err.Error()), nil, nil\n\t}\n\n\tclient, err := deps.GetClient(ctx)\n\tif err != nil {\n\t\treturn utils.NewToolResultErrorFromErr(\"failed to get GitHub client\", err), nil, nil\n\t}\n\n\topts := &github.ListOptions{PerPage: 100}\n\tvar allAssignees []*github.User","sourceCodeStart":157,"sourceCodeEnd":193,"githubUrl":"https://github.com/github/github-mcp-server/blob/0ea1f775a7c73eff1bd2e25904d01136756bbfe2/pkg/github/ui_tools.go#L157-L193","documentation":"json.Marshal of the labels response map ([]labels, totalCount, has_more) failed. The map holds only GraphQL-derived strings and ints, so a marshal error indicates unsupported values (NaN floats sneaking in) or upstream githubv4 type changes - effectively unreachable in a healthy build.","triggerScenarios":"githubv4 dependency drift changing node field types; injecting non-marshalable values into the map in a fork.","commonSituations":"Version skew after upgrading githubv4; local modifications to uiGetLabels.","solutions":["Log the underlying marshal error to find the offending field","Pin the githubv4 version matching this server build","Add a unit test marshaling a sample labels response map"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"out, err := json.Marshal(response)\nif err != nil {\n\tslog.Error(\"marshal labels failed\", \"error\", err)\n\tout = []byte(`{\"labels\":[],\"totalCount\":0,\"has_more\":false}`)\n}","preventionTips":["Pin githubv4 dependency versions","Keep the response map to plain JSON-safe types","Unit-test serialization of every UI tool response shape"],"tags":["json","serialization","graphql"],"backgroundTag":null,"analyzedSha":"0ea1f775a7c73eff1bd2e25904d01136756bbfe2","analyzedAt":"2026-08-15T18:10:19.804Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}