hashicorp/nomad · warning

MaxClientDisconnect is deprecated and ignored in favor of Di

Error message

MaxClientDisconnect is deprecated and ignored in favor of Disconnect.LostAfter

What it means

Deprecation warning emitted by TaskGroup.Warnings: the job spec sets the legacy group-level max_client_disconnect field, which the scheduler now ignores because disconnect behavior is configured via the disconnect.lost_after block. This is a non-fatal warning surfaced to the job submitter, not a runtime failure; resolve by migrating the setting to disconnect { lost_after = ... }.

Source

Thrown at nomad/structs/structs.go:7653

}

// Warnings returns a list of warnings that may be from dubious settings or
// deprecation warnings.
func (tg *TaskGroup) Warnings(j *Job) error {
	var mErr multierror.Error

	// Validate the update strategy
	if u := tg.Update; u != nil {
		// Check the counts are appropriate
		if tg.Count > 1 && u.MaxParallel > tg.Count && !(j.IsMultiregion() && tg.Count == 0) {
			mErr.Errors = append(mErr.Errors,
				fmt.Errorf("Update max parallel count is greater than task group count (%d > %d). "+
					"A destructive change would result in the simultaneous replacement of all allocations.", u.MaxParallel, tg.Count))
		}
	}

	if tg.MaxClientDisconnect != nil {
		mErr.Errors = append(mErr.Errors, errors.New("MaxClientDisconnect is deprecated and ignored in favor of Disconnect.LostAfter"))
	}

	if tg.StopAfterClientDisconnect != nil {
		mErr.Errors = append(mErr.Errors, errors.New("StopAfterClientDisconnect is deprecated and ignored favor of Disconnect.StopOnClientAfter"))
	}

	if tg.PreventRescheduleOnLost {
		mErr.Errors = append(mErr.Errors, errors.New("PreventRescheduleOnLost is deprecated and ignored in favor of Disconnect.Replace"))
	}

	// Warn about unbounded rescheduling which may cause thrashing if tasks have
	// unlimited attempts and a low delay.
	//
	// The 5 second gate on the delay is used as this was the previous minimum
	// value which did not produce a warning. It therefore feels like the right
	// gate to use.
	if rp := tg.ReschedulePolicy; rp != nil && rp.Unlimited && rp.Delay < 5*time.Second {
		mErr.Errors = append(

View on GitHub (pinned to 482b49bf1a)

Solutions

  1. Remove stop_after_client_disconnect and use disconnect { stop_on_client_after = "..." } instead.
  2. Update any templates/modules emitting the deprecated field.
  3. Review the target Nomad version's changelog for semantic differences between the old and new fields.

Example fix

// before
group "web" {
  stop_after_client_disconnect = "10m"
}
// after
group "web" {
  disconnect {
    stop_on_client_after = "10m"
  }
}
Defensive patterns

Strategy: validation

Validate before calling

if tg.StopAfterClientDisconnect != nil {
    return errors.New("stop_after_client_disconnect is deprecated; use disconnect { stop_on_client_after = ... }")
}

Prevention

When it happens

Trigger: Submitting a job whose group sets stop_after_client_disconnect after upgrading to a Nomad version that added the Disconnect block.

Common situations: Legacy specs unchanged across Nomad upgrades; automation or Terraform modules still writing the old attribute.

Related errors


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