{"record":{"id":"4bb7b6ede4df58f1","repo":"router-for-me/CLIProxyAPI","slug":"antigravity-userinfo-execute-request-w","errorCode":null,"errorMessage":"antigravity userinfo: execute request: %w","messagePattern":"antigravity userinfo: execute request: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/auth/antigravity/auth.go","lineNumber":196,"sourceCode":"\treturn &token, nil\n}\n\n// FetchUserInfo retrieves user email from Google\nfunc (o *AntigravityAuth) FetchUserInfo(ctx context.Context, accessToken string) (string, error) {\n\taccessToken = strings.TrimSpace(accessToken)\n\tif accessToken == \"\" {\n\t\treturn \"\", fmt.Errorf(\"antigravity userinfo: missing access token\")\n\t}\n\treq, err := http.NewRequestWithContext(ctx, http.MethodGet, UserInfoEndpoint, nil)\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"antigravity userinfo: create request: %w\", err)\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+accessToken)\n\treq.Header.Set(\"User-Agent\", o.shortUserAgent())\n\n\tresp, errDo := o.httpClient.Do(req)\n\tif errDo != nil {\n\t\treturn \"\", fmt.Errorf(\"antigravity userinfo: execute request: %w\", errDo)\n\t}\n\tdefer func() {\n\t\tif errClose := resp.Body.Close(); errClose != nil {\n\t\t\tlog.Errorf(\"antigravity userinfo: close body error: %v\", errClose)\n\t\t}\n\t}()\n\n\tif resp.StatusCode < http.StatusOK || resp.StatusCode >= http.StatusMultipleChoices {\n\t\tbodyBytes, errRead := io.ReadAll(io.LimitReader(resp.Body, 8<<10))\n\t\tif errRead != nil {\n\t\t\treturn \"\", fmt.Errorf(\"antigravity userinfo: read response: %w\", errRead)\n\t\t}\n\t\tbody := strings.TrimSpace(string(bodyBytes))\n\t\tif body == \"\" {\n\t\t\treturn \"\", fmt.Errorf(\"antigravity userinfo: request failed: status %d\", resp.StatusCode)\n\t\t}\n\t\treturn \"\", fmt.Errorf(\"antigravity userinfo: request failed: status %d: %s\", resp.StatusCode, body)\n\t}","sourceCodeStart":178,"sourceCodeEnd":214,"githubUrl":"https://github.com/router-for-me/CLIProxyAPI/blob/78f0c4079e3e6273d65d03b5549cffc898703264/internal/auth/antigravity/auth.go#L178-L214","documentation":"The GET to the userinfo endpoint failed at the transport level (httpClient.Do). The wrapped *url.Error identifies the real cause: DNS failure, connection refused, TLS error, timeout, or context cancellation after the request started.","triggerScenarios":"No egress to the Google userinfo host; TLS interception with untrusted CA; context deadline exceeded mid-request; proxy blocking the endpoint.","commonSituations":"Sandboxed/CI environments without network; corporate MITM proxies; transient drops during the auth sequence.","solutions":["Unwrap the error to distinguish DNS/TLS/timeout and test reachability with curl from the same host","Trust the proxy CA or configure the proxy on the http.Client","Retry — userinfo is a read-only idempotent call, unlike the one-shot code exchange"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"var netErr net.Error\nif errors.As(err, &netErr) && netErr.Timeout() {\n\t// idempotent read — safe to retry with backoff\n}","preventionTips":["Confirm network reachability of Google endpoints in the runtime environment","Configure proxy/CA settings on the shared http.Client once","Retry idempotent auth reads with backoff"],"tags":["oauth","antigravity","network","tls"],"backgroundTag":null,"analyzedSha":"78f0c4079e3e6273d65d03b5549cffc898703264","analyzedAt":"2026-08-15T12:26:37.444Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}