{"record":{"id":"1b8eca89979647a0","repo":"Netflix/chaosmonkey","slug":"not-terminating-recording-termination-event-faile","errorCode":null,"errorMessage":"not terminating: recording termination event failed","messagePattern":"not terminating: recording termination event failed","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"term/term.go","lineNumber":168,"sourceCode":"\t}\n\n\ttrm := chaosmonkey.Termination{Instance: instance, Time: d.Cl.Now(), Leashed: leashed}\n\n\t//\n\t// Check that we don't violate min time between terminations\n\t//\n\terr = d.Checker.Check(trm, *appCfg, d.MonkeyCfg.EndHour(), loc)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"not terminating: check for min time between terminations failed\")\n\t}\n\n\t//\n\t// Record the termination with configured trackers\n\t//\n\tfor _, tracker := range d.Trackers {\n\t\terr = tracker.Track(trm)\n\t\tif err != nil {\n\t\t\treturn errors.Wrap(err, \"not terminating: recording termination event failed\")\n\t\t}\n\t}\n\n\t//\n\t// Actual instance termination happens here\n\t//\n\terr = killer.Execute(trm)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"termination failed\")\n\t}\n\n\treturn nil\n}\n\n// PickRandomInstance randomly selects an eligible instance from a group\nfunc PickRandomInstance(group grp.InstanceGroup, cfg chaosmonkey.AppConfig, dep deploy.Deployment) (chaosmonkey.Instance, bool) {\n\tinstances, err := eligible.Instances(group, cfg.Exceptions, dep)\n\tif err != nil {","sourceCodeStart":150,"sourceCodeEnd":186,"githubUrl":"https://github.com/Netflix/chaosmonkey/blob/eaa28fb761c0ebe8644d1333e5d164e9cc3071e9/term/term.go#L150-L186","documentation":"Fires in doTerminate when one of the configured trackers (d.Trackers) returns an error from tracker.Track(trm) while recording the termination event. Since the event must be recorded before the actual instance is terminated, the wrapped tracker failure aborts the termination. The faulty input is the Termination record the failing tracker rejected.","triggerScenarios":"Thrown at term/term.go:168 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix or restore the failing tracker backend","Check tracker connectivity/credentials","Re-run the termination once trackers are healthy"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}