{"record":{"id":"bf86e05709abf9a1","repo":"Netflix/chaosmonkey","slug":"failed-to-read-body-of-server-groups-url-s-bod","errorCode":null,"errorMessage":"failed to read body of server groups url (%s): body: '%s': %v","messagePattern":"failed to read body of server groups url \\((.+?)\\): body: '(.+?)': (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"spinnaker/spinnaker.go","lineNumber":447,"sourceCode":"}\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\",\n\t\t    \"region\": \"us-east-1\",\n\t\t    \"zones\": [\n\t\t      \"us-east-1c\",\n\t\t      \"us-east-1d\",\n\t\t      \"us-east-1e\"\n\t\t    ],\n\t\t    \"disabled\": false,\n\t\t    \"instances\": [\n\t\t      {\n\t\t        \"name\": \"i-f9ffb752\",\n\t\t\t\t...","sourceCodeStart":429,"sourceCodeEnd":465,"githubUrl":"https://github.com/Netflix/chaosmonkey/blob/eaa28fb761c0ebe8644d1333e5d164e9cc3071e9/spinnaker/spinnaker.go#L429-L465","documentation":"Raised in Spinnaker.asgs when ioutil.ReadAll fails while reading the response body of the server-groups request, meaning the Spinnaker response stream was interrupted (connection reset, timeout, or truncation) before the full JSON payload arrived.","triggerScenarios":"Thrown at spinnaker/spinnaker.go:447 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry the request with a bounded number of attempts, since transient network failures are common","Wrap the HTTP call with a timeout (http.Client{Timeout}) to avoid stalled reads","Check Spinnaker endpoint health and network connectivity if failures persist"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}