{"record":{"id":"869f83e4d21001e8","repo":"hashicorp/nomad","slug":"maxclientdisconnect-is-deprecated-and-ignored-in-f","errorCode":null,"errorMessage":"MaxClientDisconnect is deprecated and ignored in favor of Disconnect.LostAfter","messagePattern":"MaxClientDisconnect is deprecated and ignored in favor of Disconnect\\.LostAfter","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"nomad/structs/structs.go","lineNumber":7653,"sourceCode":"}\n\n// Warnings returns a list of warnings that may be from dubious settings or\n// deprecation warnings.\nfunc (tg *TaskGroup) Warnings(j *Job) error {\n\tvar mErr multierror.Error\n\n\t// Validate the update strategy\n\tif u := tg.Update; u != nil {\n\t\t// Check the counts are appropriate\n\t\tif tg.Count > 1 && u.MaxParallel > tg.Count && !(j.IsMultiregion() && tg.Count == 0) {\n\t\t\tmErr.Errors = append(mErr.Errors,\n\t\t\t\tfmt.Errorf(\"Update max parallel count is greater than task group count (%d > %d). \"+\n\t\t\t\t\t\"A destructive change would result in the simultaneous replacement of all allocations.\", u.MaxParallel, tg.Count))\n\t\t}\n\t}\n\n\tif tg.MaxClientDisconnect != nil {\n\t\tmErr.Errors = append(mErr.Errors, errors.New(\"MaxClientDisconnect is deprecated and ignored in favor of Disconnect.LostAfter\"))\n\t}\n\n\tif tg.StopAfterClientDisconnect != nil {\n\t\tmErr.Errors = append(mErr.Errors, errors.New(\"StopAfterClientDisconnect is deprecated and ignored favor of Disconnect.StopOnClientAfter\"))\n\t}\n\n\tif tg.PreventRescheduleOnLost {\n\t\tmErr.Errors = append(mErr.Errors, errors.New(\"PreventRescheduleOnLost is deprecated and ignored in favor of Disconnect.Replace\"))\n\t}\n\n\t// Warn about unbounded rescheduling which may cause thrashing if tasks have\n\t// unlimited attempts and a low delay.\n\t//\n\t// The 5 second gate on the delay is used as this was the previous minimum\n\t// value which did not produce a warning. It therefore feels like the right\n\t// gate to use.\n\tif rp := tg.ReschedulePolicy; rp != nil && rp.Unlimited && rp.Delay < 5*time.Second {\n\t\tmErr.Errors = append(","sourceCodeStart":7635,"sourceCodeEnd":7671,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/structs/structs.go#L7635-L7671","documentation":"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 = ... }.","triggerScenarios":"Submitting a job whose group sets stop_after_client_disconnect after upgrading to a Nomad version that added the Disconnect block.","commonSituations":"Legacy specs unchanged across Nomad upgrades; automation or Terraform modules still writing the old attribute.","solutions":["Remove stop_after_client_disconnect and use disconnect { stop_on_client_after = \"...\" } instead.","Update any templates/modules emitting the deprecated field.","Review the target Nomad version's changelog for semantic differences between the old and new fields."],"exampleFix":"// before\ngroup \"web\" {\n  stop_after_client_disconnect = \"10m\"\n}\n// after\ngroup \"web\" {\n  disconnect {\n    stop_on_client_after = \"10m\"\n  }\n}","handlingStrategy":"validation","validationCode":"if tg.StopAfterClientDisconnect != nil {\n    return errors.New(\"stop_after_client_disconnect is deprecated; use disconnect { stop_on_client_after = ... }\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use the Disconnect block for all new specs","Update Terraform/modules emitting the deprecated field","Review Nomad changelog deprecations on each upgrade"],"tags":["nomad","deprecation","config-migration"],"backgroundTag":"deprecated-field-usage","analyzedSha":"482b49bf1aec006f089bcfc7e632d8f6ac303e5e","analyzedAt":"2026-09-04T07:54:14.808Z","contentChangedAt":"2026-09-04T07:54:14.808Z","schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}