{"record":{"id":"d6608133e804e424","repo":"Netflix/chaosmonkey","slug":"failed-to-retrieve-server-groups-url-s-v","errorCode":null,"errorMessage":"failed to retrieve server groups url (%s): %v","messagePattern":"failed to retrieve server groups url \\((.+?)\\): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"spinnaker/spinnaker.go","lineNumber":436,"sourceCode":"\tvar m spinnakerClusters\n\n\terr = json.Unmarshal(body, &m)\n\tif err != nil {\n\t\tlog.Println(\"Error parsing body when retrieving cluster info for\", appName)\n\t\tlog.Println(url)\n\t\tlog.Println(string(body))\n\t\tlog.Fatalln(err)\n\t}\n\n\treturn m\n}\n\n// asgs returns a slice of autoscaling groups associated with the given cluster\nfunc (s Spinnaker) asgs(appName, account, clusterName string) (result []spinnakerServerGroup, err error) {\n\turl := s.serverGroupsURL(appName, account, clusterName)\n\tresp, err := s.client.Get(url)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to retrieve server groups url (%s): %v\", url, err)\n\t}\n\n\tdefer func() {\n\t\tif cerr := resp.Body.Close(); cerr != nil && err == nil {\n\t\t\terr = fmt.Errorf(\"failed to close response body of %s: %v\", url, err)\n\t\t}\n\t}()\n\n\tbody, err := ioutil.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to read body of server groups url (%s): body: '%s': %v\", url, string(body), err)\n\t}\n\n\t// Example:\n\t/*\n\t\t[\n\t\t  {\n\t\t    \"name\": \"abc-prod-v016\",","sourceCodeStart":418,"sourceCodeEnd":454,"githubUrl":"https://github.com/Netflix/chaosmonkey/blob/eaa28fb761c0ebe8644d1333e5d164e9cc3071e9/spinnaker/spinnaker.go#L418-L454","documentation":"asgs() fetches the autoscaling groups (server groups) for a given app/account/cluster from Spinnaker. This error wraps any failure of the underlying HTTP GET to the serverGroupsURL, including transport, TLS, and connectivity problems, and embeds the full URL.","triggerScenarios":"Calling asgs(appName, account, clusterName) (via GetApp/GetClusterNames flows) when s.client.Get(serverGroupsURL(...)) returns a non-nil error: DNS failure, refused connection, timeout, or TLS handshake failure.","commonSituations":"Spinnaker temporarily unreachable during chaosmonkey runs; cert auth misconfigured so the handshake fails; wrong endpoint config; network policies blocking the specific server groups route; app/account/cluster name causing an invalid URL request.","solutions":["Check connectivity: curl the failing serverGroupsURL with the client cert from the chaosmonkey host","Verify the app name, account, and cluster name are correct so the constructed URL is valid","Confirm the TLS client cert is accepted by Spinnaker and the endpoint config is correct","Retry on transient network failures; check Spinnaker gate health"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// Pre-flight check of a server groups URL for a known cluster:\nurl := endpoint + \"/applications/\" + app + \"/clusters/\" + account + \"/\" + cluster\nresp, err := http.Get(url)\nif err != nil {\n\tlog.Printf(\"server groups endpoint unreachable: %v\", err)\n}","typeGuard":null,"tryCatchPattern":"groups, err := spin.asgs(app, account, cluster) // via GetApp in practice\nif err != nil {\n\tif strings.Contains(err.Error(), \"failed to retrieve server groups url\") {\n\t\t// transient network failure: retry with backoff\n\t\treturn retryWithBackoff(3, func() error { _, err := spin.GetApp(app); return err })\n\t}\n\treturn err\n}","preventionTips":["Validate app/account/cluster names so constructed URLs are correct","Check endpoint reachability and TLS cert acceptance","Allow retries for transient network errors","Monitor Spinnaker gate availability during chaosmonkey runs"],"tags":["network","http","spinnaker"],"backgroundTag":"http-request-failed","analyzedSha":"eaa28fb761c0ebe8644d1333e5d164e9cc3071e9","analyzedAt":"2026-09-03T17:04:39.020Z","contentChangedAt":"2026-09-03T17:04:39.020Z","schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}