github/github-mcp-server · error
item_owner, item_repo, and issue_number must all be provided
Error message
item_owner, item_repo, and issue_number must all be provided together: %w
What it means
Raised by parseItemRef (pkg/github/projects_batch.go:433) when an item uses the issue-reference form but one of item_owner, item_repo, or issue_number is missing or invalid. The three fields are evaluated together and the first failing one is wrapped into this message. The item is marked 'invalid_item_ref'.
Source
Thrown at pkg/github/projects_batch.go:433
if !ok || s == "" {
return fmt.Errorf("node_id must be a non-empty string")
}
p.refKind = batchRefNodeID
p.nodeID = s
case hasItemID:
id, err := validatePositiveInt64(entry["item_id"])
if err != nil {
return fmt.Errorf("item_id: %w", err)
}
p.refKind = batchRefItemID
p.itemID = id
default:
issueOwner, ownerErr := stringFromEntry(entry, "item_owner")
issueRepo, repoErr := stringFromEntry(entry, "item_repo")
issueNumber, numErr := intFromEntry(entry, "issue_number")
for _, err := range []error{ownerErr, repoErr, numErr} {
if err != nil {
return fmt.Errorf("item_owner, item_repo, and issue_number must all be provided together: %w", err)
}
}
p.refKind = batchRefIssue
p.issueOwner = issueOwner
p.issueRepo = issueRepo
p.issueNumber = issueNumber
}
return nil
}
func itemRefEcho(entry map[string]any) map[string]any {
ref := map[string]any{}
for _, key := range []string{"node_id", "item_id", "item_owner", "item_repo", "issue_number"} {
if v, ok := entry[key]; ok {
ref[key] = v
}
}
if len(ref) == 0 {View on GitHub (pinned to 0ea1f775a7)
Solutions
- Supply all three keys on every issue-ref item: item_owner, item_repo, issue_number
- Verify the exact key names (issue_number, not number/issue/num)
- Check each value's type: owner/repo are non-empty strings, issue_number is a positive integer within int32 range
- Validate the triple together before appending the item to the batch
Example fix
// before
{"items": [{"item_owner": "octo", "item_repo": "repo"}]}
// after
{"items": [{"item_owner": "octo", "item_repo": "repo", "issue_number": 42}]} Defensive patterns
Strategy: validation
Validate before calling
func validIssueRef(entry map[string]any) bool {
_, o := entry["item_owner"]
_, r := entry["item_repo"]
_, n := entry["issue_number"]
if !o && !r && !n { return true } // not the issue form at all
owner, o1 := entry["item_owner"].(string)
repo, r1 := entry["item_repo"].(string)
num, n1 := entry["issue_number"].(float64)
return o1 && r1 && n1 && owner != "" && repo != "" && num == float64(int64(num)) && int64(num) > 0 && int64(num) <= 2147483647
} Type guard
func isCompleteIssueRef(entry map[string]any) bool { return validIssueRef(entry) } Prevention
- Treat owner/repo/number as one atomic triple in your data model
- Do not partially populate the triple from different sources without a merge step
- Reject rows missing any of the three before building the batch
When it happens
Trigger: Any item where at least one of item_owner/item_repo/issue_number is present (making hasIssueRef true) but not all three are valid — e.g. missing issue_number, item_owner present but item_repo absent, or issue_number as a string. Also triggers when the item has no node_id/item_id so the default branch handles it.
Common situations: Building refs from a bug-tracker export where the repo or number column is sometimes blank; using a bare "number" key instead of "issue_number"; owner/repo populated by default config with the number supplied per-item and sometimes omitted.
Related errors
- missing %s
- %s must be a non-empty string
- %s must be a positive integer: %w
- %s exceeds the GraphQL Int maximum of %d
- each item requires exactly one of node_id, item_id, or item_
AI-assisted analysis of github/github-mcp-server@0ea1f775a7 (2026-08-15).
Data as JSON: /api/errors/4f1f7a4b80796358.
Report an issue: GitHub.