{"record":{"id":"0e17df161dcf5c8e","repo":"Netflix/chaosmonkey","slug":"retrieve-other-id-failed","errorCode":null,"errorMessage":"retrieve other id failed","messagePattern":"retrieve other id failed","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"spinnaker/terminator.go","lineNumber":78,"sourceCode":"\n// tasksURL returns the Spinnaker tasks URL associated with an app\nfunc (s Spinnaker) tasksURL(appName string) string {\n\treturn s.appURL(appName) + \"/tasks\"\n}\n\n// Kill implements term.Terminator.Kill\nfunc (t fakeTerminator) Execute(trm chaosmonkey.Termination) error {\n\treturn nil\n}\n\n// Execute implements term.Terminator.Execute\nfunc (s Spinnaker) Execute(trm chaosmonkey.Termination) (err error) {\n\tins := trm.Instance\n\turl := s.tasksURL(ins.AppName())\n\n\totherID, err := s.OtherID(ins)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"retrieve other id failed\")\n\t}\n\n\tpayload := killJSONPayload(ins, otherID, s.user)\n\tresp, err := s.client.Post(url, \"application/json\", bytes.NewReader(payload))\n\tif err != nil {\n\t\treturn errors.Wrap(err, fmt.Sprintf(\"POST to %s failed, (body '%s')\", url, string(payload)))\n\t}\n\n\tdefer func() {\n\t\tif cerr := resp.Body.Close(); cerr != nil && err == nil {\n\t\t\terr = errors.Wrap(cerr, fmt.Sprintf(\"failed to close response body of %s\", url))\n\t\t}\n\t}()\n\n\tif resp.StatusCode != http.StatusOK {\n\t\tlog.Printf(\"Unexpected response: %d\", resp.StatusCode)\n\t\tcontents, err := ioutil.ReadAll(resp.Body)\n\t\tif err != nil {","sourceCodeStart":60,"sourceCodeEnd":96,"githubUrl":"https://github.com/Netflix/chaosmonkey/blob/eaa28fb761c0ebe8644d1333e5d164e9cc3071e9/spinnaker/terminator.go#L60-L96","documentation":"Execute wraps any failure from s.OtherID(ins) with the message \"retrieve other id failed\". OtherID queries the Spinnaker instance endpoint to find an instance's alternate ID (the Titus uuid), so this error means chaosmonkey could not look up the alternate instance id and the termination (kill) request was never sent. The underlying cause (HTTP failure, body read error, unmarshal error, or non-200 status from OtherID) is chained via errors.Wrap.","triggerScenarios":"chaosmonkey.Termination execution calls Spinnaker.Execute, which calls OtherID for the target instance; the GET <api>/<account>/<region>/<instanceId> request fails at any stage (transport error, body read error, JSON parse error, or non-200 status).","commonSituations":"The instance was already terminated before Execute ran, so Spinnaker returns 404; Titus instances whose task data changed or whose uuid lookup fails; temporary Spinnaker Gate outage during the termination step of the chaos experiment; wrong account/region/instance ID data in the chaosmonkey datastore.","solutions":["Look at errors.Cause / the wrapped error to see which stage of OtherID failed (get, body read, unmarshal, or non-200 status).","Verify the instance still exists in Spinnaker before terminating; a 404 means it already went away — treat as already-terminated.","Check Spinnaker Gate availability and logs at the failure time.","Validate that the app/account/region/instance ID stored by chaosmonkey matches the live Spinnaker state.","Re-run the experiment step; transient Gate errors often resolve on retry."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// before executing the termination, confirm the instance still exists\nresp, err := client.Get(instanceURL(app, account, region, instanceID))\nif err != nil || resp.StatusCode == http.StatusNotFound {\n\treturn fmt.Errorf(\"instance %s/%s/%s no longer exists; skipping termination\", app, region, instanceID)\n}","typeGuard":null,"tryCatchPattern":"otherID, err := spinnaker.OtherID(ins)\nif err != nil {\n\tlog.Printf(\"terminate %s: retrieve other id failed: %v (cause: %v)\", ins.ID(), err, errors.Cause(err))\n\tif isNotFound(err) {\n\t\treturn nil // already terminated; treat as success\n\t}\n\treturn err\n}","preventionTips":["Handle already-terminated instances (404) as a success/no-op case","Check instance existence before issuing terminations in experiments","Alert on OtherID failures so Gate outages are caught during experiment runs","Keep chaosmonkey's instance metadata (account/region/ID) in sync with Spinnaker"],"tags":["go","spinnaker","titus","termination"],"backgroundTag":"instance-lookup-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"}