{"record":{"id":"412d7a040681f9e1","repo":"istio/istio","slug":"request-not-successful-s","errorCode":null,"errorMessage":"request not successful %s","messagePattern":"request not successful (.+?)","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"istioctl/pkg/admin/istiodconfig.go","lineNumber":346,"sourceCode":"\t\tscopeInfos = append(scopeInfos, si)\n\t}\n\treturn scopeInfos, nil\n}\n\ntype ControlzClient struct {\n\tbaseURL    *url.URL\n\thttpClient *http.Client\n}\n\nfunc (c *ControlzClient) GetScopes() ([]*ScopeInfo, error) {\n\tvar scopeInfos []*ScopeInfo\n\tresp, err := c.httpClient.Get(c.baseURL.String())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer resp.Body.Close()\n\tif resp.StatusCode != http.StatusOK {\n\t\treturn nil, fmt.Errorf(\"request not successful %s\", resp.Status)\n\t}\n\n\terr = json.NewDecoder(resp.Body).Decode(&scopeInfos)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"cannot deserialize response %s\", err)\n\t}\n\treturn scopeInfos, nil\n}\n\nfunc (c *ControlzClient) PutScope(scope *ScopeInfo) error {\n\tvar jsonScopeInfo bytes.Buffer\n\terr := json.NewEncoder(&jsonScopeInfo).Encode(scope)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"cannot serialize scope %+v\", *scope)\n\t}\n\treq, err := http.NewRequest(http.MethodPut, c.baseURL.String()+\"/\"+scope.Name, &jsonScopeInfo)\n\tif err != nil {\n\t\treturn err","sourceCodeStart":328,"sourceCodeEnd":364,"githubUrl":"https://github.com/istio/istio/blob/8dc789c5cf17517c64e3c36cb3288230f149dfae/istioctl/pkg/admin/istiodconfig.go#L328-L364","documentation":"ControlzClient.GetScopes performs a plain HTTP GET against istiod's ControlZ monitoring endpoint. If the response status is anything but 200 OK (404 wrong path, 503 while istiod starts, 500 on internal error, 401/403 behind auth), the body is discarded and this error with the HTTP status line is returned. All istioctl admin log read/write flows go through it.","triggerScenarios":"Hitting a ControlZ base URL where the scopes route does not exist (path/URL misconfigured in the client flags); istiod returning 503 during startup or shutdown; an intermediary (ingress, service mesh sidecar on istiod itself, auth proxy) rewriting or rejecting the request.","commonSituations":"istiod with sidecar injection enabled in istio-system so the request gets mTLS-intercepted; API-server proxy paths that strip routes; version skew where istioctl expects an endpoint shape istiod does not serve.","solutions":["Confirm the ControlZ URL and port (default monitoring port 15014) match your istiod","Curl the endpoint directly to see the raw status: curl -v http://<istiod>:15014/<scopes-path>","Exclude istiod from sidecar injection / ensure no auth proxy sits in front of the monitoring port","Retry once istiod reports Ready; if 404 persists, align istioctl and istiod versions"],"exampleFix":"curl -v http://istiod.istio-system.svc:15014/logging/scopes   # verify 200 before istioctl","handlingStrategy":"try-catch","validationCode":"// Validate the ControlZ URL and reachability before issuing commands\nu, err := url.Parse(controlzAddr)\nif err != nil || u.Scheme != \"http\" && u.Scheme != \"https\" {\n    return fmt.Errorf(\"invalid controlz address %q\", controlzAddr)\n}\nresp, err := http.Get(u.String())\nif err == nil {\n    defer resp.Body.Close()\n    if resp.StatusCode != http.StatusOK {\n        return fmt.Errorf(\"controlz returned %s\", resp.Status)\n    }\n}","typeGuard":null,"tryCatchPattern":"scopes, err := client.GetScopes()\nif err != nil {\n    var se *url.Error\n    if errors.As(err, &se) {\n        // transport failure: retry with backoff\n    } else if strings.Contains(err.Error(), \"request not successful\") {\n        // HTTP-level: inspect status, do not blind-retry 4xx\n    }\n    return nil, err\n}","preventionTips":["Probe the ControlZ endpoint with curl as a runbook step before istioctl admin commands","Exclude istiod pods from sidecar injection so mTLS does not intercept plain-HTTP probes","Retry only 5xx/status failures with backoff; treat 4xx as configuration bugs"],"tags":["istioctl","istiod","controlz","http","network","status-code"],"backgroundTag":null,"analyzedSha":"8dc789c5cf17517c64e3c36cb3288230f149dfae","analyzedAt":"2026-08-15T15:16:55.434Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}