hashicorp/nomad · warning

task network resources have been deprecated as of Nomad 0.12

Error message

task network resources have been deprecated as of Nomad 0.12.0. Please configure networking via group network block.

What it means

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.

Source

Thrown at nomad/structs/structs.go:8633

			err := fmt.Errorf("port label %q referenced by services %v does not exist", servicePort, joined)
			mErr.Errors = append(mErr.Errors, err)
		}
	}

	// Ensure address mode is valid
	return mErr.ErrorOrNil()
}

func (t *Task) Warnings() error {
	var mErr multierror.Error

	// Validate the resources
	if t.Resources != nil && t.Resources.IOPS != 0 {
		mErr.Errors = append(mErr.Errors, fmt.Errorf("IOPS has been deprecated as of Nomad 0.9.0. Please remove IOPS from resource block."))
	}

	if t.Resources != nil && len(t.Resources.Networks) != 0 {
		mErr.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."))
	}

	for idx, tmpl := range t.Templates {
		if err := tmpl.Warnings(); err != nil {
			err = multierror.Prefix(err, fmt.Sprintf("Template[%d]", idx))
			mErr = *multierror.Append(&mErr, err)
		}
	}

	// Validate task-level services.
	for _, s := range t.Services {
		if err := s.Warnings(); err != nil {
			err = multierror.Prefix(err, fmt.Sprintf("Service %q:", s.Name))
			mErr = *multierror.Append(&mErr, err)
		}
	}

	for _, wid := range t.Identities {

View on GitHub (pinned to 482b49bf1a)

Solutions

  1. Remove the `network` stanza from the task's resources block.
  2. Declare ports in the group-level `network { port ... {} }` block instead.
  3. Update services/checks to reference the group-level port labels.
  4. Run `nomad job validate` after migration to confirm no warnings remain.

Example fix

// before
task "web" {
  resources {
    network {
      port "http" {}
    }
  }
}
// after
group "web" {
  network {
    port "http" {}
  }
  task "web" {
    resources {
      cpu    = 500
      memory = 256
    }
  }
}
Defensive patterns

Strategy: validation

Validate before calling

// Reject task-level network resources before submit
if len(task.Resources.Networks) > 0 {
  return errors.New("move task network resources to group network block")
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


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