{"record":{"id":"c8a656d6e032d3b5","repo":"router-for-me/CLIProxyAPI","slug":"http-d-s","errorCode":null,"errorMessage":"http %d: %s","messagePattern":"http (.+?): (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/auth/antigravity/auth.go","lineNumber":374,"sourceCode":"\t\t\t\t}\n\n\t\t\t\treturn \"\", fmt.Errorf(\"no project_id in response\")\n\t\t\t}\n\n\t\t\ttime.Sleep(2 * time.Second)\n\t\t\tcontinue\n\t\t}\n\n\t\tresponsePreview := strings.TrimSpace(string(bodyBytes))\n\t\tif len(responsePreview) > 500 {\n\t\t\tresponsePreview = responsePreview[:500]\n\t\t}\n\n\t\tresponseErr := responsePreview\n\t\tif len(responseErr) > 200 {\n\t\t\tresponseErr = responseErr[:200]\n\t\t}\n\t\treturn \"\", fmt.Errorf(\"http %d: %s\", resp.StatusCode, responseErr)\n\t}\n\n\treturn \"\", fmt.Errorf(\"onboard user did not complete after %d attempts\", maxAttempts)\n}\n","sourceCodeStart":356,"sourceCodeEnd":379,"githubUrl":"https://github.com/router-for-me/CLIProxyAPI/blob/78f0c4079e3e6273d65d03b5549cffc898703264/internal/auth/antigravity/auth.go#L356-L379","documentation":"Returned by AntigravityAuth.OnboardUser when any poll attempt to onboardUser returns a status other than 200. The message carries the status code plus up to 200 characters of the response body (trimmed from a 500-char preview), so the Google error detail is included. Unlike pending responses (200 + done=false), any non-200 aborts the polling loop immediately rather than counting down attempts.","triggerScenarios":"Expired/invalid access token (401) because onboarding happens after a token lifetime boundary; missing entitlement for the tier_id sent (403, e.g. free-tier not offered to the account); Google 5xx on the daily endpoint.","commonSituations":"Long onboarding polls outliving the token used for them; accounts invited to a paid tier but still sending the default 'free-tier' tier_id; intermittent 503s on daily-cloudcode-pa.googleapis.com.","solutions":["Read the status and embedded body: 401 → re-login to mint a fresh token before onboarding runs","403 with a tier/permission message → the account is not entitled to the tier being requested; verify allowedTiers from the loadCodeAssist response","5xx → re-run login; the loop's 5 attempts do not cover non-200s, so a manual retry is needed","Check system clock skew, which can turn a valid token into a 401"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"if strings.TrimSpace(accessToken) == \"\" {\n    return fmt.Errorf(\"refusing onboardUser with empty token; refresh first\")\n}","typeGuard":null,"tryCatchPattern":"if _, err := auth.OnboardUser(ctx, token, tierID); err != nil && strings.Contains(err.Error(), \"http \") {\n    if strings.Contains(err.Error(), \"http 401\") { /* re-login for fresh token */ }\n    if strings.Contains(err.Error(), \"http 403\") { /* tier not entitled; check allowedTiers */ }\n    if strings.Contains(err.Error(), \"http 5\") { /* transient; retry login */ }\n}","preventionTips":["Mint a fresh token immediately before onboarding; long flows can outlive token lifetime","Use a tier_id actually present in loadCodeAssist allowedTiers for the account"],"tags":["antigravity","http-status","onboarding","authorization"],"backgroundTag":null,"analyzedSha":"78f0c4079e3e6273d65d03b5549cffc898703264","analyzedAt":"2026-08-15T12:26:37.444Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}