{"record":{"id":"dc87a246f9b2f05b","repo":"Netflix/chaosmonkey","slug":"not-terminating-could-not-determine-if-monkey-is","errorCode":null,"errorMessage":"not terminating: could not determine if monkey is enabled","messagePattern":"not terminating: could not determine if monkey is enabled","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"term/term.go","lineNumber":55,"sourceCode":"\treturn nil\n}\n\n// UnleashedInTestEnv is an error returned by Terminate if running unleashed in\n// the test environment, which is not allowed\ntype UnleashedInTestEnv struct{}\n\nfunc (err UnleashedInTestEnv) Error() string {\n\treturn \"not terminating: Chaos Monkey may not run unleashed in the test environment\"\n}\n\n// Terminate executes the \"terminate\" command. This selects an instance\n// based on the app, account, region, stack, cluster passed\n//\n// region, stack, and cluster may be blank\nfunc Terminate(d deps.Deps, app string, account string, region string, stack string, cluster string) error {\n\tenabled, err := d.MonkeyCfg.Enabled()\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"not terminating: could not determine if monkey is enabled\")\n\t}\n\n\tif !enabled {\n\t\tlog.Println(\"not terminating: enabled=false\")\n\t\treturn nil\n\t}\n\n\tproblem, err := d.Ou.Outage()\n\n\t// If the check for ongoing outage fails, we err on the safe side nd don't terminate an instance\n\tif err != nil {\n\t\treturn errors.Wrapf(err, \"not terminating: problem checking if there is an outage\")\n\t}\n\n\tif problem {\n\t\tlog.Println(\"not terminating: outage in progress\")\n\t\treturn nil\n\t}","sourceCodeStart":37,"sourceCodeEnd":73,"githubUrl":"https://github.com/Netflix/chaosmonkey/blob/eaa28fb761c0ebe8644d1333e5d164e9cc3071e9/term/term.go#L37-L73","documentation":"Returned by term.Terminate when MonkeyCfg.Enabled() fails (e.g. malformed enabled flag in the chaosmonkey config); termination is aborted because the tool cannot safely determine whether chaos termination is switched on.","triggerScenarios":"Thrown at term/term.go:55 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the invalid 'enabled' setting in the chaosmonkey config","Ensure the config file parses correctly (see related parse errors)","Run with a valid config or defaults before attempting termination"],"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"}