Netflix/chaosmonkey · error

failed to parse body of spinnaker asgs url (%s): body: '%s'.

Error message

failed to parse body of spinnaker asgs url (%s): body: '%s'. %v

What it means

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).

Source

Thrown at spinnaker/spinnaker.go:476

		      "us-east-1d",
		      "us-east-1e"
		    ],
		    "disabled": false,
		    "instances": [
		      {
		        "name": "i-f9ffb752",
				...
			  },
			...
		   ]
		  }
		]
	*/

	var asgs []spinnakerServerGroup
	err = json.Unmarshal(body, &asgs)
	if err != nil {
		return nil, fmt.Errorf("failed to parse body of spinnaker asgs url (%s): body: '%s'. %v", url, string(body), err)
	}

	return asgs, nil
}

// CloudProvider returns the cloud provider for a given account name
func (s Spinnaker) CloudProvider(name string) (provider string, err error) {
	account, err := s.account(name)
	if err != nil {
		return "", err
	}

	if account.CloudProvider == "" {
		return "", errors.New("no cloudProvider field in response body")
	}

	return account.CloudProvider, nil
}

View on GitHub (pinned to eaa28fb761)

Solutions

  1. Inspect the logged body to see what Spinnaker actually returned (often an auth error or proxy page)
  2. Verify the Spinnaker API version still returns an array of server groups for this endpoint
  3. Handle a JSON error-object response separately from the array case
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at spinnaker/spinnaker.go:476 when the library encounters an invalid state.

Common situations: See trigger scenarios.

Understand the failure class


AI-assisted analysis of Netflix/chaosmonkey@eaa28fb761 (2026-09-03). Data as JSON: /api/errors/af55170004c0add0. Report an issue: GitHub.