diff --git a/client/task_runner.go b/client/task_runner.go index 6f183359c..88f2e2a0b 100644 --- a/client/task_runner.go +++ b/client/task_runner.go @@ -247,9 +247,13 @@ func (r *TaskRunner) RestoreState() error { } r.artifactsDownloaded = snap.ArtifactDownloaded r.taskDirBuilt = snap.TaskDirBuilt - r.createdResources = snap.CreatedResources r.payloadRendered = snap.PayloadRendered + // Pre-0.5.3 state snapshots won't have created resources + if snap.CreatedResources != nil { + r.createdResources = snap.CreatedResources + } + if err := r.setTaskEnv(); err != nil { return fmt.Errorf("client: failed to create task environment for task %q in allocation %q: %v", r.task.Name, r.alloc.ID, err)