{"record":{"id":"d67674993bc95c0e","repo":"Netflix/chaosmonkey","slug":"unexpected-status-code-d-error-s-d67674","errorCode":null,"errorMessage":"unexpected status code: %d. error: %s","messagePattern":"unexpected status code: (.+?)\\. error: (.+?)","errorType":"http","errorClass":null,"httpStatus":null,"severity":"error","filePath":"spinnaker/spinnaker.go","lineNumber":542,"sourceCode":"\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}\n\n\tdefer func() {\n\t\tif cerr := resp.Body.Close(); cerr != nil && err == nil {","sourceCodeStart":524,"sourceCodeEnd":560,"githubUrl":"https://github.com/Netflix/chaosmonkey/blob/eaa28fb761c0ebe8644d1333e5d164e9cc3071e9/spinnaker/spinnaker.go#L524-L560","documentation":"Returned by Spinnaker.account when the accounts endpoint responded non-200 but the matched account entry includes an error field; that per-account error message (e.g. permission denied for the account) is surfaced to explain the failure.","triggerScenarios":"Thrown at spinnaker/spinnaker.go:542 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Read the reported per-account error and address its cause (often credentials or permissions for that account)","Verify the Spinnaker service account can access the named account","Retry once the underlying Spinnaker-side issue is resolved"],"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"}