{"record":{"id":"a46181577a21dc5e","repo":"hashicorp/nomad","slug":"task-network-resources-have-been-deprecated-as-of","errorCode":null,"errorMessage":"task network resources have been deprecated as of Nomad 0.12.0. Please configure networking via group network block.","messagePattern":"task network resources have been deprecated as of Nomad 0\\.12\\.0\\. Please configure networking via group network block\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"nomad/structs/structs.go","lineNumber":8633,"sourceCode":"\t\t\terr := fmt.Errorf(\"port label %q referenced by services %v does not exist\", servicePort, joined)\n\t\t\tmErr.Errors = append(mErr.Errors, err)\n\t\t}\n\t}\n\n\t// Ensure address mode is valid\n\treturn mErr.ErrorOrNil()\n}\n\nfunc (t *Task) Warnings() error {\n\tvar mErr multierror.Error\n\n\t// Validate the resources\n\tif t.Resources != nil && t.Resources.IOPS != 0 {\n\t\tmErr.Errors = append(mErr.Errors, fmt.Errorf(\"IOPS has been deprecated as of Nomad 0.9.0. Please remove IOPS from resource block.\"))\n\t}\n\n\tif t.Resources != nil && len(t.Resources.Networks) != 0 {\n\t\tmErr.Errors = append(mErr.Errors, fmt.Errorf(\"task network resources have been deprecated as of Nomad 0.12.0. Please configure networking via group network block.\"))\n\t}\n\n\tfor idx, tmpl := range t.Templates {\n\t\tif err := tmpl.Warnings(); err != nil {\n\t\t\terr = multierror.Prefix(err, fmt.Sprintf(\"Template[%d]\", idx))\n\t\t\tmErr = *multierror.Append(&mErr, err)\n\t\t}\n\t}\n\n\t// Validate task-level services.\n\tfor _, s := range t.Services {\n\t\tif err := s.Warnings(); err != nil {\n\t\t\terr = multierror.Prefix(err, fmt.Sprintf(\"Service %q:\", s.Name))\n\t\t\tmErr = *multierror.Append(&mErr, err)\n\t\t}\n\t}\n\n\tfor _, wid := range t.Identities {","sourceCodeStart":8615,"sourceCodeEnd":8651,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/structs/structs.go#L8615-L8651","documentation":"A warning emitted by Task.Warnings() when a task still declares network resources inside the task's `resources.network` stanza. Since Nomad 0.12.0, networking must be configured via the group-level `network` block; task-level network resources are deprecated. Non-fatal; surfaced as a job submission warning.","triggerScenarios":"Submitting a job where a task has resources { network { port \"http\" {} } } (the pre-0.12 style). Triggered when t.Resources != nil and len(t.Resources.Networks) != 0 during validation.","commonSituations":"Jobs migrated from Nomad <0.12 unchanged; examples copied from old blog posts or HashiCorp guides predating 0.12; mixing task-level network with the new group network block during migration.","solutions":["Remove the `network` stanza from the task's resources block.","Declare ports in the group-level `network { port ... {} }` block instead.","Update services/checks to reference the group-level port labels.","Run `nomad job validate` after migration to confirm no warnings remain."],"exampleFix":"// before\ntask \"web\" {\n  resources {\n    network {\n      port \"http\" {}\n    }\n  }\n}\n// after\ngroup \"web\" {\n  network {\n    port \"http\" {}\n  }\n  task \"web\" {\n    resources {\n      cpu    = 500\n      memory = 256\n    }\n  }\n}","handlingStrategy":"validation","validationCode":"// Reject task-level network resources before submit\nif len(task.Resources.Networks) > 0 {\n  return errors.New(\"move task network resources to group network block\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Declare all ports at group level only.","Audit legacy jobs written for Nomad <0.12 during upgrades.","Add CI linting that flags `resources { network` in HCL job files."],"tags":["nomad","deprecation","networking","warnings"],"backgroundTag":"deprecated-field-warning","analyzedSha":"482b49bf1aec006f089bcfc7e632d8f6ac303e5e","analyzedAt":"2026-09-04T07:54:14.808Z","contentChangedAt":"2026-09-04T07:54:14.808Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}