hashicorp / nomad

Nomad is an easy-to-use, flexible, and performant workload orchestrator that can deploy a mix of microservice, batch, containerized, and non-containerized applications. Nomad is easy to operate and scale and has native Consul and Vault integrations.
https://www.nomadproject.io/
Other
14.87k stars 1.95k forks source link

docker plugin: disabling docker healthchecks causes nomad to crash due to an invalid config #20549

Closed jaloren closed 5 months ago

jaloren commented 5 months ago

Nomad version

Nomad v1.7.7
BuildDate 2024-04-16T19:26:43Z
Revision 0f34c85ee63f6472bd2db1e2487611f4b176c70c

Operating system and Environment details

Issue

Per the docs, you can configure the docker plugin to turn off docker healthchecks when starting a container. When i enabled this configuration, it causes nomad agent to crash because of a parsing error.

Reproduction steps

In a nomad client add the following:

plugin "docker" {
  config {

    healthchecks {
      disable = true
    }
  }
}

Attempt to start the nomad with this configuration.

Expected Result

Nomad agent starts up and when running a container it disables the container's healthcheck

Actual Result

Nomad crashes with the following error:


 |
  | \t* plugin "docker" (driver): failed to parse config:  Invalid label: No argument or block type is named "healthchecks".
  | failed to create plugin loader: failed to initialize plugin loader: parsing plugin configurations failed: 1 error occurred:
  error=
    2024-05-09T14:37:55.973Z [ERROR] agent: error starting agent:
    2024-05-09T14:37:55.969Z [WARN]  agent.plugin_loader: skipping external plugins since plugin_dir doesn't exist: plugin_dir=/opt/nomad>
        * plugin "docker" (driver): failed to parse config:  Invalid label: No argument or block type is named "healthchecks".
==> Error starting agent: failed to create plugin loader: failed to initialize plugin loader: parsing plugin configurations failed: 1 err>
==> Starting Nomad agent...
``
tgross commented 5 months ago

@jaloren that option is only available in the task configuration, not the plugin configuration. You might see that the field is located under the task configuration heading

jaloren commented 5 months ago

You are right. Very much user error on my part and not reading the docs closely enough. Sorry for the bother.