{"record":{"id":"7f64bbd959a20d8e","repo":"gastownhall/beads","slug":"failed-to-fetch-issues-since-s-w-7f64bb","errorCode":null,"errorMessage":"failed to fetch issues since %s: %w","messagePattern":"failed to fetch issues since (.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/linear/client.go","lineNumber":600,"sourceCode":"\t\t\treturn nil, fmt.Errorf(\"pagination limit exceeded: stopped after %d pages\", MaxPages)\n\t\t}\n\n\t\tvariables := map[string]interface{}{\n\t\t\t\"filter\": filter,\n\t\t\t\"first\":  MaxPageSize,\n\t\t}\n\t\tif cursor != \"\" {\n\t\t\tvariables[\"after\"] = cursor\n\t\t}\n\n\t\treq := &GraphQLRequest{\n\t\t\tQuery:     issuesQuery,\n\t\t\tVariables: variables,\n\t\t}\n\n\t\tdata, err := c.Execute(ctx, req)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to fetch issues since %s: %w\", sinceStr, err)\n\t\t}\n\n\t\tvar issuesResp IssuesResponse\n\t\tif err := json.Unmarshal(data, &issuesResp); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"failed to parse issues response: %w\", err)\n\t\t}\n\n\t\tallIssues = append(allIssues, issuesResp.Issues.Nodes...)\n\n\t\tif !issuesResp.Issues.PageInfo.HasNextPage {\n\t\t\tbreak\n\t\t}\n\t\tcursor = issuesResp.Issues.PageInfo.EndCursor\n\t}\n\n\treturn allIssues, nil\n}\n","sourceCodeStart":582,"sourceCodeEnd":618,"githubUrl":"https://github.com/gastownhall/beads/blob/71377f276968b452ee607177637970a4ff888584/internal/linear/client.go#L582-L618","documentation":"FetchIssuesSince wraps any Execute failure with this message, including the RFC3339 `since` timestamp in the text. The wrapped cause is the underlying failure for that page fetch (GraphQL errors, rate limiting, retries exhausted, HTTP errors, auth).","triggerScenarios":"Execute failure inside the FetchIssuesSince pagination loop: malformed or invalid updatedAt filter (GraphQL error), expired API token, 429 retries exhausted, network failure, or 4xx/5xx HTTP response from Linear.","commonSituations":"Rate-limit exhaustion during a large incremental sync; a since timestamp formatted unexpectedly causing a Linear filter validation error; revoked OAuth token with a failing refresh (401 path).","solutions":["Unwrap the error to see the root cause after 'since <timestamp>: '","If rate-limited, wait for the reset (check X-RateLimit-Requests-Reset) and retry","Verify the API token is still valid and can read the team","Confirm the since timestamp is a sane RFC3339 time (not zero/epoch)","Check Linear status page during widespread failures"],"exampleFix":"// before\nissues, err := client.FetchIssuesSince(ctx, \"open\", since)\n// after: retry with backoff on wrapped rate-limit errors\nissues, err := client.FetchIssuesSince(ctx, \"open\", since)\nif err != nil && strings.Contains(err.Error(), \"max retries\") {\n    time.Sleep(rateLimitReset - time.Now().Sub(time.Time{})) // or requeue the job\n    issues, err = client.FetchIssuesSince(ctx, \"open\", since)\n}","handlingStrategy":"try-catch","validationCode":"if client.TeamID == \"\" || token == \"\" || since.IsZero() {\n    return errors.New(\"linear: TEAM_ID, token, and non-zero since are required\")\n}","typeGuard":null,"tryCatchPattern":"issues, err := client.FetchIssuesSince(ctx, \"open\", since)\nif err != nil {\n    if strings.Contains(err.Error(), \"max retries\") || strings.Contains(err.Error(), \"rate limited\") {\n        // transient: requeue with the same watermark so nothing is lost\n        return requeueSync(since, err)\n    }\n    return fmt.Errorf(\"sync failed permanently: %w\", err)\n}","preventionTips":["Keep the since watermark persistent so retries resume exactly","Back off on rate limits before re-running large deltas","Validate the token/team at startup, not mid-sync","Advance the watermark only after a fully successful fetch"],"tags":["linear","sync","network","api-error"],"backgroundTag":"linear-api-fetch-failed","analyzedSha":"71377f276968b452ee607177637970a4ff888584","analyzedAt":"2026-08-30T18:55:39.744Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}