hashicorp/nomad · error
Task not found
Error message
Task not found
What it means
allocRunner.Signal returns this when asked to send a signal to a task whose name does not exist in the allocation's task map. It is a client-side lookup failure: the task name passed to the Signal API does not match any task defined in the allocation's task group. Nomad throws it to prevent signaling a non-existent task.
Source
Thrown at client/allocrunner/alloc_runner.go:1482
}()
select {
case <-waitCh:
case <-ctx.Done():
}
return err.ErrorOrNil()
}
// Signal sends a signal request to task runners inside an allocation. If the
// taskName is empty, then it is sent to all tasks.
func (ar *allocRunner) Signal(taskName, signal string) error {
event := structs.NewTaskEvent(structs.TaskSignaling).SetSignalText(signal)
if taskName != "" {
tr, ok := ar.tasks[taskName]
if !ok {
return fmt.Errorf("Task not found")
}
return tr.Signal(event, signal)
}
var err *multierror.Error
for tn, tr := range ar.tasks {
rerr := tr.Signal(event.Copy(), signal)
if rerr != nil {
err = multierror.Append(err, fmt.Errorf("Failed to signal task: %s, err: %v", tn, rerr))
}
}
return err.ErrorOrNil()
}
// Reconnect logs a reconnect event for each task in the allocation and syncs the current alloc state with the server.View on GitHub (pinned to 482b49bf1a)
Solutions
- Verify the task name with `nomad alloc status <alloc-id>` and use the exact name from the Task list
- Confirm the allocation ID belongs to the task group containing the target task
- If signaling all tasks, omit the taskName (pass empty string) so Signal iterates every task
- Update any hardcoded task names in job files/scripts after job spec changes
Example fix
// before client.Allocations().Signal(ctx, allocID, "sidecar", "SIGUSR1") // after alloc, _, _ := client.Allocations().Info(ctx, allocID, nil) taskName := alloc.TaskGroup // check `nomad alloc status` for exact task names count, _, _ := alloc.TaskGroup _ = count client.Allocations().Signal(ctx, allocID, "envoy-sidecar", "SIGUSR1")
Defensive patterns
Strategy: validation
Validate before calling
alloc, _, err := client.Allocations().Info(ctx, allocID, nil)
if err != nil { return err }
found := false
for _, t := range alloc.TaskStates { if t.Name == taskName { found = true } }
if !found { return fmt.Errorf("task %q not present in alloc %s", taskName, allocID) } Prevention
- Always resolve task names from `nomad alloc status` or the alloc's TaskStates, never hardcode
- Re-fetch the allocation after job updates before signaling
- Pass empty taskName to signal all tasks when you don't need per-task targeting
When it happens
Trigger: Calling Client.Allocations().Signal(allocID, taskName, signal) with a taskName that is empty-check passed but does not match any task in ar.tasks (e.g. typo, task restarted under a different name, or signaling an alloc from a different group).
Common situations: Typoed task name in a script or CI job; hardcoding a task name that changed after a job spec edit; signaling a task in the wrong allocation (alloc belongs to a different group); race where the alloc was updated and the task name no longer exists.
Related errors
- Failed to signal task: %s, err: %v
- task not found
- no servers
- missing node ID
- failed to configure network manager: %v
AI-assisted analysis of hashicorp/nomad@482b49bf1a (2026-09-04).
Data as JSON: /api/errors/67dbfd751d27824b.
Report an issue: GitHub.