{"record":{"id":"af55170004c0add0","repo":"Netflix/chaosmonkey","slug":"failed-to-parse-body-of-spinnaker-asgs-url-s-b","errorCode":null,"errorMessage":"failed to parse body of spinnaker asgs url (%s): body: '%s'. %v","messagePattern":"failed to parse body of spinnaker asgs url \\((.+?)\\): body: '(.+?)'\\. (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"spinnaker/spinnaker.go","lineNumber":476,"sourceCode":"\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...\n\t\t\t  },\n\t\t\t...\n\t\t   ]\n\t\t  }\n\t\t]\n\t*/\n\n\tvar asgs []spinnakerServerGroup\n\terr = json.Unmarshal(body, &asgs)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to parse body of spinnaker asgs url (%s): body: '%s'. %v\", url, string(body), err)\n\t}\n\n\treturn asgs, nil\n}\n\n// CloudProvider returns the cloud provider for a given account name\nfunc (s Spinnaker) CloudProvider(name string) (provider string, err error) {\n\taccount, err := s.account(name)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tif account.CloudProvider == \"\" {\n\t\treturn \"\", errors.New(\"no cloudProvider field in response body\")\n\t}\n\n\treturn account.CloudProvider, nil\n}","sourceCodeStart":458,"sourceCodeEnd":494,"githubUrl":"https://github.com/Netflix/chaosmonkey/blob/eaa28fb761c0ebe8644d1333e5d164e9cc3071e9/spinnaker/spinnaker.go#L458-L494","documentation":"Raised in Spinnaker.asgs when json.Unmarshal fails on the body fetched from the server-groups URL, meaning Spinnaker returned a payload that is not the expected JSON array of spinnakerServerGroup objects (e.g. an HTML error page, a JSON error object, or a schema change).","triggerScenarios":"Thrown at spinnaker/spinnaker.go:476 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the logged body to see what Spinnaker actually returned (often an auth error or proxy page)","Verify the Spinnaker API version still returns an array of server groups for this endpoint","Handle a JSON error-object response separately from the array case"],"exampleFix":null,"handlingStrategy":"validation","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"}