{"record":{"id":"e3d14a3f13a10a8b","repo":"hashicorp/nomad","slug":"failed-to-parse-signal-w","errorCode":null,"errorMessage":"failed to parse signal: %w","messagePattern":"failed to parse signal: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"client/allocrunner/taskrunner/identity_hook.go","lineNumber":199,"sourceCode":"\t\t\t\t\t\tSetDisplayMessage(fmt.Sprintf(\"Identity[%s]: failed to send signal: %v\", wid.Name, err)))\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// Note: any code added here will not run on first run\n\n\t\tcase <-h.stopCtx.Done():\n\t\t\treturn\n\t\t}\n\t}\n}\n\n// signalTask sends the configured signal to a task or returns an error.\nfunc (h *identityHook) signalTask(wid *structs.WorkloadIdentity) error {\n\ts, err := signals.Parse(wid.ChangeSignal)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to parse signal: %w\", err)\n\t}\n\n\tevent := structs.NewTaskEvent(structs.TaskSignaling).\n\t\tSetTaskSignal(s).\n\t\tSetDisplayMessage(fmt.Sprintf(\"Identity[%s]: new Identity token acquired\", wid.Name))\n\treturn h.lifecycle.Signal(event, wid.ChangeSignal)\n}\n\n// setDefaultToken adds the Nomad token to the task's environment and writes it to a\n// file if requested by the jobsepc.\nfunc (h *identityHook) setDefaultToken() error {\n\ttoken := h.alloc.SignedIdentities[h.task.Name]\n\tif token == \"\" {\n\t\treturn nil\n\t}\n\n\t// Handle internal use and env var\n\th.ts.setNomadToken(token)","sourceCodeStart":181,"sourceCodeEnd":217,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/client/allocrunner/taskrunner/identity_hook.go#L181-L217","documentation":"signalTask parses wid.ChangeSignal with signals.Parse before sending it to the task; an invalid signal name yields 'failed to parse signal: %w'. This happens inside identity watching: when a workload identity is rotated and a change signal is configured, Nomad must translate the configured name (e.g. 'SIGHUP') into a signal value to deliver.","triggerScenarios":"A workload identity block specifies a change_signal string that signals.Parse cannot recognize — misspelled names, lowercase/odd casing not matching known names, numbers out of range, or platform-unsupported signals","commonSituations":"Typo like change_signal = \"SIGHUPP\", using a Windows-unsupported signal on a Windows client, or copy-pasted config from another tool using different signal naming conventions","solutions":["Set change_signal to a valid signal name (e.g. SIGHUP, SIGUSR1) with correct spelling and casing","Verify the signal is supported on the client OS (Windows supports only a subset like SIGTERM/SIGINT/SIGKILL/SIGHUP equivalents)","Remove or fix the identity's change_signal block if the task does not need to be notified of rotation","Check the wrapped %w error in the task event for the exact parse complaint"],"exampleFix":"// before\nidentity {\n  name = \"default\"\n  change_signal = \"HUP\"\n}\n// after\nidentity {\n  name = \"default\"\n  change_signal = \"SIGHUP\"\n}","handlingStrategy":"validation","validationCode":"// pre-validate the configured signal name\nif _, err := signals.Parse(cfg.ChangeSignal); err != nil {\n    return fmt.Errorf(\"invalid change_signal: %v\", err)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use canonical signal names (SIGHUP, SIGUSR1) with correct casing","Only configure signals the target OS supports (Windows subset)","Run nomad job validate before submit","Make the task actually handle the configured signal"],"tags":["signals","workload-identity","config"],"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"}