{"record":{"id":"e9a8c9a875b9b5ab","repo":"router-for-me/CLIProxyAPI","slug":"execute-request-w","errorCode":null,"errorMessage":"execute request: %w","messagePattern":"execute request: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/auth/antigravity/auth.go","lineNumber":250,"sourceCode":"\n\trawBody, errMarshal := json.Marshal(loadReqBody)\n\tif errMarshal != nil {\n\t\treturn \"\", fmt.Errorf(\"marshal request body: %w\", errMarshal)\n\t}\n\n\tendpointURL := fmt.Sprintf(\"%s/%s:loadCodeAssist\", APIEndpoint, APIVersion)\n\treq, err := http.NewRequestWithContext(ctx, http.MethodPost, endpointURL, strings.NewReader(string(rawBody)))\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"create request: %w\", err)\n\t}\n\treq.Header.Set(\"Authorization\", \"Bearer \"+accessToken)\n\treq.Header.Set(\"Accept\", \"*/*\")\n\treq.Header.Set(\"Content-Type\", \"application/json\")\n\treq.Header.Set(\"User-Agent\", userAgent)\n\n\tresp, errDo := o.httpClient.Do(req)\n\tif errDo != nil {\n\t\treturn \"\", fmt.Errorf(\"execute request: %w\", errDo)\n\t}\n\tdefer func() {\n\t\tif errClose := resp.Body.Close(); errClose != nil {\n\t\t\tlog.Errorf(\"antigravity loadCodeAssist: close body error: %v\", errClose)\n\t\t}\n\t}()\n\n\tbodyBytes, errRead := io.ReadAll(resp.Body)\n\tif errRead != nil {\n\t\treturn \"\", fmt.Errorf(\"read response: %w\", errRead)\n\t}\n\n\tif resp.StatusCode < http.StatusOK || resp.StatusCode >= http.StatusMultipleChoices {\n\t\treturn \"\", fmt.Errorf(\"request failed with status %d: %s\", resp.StatusCode, strings.TrimSpace(string(bodyBytes)))\n\t}\n\n\tvar loadResp map[string]any\n\tif errDecode := json.Unmarshal(bodyBytes, &loadResp); errDecode != nil {","sourceCodeStart":232,"sourceCodeEnd":268,"githubUrl":"https://github.com/router-for-me/CLIProxyAPI/blob/78f0c4079e3e6273d65d03b5549cffc898703264/internal/auth/antigravity/auth.go#L232-L268","documentation":"Returned by AntigravityAuth.FetchProjectID when the HTTP POST to https://cloudcode-pa.googleapis.com/v1internal:loadCodeAssist fails at the transport level. This wraps the error from httpClient.Do, so the underlying cause is one of Go's *url.Error values: DNS resolution failure, connection refused, TLS handshake error, proxy misconfiguration, or context cancellation. The client is built with util.SetProxy, so an invalid proxy setting in the SDK config also surfaces here.","triggerScenarios":"POST loadCodeAssist while offline, while cloudcode-pa.googleapis.com is DNS-blocked, through a proxy that rejects CONNECT, with an expired corporate TLS root, or when ctx is cancelled before/while the request runs.","commonSituations":"Corporate egress proxies and Zscaler-style TLS interception without the root CA in the trust store; typo'd proxy-server entry in config.yaml; sandboxed CI without network access; Google endpoint temporarily unreachable.","solutions":["Unwrap with errors.As to *url.Error and read the inner cause: DNS, dial, TLS, or context.Canceled","Verify connectivity: curl -v https://cloudcode-pa.googleapis.com from the same host and proxy environment","Fix or remove the proxy-server setting in config so util.SetProxy builds a working client","If context.Canceled, check whether the parent context passed to FetchProjectID is being cancelled prematurely"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"projectID, err := auth.FetchProjectID(ctx, token)\nif err != nil {\n    var urlErr *url.Error\n    if errors.As(err, &urlErr) {\n        switch {\n        case errors.Is(urlErr.Err, context.Canceled):\n            return err // caller cancelled; do not retry\n        default:\n            return retryWithBackoff(func() (string, error) { return auth.FetchProjectID(ctx, token) })\n        }\n    }\n    return err\n}","preventionTips":["Verify egress to cloudcode-pa.googleapis.com (DNS + TLS) before starting the login flow","Keep proxy-server config validated; invalid proxy URLs surface here as transport errors","Distinguish context cancellation from network failure before retrying"],"tags":["antigravity","network","proxy","tls","oauth"],"backgroundTag":null,"analyzedSha":"78f0c4079e3e6273d65d03b5549cffc898703264","analyzedAt":"2026-08-15T12:26:37.444Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}