hashicorp/nomad · error

on_update may only be set to ignore_warnings for Consul serv

Error message

on_update may only be set to ignore_warnings for Consul service checks

What it means

Nomad service checks never produce 'warning' states, so on_update = "ignore_warnings" is meaningless for them and validateNomad rejects it. That on_update value is only valid for Consul service checks where checks can report warnings.

Source

Thrown at nomad/structs/services.go:364

	return nil
}

// validate a Service's ServiceCheck in the context of the Nomad provider.
func (sc *ServiceCheck) validateNomad() error {
	allowable := []string{ServiceCheckTCP, ServiceCheckHTTP}
	if err := sc.validateCommon(allowable); err != nil {
		return err
	}

	// expose is connect (consul) specific
	if sc.Expose {
		return errors.New("expose may only be set for Consul service checks")
	}

	// 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" {

View on GitHub (pinned to 482b49bf1a)

Solutions

  1. Remove on_update = "ignore_warnings" from the check
  2. Use a supported on_update value (e.g. ignore) or omit it for nomad checks
  3. Move the service to provider = "consul" if ignore_warnings behavior is required

Example fix

// before
check {
  on_update = "ignore_warnings"
}
// after
check {
  on_update = "ignore"
}
Defensive patterns

Strategy: validation

Validate before calling

if check.OnUpdate == "ignore_warnings" && service.Provider != "consul" {
    return fmt.Errorf("check %q: on_update=ignore_warnings requires consul provider", check.Name)
}

Try / catch

if err := job.Validate(); err != nil {
    if strings.Contains(err.Error(), "on_update may only be set to ignore_warnings") {
        // change on_update or remove it
    }
}

Prevention

When it happens

Trigger: A check on a non-Consul (nomad provider) service sets on_update = "ignore_warnings".

Common situations: Copying update-block settings from Consul-backed services to nomad services; misunderstanding that ignore_warnings applies to check_restart semantics only under Consul.

Related errors


AI-assisted analysis of hashicorp/nomad@482b49bf1a (2026-09-04). Data as JSON: /api/errors/a1e5139453cf07f0. Report an issue: GitHub.