{"record":{"id":"05730ea61cc88bb6","repo":"hashicorp/nomad","slug":"error-unknown-signal-given-for-shutdown-s","errorCode":null,"errorMessage":"error unknown signal given for shutdown: %s","messagePattern":"error unknown signal given for shutdown: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"drivers/shared/executor/executor.go","lineNumber":647,"sourceCode":"\t}\n\n\tproc, err := os.FindProcess(e.childCmd.Process.Pid)\n\tif err != nil {\n\t\terr = fmt.Errorf(\"executor failed to find process: %v\", err)\n\t\te.logger.Warn(\"failed to shutdown due to inability to find process\", \"pid\", e.childCmd.Process.Pid, \"error\", err)\n\t\treturn err\n\t}\n\n\t// If grace is 0 then skip shutdown logic\n\tif grace > 0 {\n\t\t// Default signal to SIGINT if not set\n\t\tif signal == \"\" {\n\t\t\tsignal = \"SIGINT\"\n\t\t}\n\n\t\tsig, ok := signals.SignalLookup[signal]\n\t\tif !ok {\n\t\t\terr = fmt.Errorf(\"error unknown signal given for shutdown: %s\", signal)\n\t\t\te.logger.Warn(\"failed to shutdown\", \"error\", err)\n\t\t\treturn err\n\t\t}\n\n\t\tif err := e.shutdownProcess(sig, proc); err != nil {\n\t\t\te.logger.Warn(\"failed to shutdown process\", \"pid\", proc.Pid, \"error\", err)\n\t\t\treturn err\n\t\t}\n\n\t\tselect {\n\t\tcase <-e.processExited:\n\t\tcase <-time.After(grace):\n\t\t\tproc.Kill()\n\t\t}\n\t} else {\n\t\tproc.Kill()\n\t}\n","sourceCodeStart":629,"sourceCodeEnd":665,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/drivers/shared/executor/executor.go#L629-L665","documentation":"Shutdown looks up the configured shutdown signal (defaulting to SIGINT) in signals.SignalLookup; if the configured signal name is not recognized, it returns this error without signaling the task. The signal string comes from the driver/task config (e.g. kill_signal), so a typo or unsupported name triggers it.","triggerScenarios":"Calling Shutdown with a driver/task kill_signal set to an unknown or misspelled name such as 'SIGTERM ' (trailing space), 'sigterm' on a platform where lookup is case-sensitive, or a signal not present in the signal map (e.g. platform-specific signals).","commonSituations":"Typo in task config kill_signal; copying a signal name valid on one OS to another (Windows); whitespace or casing mistakes in HCL/JSON job files.","solutions":["Correct the signal name in the task config to a standard form like 'SIGINT', 'SIGTERM', 'SIGHUP'","Trim whitespace and match the exact casing expected by signals.SignalLookup","Verify the signal exists on the target platform (Windows supports only a small subset)","Check signals.SignalLookup in the repo for the accepted set of names"],"exampleFix":"// before (task config)\nkill_signal = \"sigquit \"\n// after\nkill_signal = \"SIGQUIT\"","handlingStrategy":"validation","validationCode":"validSignals := map[string]bool{\"SIGINT\": true, \"SIGTERM\": true, \"SIGHUP\": true, \"SIGQUIT\": true, \"SIGKILL\": true}\nsig := strings.TrimSpace(strings.ToUpper(cfg.KillSignal))\nif sig == \"\" { sig = \"SIGINT\" }\nif !validSignals[sig] {\n    return fmt.Errorf(\"unsupported kill_signal %q\", cfg.KillSignal)\n}","typeGuard":"func isValidSignalName(s string) bool {\n    _, ok := signals.SignalLookup[strings.TrimSpace(s)]\n    return ok\n}","tryCatchPattern":"if err := exec.Shutdown(); err != nil {\n    if strings.Contains(err.Error(), \"unknown signal given for shutdown\") {\n        return fmt.Errorf(\"fix kill_signal in task config: %w\", err)\n    }\n    return err\n}","preventionTips":["Validate kill_signal values against signals.SignalLookup at job submission time","Always use uppercase 'SIG*' names with no whitespace","Check platform support for the signal (especially on Windows)"],"tags":["signal","shutdown","configuration"],"backgroundTag":"unknown-signal-name","analyzedSha":"482b49bf1aec006f089bcfc7e632d8f6ac303e5e","analyzedAt":"2026-09-04T07:54:14.808Z","contentChangedAt":"2026-09-04T07:54:14.808Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}