hashicorp/nomad · error
address_mode = driver may only be set for Consul service che
Error message
address_mode = driver may only be set for Consul service checks
What it means
Service check validation in structs validateNomad: the check sets address_mode = "driver", which resolves the address from the task driver, but that mode is only implemented for Consul service checks, not Nomad-native checks.
Source
Thrown at nomad/structs/services.go:379
// nomad checks do not have warnings
if sc.OnUpdate == OnUpdateIgnoreWarn {
return errors.New("on_update may only be set to ignore_warnings for Consul service checks")
}
// below are temporary limitations on checks in nomad
// https://github.com/hashicorp/team-nomad/issues/354
// check_restart.ignore_warnings is not a thing in Nomad (which has no warnings in checks)
if sc.CheckRestart != nil {
if sc.CheckRestart.IgnoreWarnings {
return errors.New("ignore_warnings on check_restart only supported for Consul service checks")
}
}
// address_mode="driver" not yet supported on nomad
if sc.AddressMode == "driver" {
return errors.New("address_mode = driver may only be set for Consul service checks")
}
if sc.Type == "http" {
if sc.Method != "" && !helper.IsMethodHTTP(sc.Method) {
return fmt.Errorf("method type %q not supported in Nomad http check", sc.Method)
}
}
// success_before_passing is consul only
if sc.SuccessBeforePassing != 0 {
return errors.New("success_before_passing may only be set for Consul service checks")
}
// failures_before_critical is consul only
if sc.FailuresBeforeCritical != 0 {
return errors.New("failures_before_critical may only be set for Consul service checks")
}
View on GitHub (pinned to 482b49bf1a)
Solutions
- Remove or change address_mode to "host" (or "auto") on the check
- Advertise the address via the service block instead
- Use a Consul service provider if driver address_mode is needed
Example fix
// before
check {
address_mode = "driver"
}
// after
check {
address_mode = "host"
} Defensive patterns
Strategy: validation
Validate before calling
if check.AddressMode == "driver" && service.Provider != "consul" {
return fmt.Errorf("check %q: address_mode=driver requires consul provider", check.Name)
} Try / catch
if err := job.Validate(); err != nil {
if strings.Contains(err.Error(), "address_mode = driver") {
// switch to address_mode = "host"
}
} Prevention
- Use address_mode host/auto on nomad checks
- Only set driver mode for Consul checks
- Validate job HCL before submit
When it happens
Trigger: A check on a nomad-provider service sets address_mode = "driver".
Common situations: Reusing a Consul check block verbatim on a nomad service; trying to resolve host/drive address ambiguity in nomad checks where the option is unsupported.
Related errors
- Check %q invalid: cannot use address_mode="driver", only che
- expose may only be set for Consul service checks
- on_update may only be set to ignore_warnings for Consul serv
- ignore_warnings on check_restart only supported for Consul s
- success_before_passing may only be set for Consul service ch
AI-assisted analysis of hashicorp/nomad@482b49bf1a (2026-09-04).
Data as JSON: /api/errors/b8bae810f66273db.
Report an issue: GitHub.