{"record":{"id":"b7e7bfe0db3ce199","repo":"hashicorp/nomad","slug":"job-q-is-in-nonexistent-node-pool-q-b7e7bf","errorCode":null,"errorMessage":"job %q is in nonexistent node pool %q","messagePattern":"job %q is in nonexistent node pool %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/state/state_store.go","lineNumber":1818,"sourceCode":"\n// upsertJobImpl is the implementation for registering a job or updating a job definition\nfunc (s *StateStore) upsertJobImpl(index uint64, sub *structs.JobSubmission, job *structs.Job, keepVersion bool, txn *txn, req *structs.JobRegisterRequest) error {\n\t// Assert the namespace exists\n\tif exists, err := s.namespaceExists(txn, job.Namespace); err != nil {\n\t\treturn err\n\t} else if !exists {\n\t\treturn fmt.Errorf(\"job %q is in nonexistent namespace %q\", job.ID, job.Namespace)\n\t}\n\n\t// Upgrade path.\n\t// Assert the node pool is set and exists.\n\tif job.NodePool == \"\" {\n\t\tjob.NodePool = structs.NodePoolDefault\n\t}\n\tif exists, err := s.nodePoolExists(txn, job.NodePool); err != nil {\n\t\treturn err\n\t} else if !exists {\n\t\treturn fmt.Errorf(\"job %q is in nonexistent node pool %q\", job.ID, job.NodePool)\n\t}\n\n\t// Check if the job already exists\n\texisting, err := txn.First(\"jobs\", \"id\", job.Namespace, job.ID)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"job lookup failed: %v\", err)\n\t}\n\n\tvar existingJob *structs.Job\n\tif existing != nil {\n\t\texistingJob = existing.(*structs.Job)\n\t}\n\n\tif req != nil && req.EnforceIndex {\n\t\tif err := existingJob.EnforceIndex(req.JobModifyIndex); err != nil {\n\t\t\treturn err\n\t\t}\n\t}","sourceCodeStart":1800,"sourceCodeEnd":1836,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/state/state_store.go#L1800-L1836","documentation":"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.","triggerScenarios":"Thrown at nomad/state/state_store.go:1818 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Create the node pool first (`nomad node pool apply`)","Set the job's node_pool to an existing pool such as `default`","Check for typos in the node pool name"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}