hashicorp/nomad · error
Region not found
Error message
Region not found
What it means
`nomad deployment status` for a multiregion job resolves each region's deployment by fetching deployments for the job in that region. fetchRegionDeployment returns this error when the region record passed in is nil, i.e. the expected region entry is missing from the multiregion block.
Source
Thrown at command/deployment_status.go:630
requests <- regionResult{d: d, err: err, region: region.Name}
}(i)
}
for i := 0; i < cap(requests); i++ {
res := <-requests
if res.err != nil {
key := fmt.Sprintf("%s (error)", res.region)
results[key] = &api.Deployment{}
continue
}
results[res.region] = res.d
}
return results, nil
}
func fetchRegionDeployment(c *api.Client, d *api.Deployment, region *api.MultiregionRegion) (*api.Deployment, error) {
if region == nil {
return nil, errors.New("Region not found")
}
opts := &api.QueryOptions{Region: region.Name}
deploys, _, err := c.Jobs().Deployments(d.JobID, false, opts)
if err != nil {
return nil, fmt.Errorf("Error fetching deployments for job %s: %v", d.JobID, err)
}
for _, dep := range deploys {
if dep.JobVersion == d.JobVersion {
return dep, nil
}
}
return nil, fmt.Errorf("Could not find job version %d for region", d.JobVersion)
}
func formatMultiregionDeployment(regions map[string]*api.Deployment, uuidLength int) string {
rowString := "Region|ID|Status"
rows := make([]string, len(regions)+1)View on GitHub (pinned to 482b49bf1a)
Solutions
- Verify all regions in the job's multiregion block exist: `nomad server members` / check region configuration.
- Resubmit or correct the job spec so each listed region is a registered, reachable Nomad region.
- Inspect the deployment with `nomad deployment list` in each target region to confirm state; contact support if state appears corrupt.
Example fix
// before // job multiregion references region "eu" but no servers run in region eu // after // either add servers with region = "eu" or remove/update the region in the job multiregion block, then redeploy
Defensive patterns
Strategy: validation
Validate before calling
dep, _, err := client.Deployments().Info(deployID, nil)
if err != nil || dep.JobCreateIndex == 0 { return err }
if dep.JobMultiregion != nil {
for _, r := range dep.JobMultiregion.Regions {
if r == nil || r.Name == "" { return errors.New("missing region in multiregion job") }
}
} Type guard
func regionIsValid(r *api.MultiregionRegion) bool { return r != nil && r.Name != "" } Try / catch
if err := deploymentStatus(); err != nil && strings.Contains(err.Error(), "Region not found") {
// verify multiregion job spec and region servers before retry
} Prevention
- Keep all regions listed in a job's multiregion block actually running servers.
- Avoid renaming/removing regions referenced by active multiregion deployments.
- Audit multiregion job specs with `nomad job inspect` after infra changes.
When it happens
Trigger: Running `nomad deployment status <id>` on a multiregion deployment whose region list is incomplete/corrupt, so a nil region pointer is handed to fetchRegionDeployment.
Common situations: Multiregion jobs whose region was removed or renamed after submission, partial cluster state replication, or jobs submitted before a region came online.
Related errors
- Could not find job version %d for region
- Error querying latest job deployment: %s
- not a terminal
- both -n and -c set
- Allocation %q is running the following tasks: * %s Please
AI-assisted analysis of hashicorp/nomad@482b49bf1a (2026-09-04).
Data as JSON: /api/errors/86951b55e36585a5.
Report an issue: GitHub.