{"record":{"id":"c64aabb39859d60c","repo":"hashicorp/nomad","slug":"failed-to-parse-signal-q","errorCode":null,"errorMessage":"Failed to parse signal %q","messagePattern":"Failed to parse signal %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"client/allocrunner/taskrunner/template/template.go","lineNumber":206,"sourceCode":"\t// Check pre-conditions\n\tif err := config.Validate(); err != nil {\n\t\treturn nil, err\n\t}\n\n\ttm := &TaskTemplateManager{\n\t\tconfig:     config,\n\t\tshutdownCh: make(chan struct{}),\n\t}\n\n\t// Parse the signals that we need\n\tfor _, tmpl := range config.Templates {\n\t\tif tmpl.ChangeSignal == \"\" {\n\t\t\tcontinue\n\t\t}\n\n\t\tsig, err := signals.Parse(tmpl.ChangeSignal)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"Failed to parse signal %q\", tmpl.ChangeSignal)\n\t\t}\n\n\t\tif tm.signals == nil {\n\t\t\ttm.signals = make(map[string]os.Signal)\n\t\t}\n\n\t\ttm.signals[tmpl.ChangeSignal] = sig\n\t}\n\n\t// Build the consul-template runner\n\trunner, lookup, err := templateRunner(config)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\ttm.runner = runner\n\ttm.lookup = lookup\n\n\treturn tm, nil","sourceCodeStart":188,"sourceCodeEnd":224,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/client/allocrunner/taskrunner/template/template.go#L188-L224","documentation":"NewTaskTemplateManager iterates over the task's templates and parses each template's ChangeSignal with signals.Parse. If the signal string is not a valid POSIX signal name (e.g. \"SIGFOO\", \"sigusr1x\"), the manager creation fails with this error before any rendering starts.","triggerScenarios":"A template stanza in the Nomad job sets `change_signal` (tmpl.ChangeSignal) to a string that signals.Parse cannot resolve — misspelled, wrong-case-with-prefix errors, or a signal unsupported on the target platform.","commonSituations":"Typo in `change_signal = \"SIGHUP\"` in a job file (e.g. \"SIGHUPP\"); using a Windows-unsupported signal on a Windows client; dynamic job generation producing malformed signal names.","solutions":["Fix `change_signal` in the template stanza to a valid signal name such as SIGHUP, SIGTERM, SIGINT, SIGUSR1, or SIGUSR2.","Drop the signal prefix or fix casing if a non-canonical name was used (signals.Parse accepts standard names).","Validate signal strings with signals.Parse in job admission/lint tooling before submitting the job.","On Windows clients, remove change_signal — it is unsupported there."],"exampleFix":"// before (job HCL)\ntemplate { data = \"...\"; change_signal = \"SIGHUPP\" }\n// after\ntemplate { data = \"...\"; change_signal = \"SIGHUP\" }","handlingStrategy":"validation","validationCode":"for _, t := range cfg.Templates {\n    if t.ChangeSignal == \"\" { continue }\n    if _, err := signals.Parse(t.ChangeSignal); err != nil {\n        return fmt.Errorf(\"template %q has invalid change_signal %q\", t.Name, t.ChangeSignal)\n    }\n}","typeGuard":"func validSignal(s string) bool { _, err := signals.Parse(s); return s != \"\" && err == nil }","tryCatchPattern":"tm, err := template.NewTaskTemplateManager(cfg)\nif err != nil {\n    return fmt.Errorf(\"creating template manager: %w\", err)\n}","preventionTips":["Only use canonical signal names (SIGHUP, SIGTERM, SIGINT, SIGUSR1, SIGUSR2) in change_signal.","Validate job templates with signals.Parse at submission time (job lint/admission).","Avoid change_signal on Windows clients where it is unsupported."],"tags":["config","signals","nomad","template","validation"],"backgroundTag":"invalid-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"}