{"record":{"id":"5ab26b78380176a7","repo":"github/github-mcp-server","slug":"s-must-be-a-positive-integer-w","errorCode":null,"errorMessage":"%s must be a positive integer: %w","messagePattern":"(.+?) must be a positive integer: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/github/projects_batch.go","lineNumber":476,"sourceCode":"\tv, ok := entry[key]\n\tif !ok {\n\t\treturn \"\", fmt.Errorf(\"missing %s\", key)\n\t}\n\ts, ok := v.(string)\n\tif !ok || s == \"\" {\n\t\treturn \"\", fmt.Errorf(\"%s must be a non-empty string\", key)\n\t}\n\treturn s, nil\n}\n\nfunc intFromEntry(entry map[string]any, key string) (int, error) {\n\tv, ok := entry[key]\n\tif !ok {\n\t\treturn 0, fmt.Errorf(\"missing %s\", key)\n\t}\n\tn, err := validatePositiveInt64(v)\n\tif err != nil {\n\t\treturn 0, fmt.Errorf(\"%s must be a positive integer: %w\", key, err)\n\t}\n\tif n > math.MaxInt32 {\n\t\treturn 0, fmt.Errorf(\"%s exceeds the GraphQL Int maximum of %d\", key, int64(math.MaxInt32))\n\t}\n\treturn int(n), nil\n}\n\nfunc validatePositiveInt64(value any) (int64, error) {\n\tn, err := validateAndConvertToInt64(value)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\tif n <= 0 {\n\t\treturn 0, fmt.Errorf(\"value must be greater than zero (got %d)\", n)\n\t}\n\treturn n, nil\n}\n","sourceCodeStart":458,"sourceCodeEnd":494,"githubUrl":"https://github.com/github/github-mcp-server/blob/0ea1f775a7c73eff1bd2e25904d01136756bbfe2/pkg/github/projects_batch.go#L458-L494","documentation":"Raised by intFromEntry (pkg/github/projects_batch.go:476) when issue_number exists but fails validatePositiveInt64: it is not a number (string \"42\", bool, null, array), it is fractional (2.5), or it is zero/negative. The first failure is wrapped as 'issue_number must be a positive integer: <cause>' inside the combined 'must all be provided together' error, and the item is rejected as 'invalid_item_ref'.","triggerScenarios":"{\"issue_number\": \"42\"} quoted; {\"issue_number\": 2.5}; {\"issue_number\": 0}; {\"issue_number\": -1}; {\"issue_number\": null}; {\"issue_number\": true}. All fail because validateAndConvertToInt64 only accepts integral float64/int64/int values greater than zero.","commonSituations":"Issue numbers quoted when exported from CSV/JSON files; a zero-value default from a struct; parsing an issue URL but capturing an empty string coerced to 0; upstream data quality issues with negative or fractional placeholders.","solutions":["Send issue_number as an unquoted positive integer (1 or greater)","Parse source strings to int before building the item — never forward raw strings","Reject 0/negative/fractional placeholders at ingestion","Confirm you did not accidentally put an item database ID or project number in issue_number"],"exampleFix":"// before\n{\"item_owner\": \"octo\", \"item_repo\": \"repo\", \"issue_number\": \"42\"}\n// after\n{\"item_owner\": \"octo\", \"item_repo\": \"repo\", \"issue_number\": 42}","handlingStrategy":"validation","validationCode":"if v, ok := entry[\"issue_number\"]; ok {\n\tf, isNum := v.(float64)\n\tif !isNum || f != float64(int64(f)) || int64(f) <= 0 {\n\t\treturn fmt.Errorf(\"issue_number must be a positive integer (got %v)\", v)\n\t}\n}","typeGuard":"func isPositiveJSONInt(v any) bool { f, ok := v.(float64); return ok && f == float64(int64(f)) && int64(f) > 0 }","tryCatchPattern":null,"preventionTips":["Parse issue numbers to integers when reading from any string source","Reject 0, negative, and fractional placeholders before batch construction","Double-check that the number slot actually holds an issue number, not an ID"],"tags":["github-projects","batch","input-validation","type-mismatch","issue-ref"],"backgroundTag":null,"analyzedSha":"0ea1f775a7c73eff1bd2e25904d01136756bbfe2","analyzedAt":"2026-08-15T18:10:19.804Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}