Netflix/chaosmonkey · error
failed to retrieve server groups url (%s): %v
Error message
failed to retrieve server groups url (%s): %v
What it means
asgs() fetches the autoscaling groups (server groups) for a given app/account/cluster from Spinnaker. This error wraps any failure of the underlying HTTP GET to the serverGroupsURL, including transport, TLS, and connectivity problems, and embeds the full URL.
Source
Thrown at spinnaker/spinnaker.go:436
var m spinnakerClusters
err = json.Unmarshal(body, &m)
if err != nil {
log.Println("Error parsing body when retrieving cluster info for", appName)
log.Println(url)
log.Println(string(body))
log.Fatalln(err)
}
return m
}
// asgs returns a slice of autoscaling groups associated with the given cluster
func (s Spinnaker) asgs(appName, account, clusterName string) (result []spinnakerServerGroup, err error) {
url := s.serverGroupsURL(appName, account, clusterName)
resp, err := s.client.Get(url)
if err != nil {
return nil, fmt.Errorf("failed to retrieve server groups url (%s): %v", url, err)
}
defer func() {
if cerr := resp.Body.Close(); cerr != nil && err == nil {
err = fmt.Errorf("failed to close response body of %s: %v", url, err)
}
}()
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
return nil, fmt.Errorf("failed to read body of server groups url (%s): body: '%s': %v", url, string(body), err)
}
// Example:
/*
[
{
"name": "abc-prod-v016",View on GitHub (pinned to eaa28fb761)
Solutions
- Check connectivity: curl the failing serverGroupsURL with the client cert from the chaosmonkey host
- Verify the app name, account, and cluster name are correct so the constructed URL is valid
- Confirm the TLS client cert is accepted by Spinnaker and the endpoint config is correct
- Retry on transient network failures; check Spinnaker gate health
Defensive patterns
Strategy: retry
Validate before calling
// Pre-flight check of a server groups URL for a known cluster:
url := endpoint + "/applications/" + app + "/clusters/" + account + "/" + cluster
resp, err := http.Get(url)
if err != nil {
log.Printf("server groups endpoint unreachable: %v", err)
} Try / catch
groups, err := spin.asgs(app, account, cluster) // via GetApp in practice
if err != nil {
if strings.Contains(err.Error(), "failed to retrieve server groups url") {
// transient network failure: retry with backoff
return retryWithBackoff(3, func() error { _, err := spin.GetApp(app); return err })
}
return err
} Prevention
- Validate app/account/cluster names so constructed URLs are correct
- Check endpoint reachability and TLS cert acceptance
- Allow retries for transient network errors
- Monitor Spinnaker gate availability during chaosmonkey runs
When it happens
Trigger: Calling asgs(appName, account, clusterName) (via GetApp/GetClusterNames flows) when s.client.Get(serverGroupsURL(...)) returns a non-nil error: DNS failure, refused connection, timeout, or TLS handshake failure.
Common situations: Spinnaker temporarily unreachable during chaosmonkey runs; cert auth misconfigured so the handshake fails; wrong endpoint config; network policies blocking the specific server groups route; app/account/cluster name causing an invalid URL request.
Understand the failure class
Background: 'Something went wrong' / 'Request failed (500)' / 'HTTP error! status: 404' — what failed HTTP requests actually mean and how to find the real cause — this error's family across 28 libraries.
Related errors
- could not retrieve list of apps from spinnaker url %s: %v
- http get failed at %s
- http get failed at %s
- body read failed at %s
- POST to %s failed, (body '%s')
AI-assisted analysis of Netflix/chaosmonkey@eaa28fb761 (2026-09-03).
Data as JSON: /api/errors/d6608133e804e424.
Report an issue: GitHub.