`nomad run` keeps returning `Cancelled due to newer version of job`

What does mean when I try running nomad run job.hcl and it keeps returning the output:

==> 2021-11-23T18:22:31-08:00: Monitoring evaluation "2251f5d3"
    2021-11-23T18:22:31-08:00: Evaluation triggered by job "nginx"
==> 2021-11-23T18:22:32-08:00: Monitoring evaluation "2251f5d3"
    2021-11-23T18:22:32-08:00: Evaluation within deployment: "f8e61cd2"
    2021-11-23T18:22:32-08:00: Evaluation status changed: "pending" -> "complete"
==> 2021-11-23T18:22:32-08:00: Evaluation "2251f5d3" finished with status "complete"
==> 2021-11-23T18:22:32-08:00: Monitoring deployment "f8e61cd2"
  ! Deployment "f8e61cd2" cancelled

    ID          = f8e61cd2
    Job ID      = nginx
    Job Version = 6
    Status      = cancelled
    Description = Cancelled due to newer version of job

    Task Group  Desired  Placed  Healthy  Unhealthy  Progress Deadline
    nginx       1        1       0        1          2021-11-23T18:19:42-08:00

Even though I update the job.hcl file, and I run nomad run job.hcl again, it just keeps returning the same output. How do I get around this?

Hi @axsuul,

This happens when the Nomad reconciler identifies that the deployment is no longer needed; the message specifically points to a newer version of the job being available. It is hard to understand exactly what is causing this without some additional information.

  1. Is there any automated system that might be submitting jobs in the background?
  2. What are you changing within the job before running the changed file and how often are you trying this?
  3. Are you setting the check index or any other additional variables when submitting the job?

jrasell and the Nomad team