hashicorp/nomad · error

job %q is in nonexistent node pool %q

Error message

job %q is in nonexistent node pool %q

What it means

upsertJobImpl refused to register the job because the job's node pool does not exist in the state store; after defaulting an empty pool to `default`, the referenced pool must already be created.

Source

Thrown at nomad/state/state_store.go:1818

// upsertJobImpl is the implementation for registering a job or updating a job definition
func (s *StateStore) upsertJobImpl(index uint64, sub *structs.JobSubmission, job *structs.Job, keepVersion bool, txn *txn, req *structs.JobRegisterRequest) error {
	// Assert the namespace exists
	if exists, err := s.namespaceExists(txn, job.Namespace); err != nil {
		return err
	} else if !exists {
		return fmt.Errorf("job %q is in nonexistent namespace %q", job.ID, job.Namespace)
	}

	// Upgrade path.
	// Assert the node pool is set and exists.
	if job.NodePool == "" {
		job.NodePool = structs.NodePoolDefault
	}
	if exists, err := s.nodePoolExists(txn, job.NodePool); err != nil {
		return err
	} else if !exists {
		return fmt.Errorf("job %q is in nonexistent node pool %q", job.ID, job.NodePool)
	}

	// Check if the job already exists
	existing, err := txn.First("jobs", "id", job.Namespace, job.ID)
	if err != nil {
		return fmt.Errorf("job lookup failed: %v", err)
	}

	var existingJob *structs.Job
	if existing != nil {
		existingJob = existing.(*structs.Job)
	}

	if req != nil && req.EnforceIndex {
		if err := existingJob.EnforceIndex(req.JobModifyIndex); err != nil {
			return err
		}
	}

View on GitHub (pinned to 482b49bf1a)

Solutions

  1. Create the node pool first (`nomad node pool apply`)
  2. Set the job's node_pool to an existing pool such as `default`
  3. Check for typos in the node pool name
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at nomad/state/state_store.go:1818 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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