{"record":{"id":"3ddb133c843f28d1","repo":"Netflix/chaosmonkey","slug":"http-get-failed-at-s-3ddb13","errorCode":null,"errorMessage":"http get failed at %s","messagePattern":"http get failed at (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"spinnaker/spinnaker.go","lineNumber":259,"sourceCode":"\tfor _, appName := range appNames {\n\t\tapp, err := s.GetApp(appName)\n\t\tif err != nil {\n\t\t\t// If we have a problem with one app, we go to the next one\n\t\t\tlog.Printf(\"WARNING: GetApp failed for %s: %v\", appName, err)\n\t\t\tcontinue\n\t\t}\n\n\t\tc <- app\n\t}\n}\n\n// GetInstanceIDs gets the instance ids for a cluster\nfunc (s Spinnaker) GetInstanceIDs(app string, account D.AccountName, cloudProvider string, region D.RegionName, cluster D.ClusterName) (D.ASGName, []D.InstanceID, error) {\n\turl := s.activeASGURL(app, string(account), string(cluster), cloudProvider, string(region))\n\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 {\n\t\t\terr = errors.Wrapf(err, \"body close failed at %s\", url)\n\t\t}\n\t}()\n\n\tif resp.StatusCode != http.StatusOK {\n\t\treturn \"\", nil, errors.Errorf(\"unexpected response code (%d) from %s\", resp.StatusCode, url)\n\t}\n\n\tbody, err := ioutil.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn \"\", nil, errors.Wrap(err, fmt.Sprintf(\"body read failed at %s\", url))\n\t}\n\n\tvar data struct {","sourceCodeStart":241,"sourceCodeEnd":277,"githubUrl":"https://github.com/Netflix/chaosmonkey/blob/eaa28fb761c0ebe8644d1333e5d164e9cc3071e9/spinnaker/spinnaker.go#L241-L277","documentation":"GetIssueIDs is not involved; this error is produced by Spinnaker.GetInstanceIDs when the HTTP GET to the Spinnaker API endpoint for the active ASG of a cluster fails at the transport level. The library wraps the underlying net/http error with the requested URL so the caller knows which endpoint was unreachable. It means the request never completed — DNS, connection, TLS, timeout, or request-construction failure — not that the server returned a bad status.","triggerScenarios":"Calling GetInstanceIDs when the Spinnaker gate endpoint configured in the client is down, unreachable, the URL built by activeASGURL is malformed, DNS fails, TLS handshake fails, or the request times out or is cancelled before a response arrives.","commonSituations":"Spinnaker gate is not running or the configured host/port is wrong; network partition or firewall blocking the endpoint; DNS misconfiguration in cluster; expired TLS certificates; client-side timeouts during slow responses; typo in app/account/cluster inputs producing an invalid URL.","solutions":["Verify the Spinnaker API endpoint is reachable: curl the URL printed in the error from the machine running the code.","Check the client configuration (base URL, port, TLS) used to construct s.client and correct it.","Check DNS resolution and network/firewall rules to the Spinnaker gate host.","Increase the HTTP client timeout if requests are timing out under load.","Retry the call; transient network blips are a common cause."],"exampleFix":"// before\nclient := &http.Client{}\nsp := Spinnaker{client: client, ...}\n// after\nclient := &http.Client{Timeout: 30 * time.Second}\nsp := Spinnaker{client: client, ...} // also verify base URL points at the gate host","handlingStrategy":"retry","validationCode":"// before calling, check reachability\nu, err := url.Parse(baseURL)\nif err != nil || u.Scheme == \"\" || u.Host == \"\" {\n    return fmt.Errorf(\"invalid spinnaker base URL: %v\", err)\n}\nconn, err := net.DialTimeout(\"tcp\", u.Host, 5*time.Second)\nif err != nil {\n    return fmt.Errorf(\"spinnaker endpoint unreachable: %v\", err)\n}\nconn.Close()","typeGuard":null,"tryCatchPattern":"// Go: check and retry with backoff\nvar asg D.ASGName\nvar ids []D.InstanceID\nfor i := 0; i < 3; i++ {\n    asg, ids, err = sp.GetInstanceIDs(app, acct, cp, region, cluster)\n    if err == nil {\n        break\n    }\n    var netErr net.Error\n    if errors.As(err, &netErr) {\n        time.Sleep(time.Duration(1<<i) * time.Second)\n        continue\n    }\n    return err // non-retryable\n}\nif err != nil {\n    log.Printf(\"GetInstanceIDs failed after retries: %+v\", err)\n}","preventionTips":["Configure the HTTP client with a sane timeout","Health-check the Spinnaker gate before workload starts","Validate base URL and credentials in config at startup","Log the full error chain (%+v with pkg/errors) to see the URL","Monitor gate availability"],"tags":["http","network","go","spinnaker"],"backgroundTag":"http-request-failed","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"}