{"record":{"id":"749793e41f378bcb","repo":"gastownhall/beads","slug":"invalid-github-issue-number-q-w","errorCode":null,"errorMessage":"invalid GitHub issue number %q: %w","messagePattern":"invalid GitHub issue number %q: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/github/tracker.go","lineNumber":121,"sourceCode":"\t\tissues, err = t.client.FetchIssuesSince(ctx, state, *opts.Since)\n\t} else {\n\t\tissues, err = t.client.FetchIssues(ctx, state)\n\t}\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresult := make([]tracker.TrackerIssue, 0, len(issues))\n\tfor _, gh := range issues {\n\t\tresult = append(result, githubToTrackerIssue(&gh))\n\t}\n\treturn result, nil\n}\n\nfunc (t *Tracker) FetchIssue(ctx context.Context, identifier string) (*tracker.TrackerIssue, error) {\n\tnumber, err := strconv.Atoi(identifier)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"invalid GitHub issue number %q: %w\", identifier, err)\n\t}\n\n\tgh, err := t.client.FetchIssueByNumber(ctx, number)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif gh == nil {\n\t\treturn nil, nil\n\t}\n\n\tti := githubToTrackerIssue(gh)\n\treturn &ti, nil\n}\n\nfunc (t *Tracker) CreateIssue(ctx context.Context, issue *types.Issue) (*tracker.TrackerIssue, error) {\n\tfields := BeadsIssueToGitHubFields(issue, t.config)\n\tlabels, _ := fields[\"labels\"].([]string)\n","sourceCodeStart":103,"sourceCodeEnd":139,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/internal/github/tracker.go#L103-L139","documentation":"Tracker.FetchIssue expects a GitHub issue number as a plain numeric string (\"123\") and converts it with strconv.Atoi. When the identifier is not a valid integer, the Atoi error is wrapped with the original identifier so the caller can see what was rejected.","triggerScenarios":"Calling FetchIssue with identifiers like \"#123\", \"ISSUE-123\", a URL, an empty string, or a slug — anything Atoi cannot parse as an integer.","commonSituations":"Passing a full GitHub issue URL or \"#123\" copied from the UI, passing a beads issue key instead of a GitHub number, or feeding output of another tool directly into FetchIssue.","solutions":["Strip non-numeric prefixes: pass \"123\" instead of \"#123\" or a URL.","Extract the number from a URL if needed (everything after the last '/').","Resolve the correct GitHub issue number first (e.g. via a search/list call) if you only have a title or slug.","Validate the identifier with strconv.Atoi in your own code before calling FetchIssue for a friendlier error."],"exampleFix":"// before\nissue, err := t.FetchIssue(ctx, \"#42\")\n// after\nissue, err := t.FetchIssue(ctx, \"42\")","handlingStrategy":"validation","validationCode":"func normalizeIssueNumber(id string) (int, error) {\n    id = strings.TrimPrefix(strings.TrimSpace(id), \"#\")\n    if u, err := url.Parse(id); err == nil && u.Path != \"\" { id = path.Base(u.Path) }\n    return strconv.Atoi(id)\n}","typeGuard":null,"tryCatchPattern":"n, aerr := strconv.Atoi(identifier)\nif aerr != nil { return fmt.Errorf(\"%q is not a GitHub issue number\", identifier) } // pre-check before FetchIssue","preventionTips":["Pass bare numeric strings (\"123\"), never \"#123\", URLs, or slugs.","Normalize identifiers at the boundary of your integration layer.","Resolve titles/slugs to numbers via search before fetching."],"tags":["github","parsing","issue-number"],"backgroundTag":"invalid-issue-identifier","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}