Hashicorp nomad job stuck in pending after restart

103 views Asked by At

If a nomad job got 137 error or template re-rendered after changing value in vault, job restarts and then stuck in pending state. Driver java. Jobs with driver exec restarts succesfully. Nomad version 1.6.2. job task Job hcl:

job "conv" {
  datacenters = ["main"]
  type        = "service"
priority = 55
  
  update {
    max_parallel      = 1
    min_healthy_time  = "10s"
    healthy_deadline  = "1m"
    progress_deadline = "1m1s"
    auto_revert       = false
    canary            = 0
  }

  
  migrate {
    max_parallel     = 1
    health_check     = "checks"
    min_healthy_time = "10s"
    healthy_deadline = "1m"
  }

  reschedule {
    delay          = "30s"
    delay_function = "constant"
    unlimited      = true
  }

  group "processing" {
    count = 1

    restart {
      attempts = 2
      interval = "1m"
      delay    = "15s"
      mode     = "fail"
    }

    task "conv" {
      driver = "java"

      resources {
        cpu = 12000
        memory = 4096
      }

    config {
    jar_path    = "local/conv-3.24.2.jar"
    args = ["--mode", "service"]
    class_path = "/local"
    jvm_options = ["-Xmx4096m", "-Xms2048m"]
  }


       artifact {
        source      = "http://nexus.XXXX/repository/raw/XXXX/3.24.2/conv-3.24.2.tar"
        destination = "local/"
      }


      template {
        data        = <<EOTC
maximumPoolSize={{with secret "kv/conv" }}{{.Data.data.maximumPoolSize}}{{ end }}
EOTC
        destination = "./config.properties"
      }

      service {
        name = "conv"
        tags = ["processing"]
      }
    }
  }
}

Tryed to run this job as exec, restarted succesfully. Error occurs only with java driver.

0

There are 0 answers