diff --git a/client/alloc_runner.go b/client/alloc_runner.go index 3ab9a5d07..66af29b56 100644 --- a/client/alloc_runner.go +++ b/client/alloc_runner.go @@ -289,6 +289,12 @@ func (r *AllocRunner) RestoreState() error { name := task.Name state := r.taskStates[name] + // Nomad exited before task could start, nothing to restore. + // AllocRunner.Run will start a new TaskRunner for this task + if state == nil { + continue + } + // Mark the task as restored. r.restored[name] = struct{}{}