Netflix/chaosmonkey · error

no cloudProvider field in response body

Error message

no cloudProvider field in response body

What it means

CloudProvider() resolves the cloud provider (e.g. aws) for an account via the Spinnaker accounts endpoint, then requires the response to include a non-empty cloudProvider field. The Spinnaker server returned an account object without that field, so Chaos Monkey cannot determine the provider.

Source

Thrown at spinnaker/spinnaker.go:490

	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
}

// account represents a spinnaker account
type account struct {
	CloudProvider string `json:"cloudProvider"`
	Name          string `json:"name"`
	Error         string `json:"error"`
}

// account returns an account by its name
func (s Spinnaker) account(name string) (account, error) {
	url := s.accountsURL(true)
	resp, err := s.client.Get(url)
	var ac account

View on GitHub (pinned to eaa28fb761)

Solutions

  1. Verify with curl that GET <spinnaker>/v1/<account>/... (the accounts URL) actually returns a cloudProvider field for this account
  2. Check the clouddriver/spinnaker version and upgrade if cloudProvider is known to be missing in responses
  3. Exclude that account from chaosmonkey's enabled accounts if it is a non-AWS account without a provider
  4. Confirm you are querying the correct account name — a different, fully-populated account should include the field
Defensive patterns

Strategy: validation

Validate before calling

// Before relying on an account, confirm cloudProvider is populated:
var accounts []struct{ Name, CloudProvider string `json:"cloudProvider"` }
// GET <endpoint>/accounts, unmarshal, and check:
for _, a := range accounts {
	if a.CloudProvider == "" {
		log.Printf("account %s has no cloudProvider; excluding", a.Name)
	}
}

Try / catch

provider, err := spin.CloudProvider(app)
if err != nil {
	if strings.Contains(err.Error(), "no cloudProvider field") {
		log.Printf("skipping app %s: no cloud provider info", app)
		return nil
	}
	return err
}

Prevention

When it happens

Trigger: Calling CloudProvider(name) (as GetApp does) where s.account(name) succeeds (HTTP 200, parseable JSON) but the decoded account struct's CloudProvider is the empty string — i.e. the response JSON lacks a "cloudProvider" key or it is null/empty.

Common situations: Spinnaker backends/other cloud providers that don't populate cloudProvider for certain accounts; custom or older clouddriver versions with different response schemas; pointing chaosmonkey at a non-AWS account (e.g. kubernetes) that has no cloudProvider set.

Related errors


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