{"record":{"id":"f6aaa9c1e69af9e6","repo":"Netflix/chaosmonkey","slug":"unexpected-status-code-d-body-s-f6aaa9","errorCode":null,"errorMessage":"unexpected status code: %d. body: %s","messagePattern":"unexpected status code: (.+?)\\. body: (.+?)","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"spinnaker/spinnaker.go","lineNumber":539,"sourceCode":"\tif err != nil {\n\t\treturn ac, errors.Wrapf(err, \"body read failed at %s\", url)\n\t}\n\n\tvar accounts []account\n\terr = json.Unmarshal(body, &accounts)\n\tif err != nil {\n\t\treturn ac, errors.Wrap(err, \"json unmarshal failed\")\n\t}\n\tstatusKO := resp.StatusCode != http.StatusOK\n\n\t// Finally find account\n\tfor _, a := range accounts {\n\t\tif a.Name != name {\n\t\t\tcontinue\n\t\t}\n\t\tif statusKO {\n\t\t\tif a.Error == \"\" {\n\t\t\t\treturn ac, errors.Errorf(\"unexpected status code: %d. body: %s\", resp.StatusCode, body)\n\t\t\t}\n\n\t\t\treturn ac, errors.Errorf(\"unexpected status code: %d. error: %s\", resp.StatusCode, a.Error)\n\t\t}\n\n\t\treturn a, nil\n\t}\n\n\treturn ac, errors.New(\"the account name doesn't exist\")\n}\n\n// GetClusterNames returns a list of cluster names for an app\nfunc (s Spinnaker) GetClusterNames(app string, account D.AccountName) (clusters []D.ClusterName, err error) {\n\turl := s.appURL(app)\n\tresp, err := s.client.Get(url)\n\tif err != nil {\n\t\treturn nil, errors.Wrapf(err, \"http get failed at %s\", url)\n\t}","sourceCodeStart":521,"sourceCodeEnd":557,"githubUrl":"https://github.com/Netflix/chaosmonkey/blob/eaa28fb761c0ebe8644d1333e5d164e9cc3071e9/spinnaker/spinnaker.go#L521-L557","documentation":"Returned by Spinnaker.account when the accounts endpoint responded with a non-200 status and the matched account entry carries no error field, so the raw body is reported as the only clue for why the account listing request failed.","triggerScenarios":"Thrown at spinnaker/spinnaker.go:539 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the response body for the underlying Spinnaker failure (auth, permissions, server error)","Retry after verifying Spinnaker health if the failure looks transient","Fix credentials/endpoint config if the body shows an auth problem"],"exampleFix":null,"handlingStrategy":"fallback","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"}