hashicorp/nomad · error

MinHealthyTime must be less than HealthyDeadline

Error message

MinHealthyTime must be less than HealthyDeadline

What it means

MigrateStrategy.Validate enforces that MinHealthyTime is strictly less than HealthyDeadline, since an allocation must be observed healthy within the overall deadline window; if MinHealthyTime >= HealthyDeadline the criterion can never be satisfied in a meaningful way. This cross-field check runs after both individual non-negativity checks pass.

Source

Thrown at nomad/structs/structs.go:6863

		// ok
	case "":
		if m.MaxParallel > 0 {
			_ = multierror.Append(&mErr, fmt.Errorf("Missing HealthCheck"))
		}
	default:
		_ = multierror.Append(&mErr, fmt.Errorf("Invalid HealthCheck: %q", m.HealthCheck))
	}

	if m.MinHealthyTime < 0 {
		_ = multierror.Append(&mErr, fmt.Errorf("MinHealthyTime is %s and must be >= 0", m.MinHealthyTime))
	}

	if m.HealthyDeadline < 0 {
		_ = multierror.Append(&mErr, fmt.Errorf("HealthyDeadline is %s and must be >= 0", m.HealthyDeadline))
	}

	if m.MinHealthyTime > m.HealthyDeadline {
		_ = multierror.Append(&mErr, fmt.Errorf("MinHealthyTime must be less than HealthyDeadline"))
	}

	return mErr.ErrorOrNil()
}

// TaskGroup is an atomic unit of placement. Each task group belongs to
// a job and may contain any number of tasks. A task group support running
// in many replicas using the same configuration..
type TaskGroup struct {
	// Name of the task group
	Name string

	// Count is the number of replicas of this task group that should
	// be scheduled.
	Count int

	// Update is used to control the update strategy for this task group
	Update *UpdateStrategy

View on GitHub (pinned to 482b49bf1a)

Solutions

  1. Increase healthy_deadline so it exceeds min_healthy_time.
  2. Reduce min_healthy_time below healthy_deadline.
  3. Keep min_healthy_time well under healthy_deadline (e.g. 30s vs 5m) to leave observation headroom.
  4. Validate with `nomad job validate` after edits.

Example fix

// before
update {
  min_healthy_time = "10m"
  healthy_deadline = "5m"
}
// after
update {
  min_healthy_time = "30s"
  healthy_deadline = "5m"
}
Defensive patterns

Strategy: validation

Validate before calling

func validHealthyWindow(m *structs.MigrateStrategy) error {
	if m.MinHealthyTime >= m.HealthyDeadline {
		return fmt.Errorf("min_healthy_time (%s) must be < healthy_deadline (%s)", m.MinHealthyTime, m.HealthyDeadline)
	}
	return nil
}

Type guard

func hasSaneHealthyWindow(m *structs.MigrateStrategy) bool {
	return m.MinHealthyTime < m.HealthyDeadline
}

Try / catch

if err := strategy.Validate(); err != nil {
	if strings.Contains(err.Error(), "MinHealthyTime must be less than HealthyDeadline") {
		// widen healthy_deadline or shrink min_healthy_time before resubmit
	}
}

Prevention

When it happens

Trigger: Submitting a job where update.min_healthy_time >= update.healthy_deadline, e.g. min_healthy_time="10m" with healthy_deadline="5m" (or equal values).

Common situations: Tuning deadlines independently without noticing their relationship; template variables where the deadline was shrunk but healthy time wasn't; copy-paste between job files keeping mismatched pairs.

Related errors


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