Nomad: raw_exec allows incorrect paramters in the config block

Created on 20 May 2019  路  4Comments  路  Source: hashicorp/nomad

Nomad version

Nomad v0.9.1 (4b2bdbd9ab68a27b10c2ee781cceaaf62e114399)

Operating system and Environment details

CentOS 7 x86_64 + updates

Issue

A raw_exec job complains about the port_map _after_ accepting the job to be run.
Job gets submitted but the allocation fails with the messed up error in output of nomad alloc status NNNNN

Removing/commenting the port_map makes the job work fine.

 failed to parse config
* :1,31-41: Extraneous JSON object property; No argument or block type is named "port_map".

Reproduction steps

Use the following job file and run the job. The allocation will fail with the error.
Seem somewhat related to: https://github.com/hashicorp/nomad/issues/5308

Job file (if appropriate)

job "gowebhello" {
  datacenters = ["dc1"]

  group "group1" {

    task "webserver" {
      driver = "raw_exec"

    artifact {
         #source = "https://github.com/udhos/gowebhello/releases/download/v0.6/gowebhello_linux_amd64"
         source = "http://192.168.0.51:8080/www/gowebhello_linux_amd64"
         mode = "file"
         destination = "local/gowebhello"
      }

      config {
        command = "local/gowebhello"
        port_map {
          http = 8080
        }
      }

      resources {
        cpu    = 500
        memory = 256
        network {
          mbits = 10
          port "http" {}
        }
      }

      service {
        name = "gowebhello"
        tags = ["global", "cache"]
        port = "http"
        check {
          name     = "alive"
          type     = "tcp"
          interval = "10s"
          timeout  = "2s"
        }
      }
    }
  }
}

Expected behaviour

The nomad plan and/or nomad run commands should flag the error and not let the job be submitted.

themconfig themplugin typbug

All 4 comments

thanks, @shantanugadgil .

Hey there

Since this issue hasn't had any activity in a while - we're going to automatically close it in 30 days. If you're still seeing this issue with the latest version of Nomad, please respond here and we'll keep this open and take another look at this.

Thanks!

@cgbaker adding a message to keep the issue alive.

EDIT: This problem is very much there in the following version:

Nomad v0.9.4 (a81aa846a45fb8248551b12616287cb57c418cd6)

thanks, @shantanugadgil . we're still aware of this.

Was this page helpful?
0 / 5 - 0 ratings