Skip to content

Changing NOMAD_TOKEN causes no-op changes to create deployment (due to token accessor for MRD) #26810

Description

@regner

Nomad version

nomad version
Nomad v1.10.4
BuildDate 2025-08-12T20:48:32Z
Revision 62b195aaa535b2159d215eaf89e6f4a455d6f686

Operating system and Environment details

Nomad cluster is a mix of Linux and Windows machines. When deploying jobs Nomad CLI is run from a Linux environment.

Issue

An execution of nomad job run example.hcl will create a new deployment when there is no change.

Reproduction steps

Create an example job spec, as far as I can tell nothing about it matters, example provided below. Then execute the following commands:

# Login to Nomad
nomad login
export NOMAD_TOKEN=#####

# Create the first deployment
nomad job run example.hcl

# As expected that will create a deployment, once that is completed continue

# This will return immediately and nothing will happen as there is no change 
nomad job run example.hcl

# Generate a new token
nomad login
export NOMAD_TOKEN=#####

# Deploy the job spec again
nomad job run example.hcl

# That will cause a new deployment even though it should not and there
# are not any changes

You can see in this screenshot that the Nomad UI even knows that there is no change between the two versions, yet there is a version bump and a new deployment.

Image

Job file (if appropriate)

job "example-bad-things" {
  region      = "global"
  datacenters = ["dcspecial"]
  node_pool   = "specialpool"
  type        = "service"
  namespace   = "production"

  group "bad-things" {
    task "postgres" {
      driver = "docker"

      config {
        image = "postgres:17.6"
      }
      resources {
        cpu    = 500
        memory = 512
      }

      template {
        destination = "secrets/file.env"
        env         = true
        data        = <<EOF
PGDATA=/var/lib/postgresql/17/docker
POSTGRES_USER=grafana
POSTGRES_PASSWORD=badbadbadbad
POSTGRES_DB=grafana
EOF
      }
    }
  }
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions