hashicorp/nomad · error
only one 'region_limit' block allowed per limit
Error message
only one 'region_limit' block allowed per limit
What it means
Returned by parseQuotaResource while parsing an HCL quota limit: more than one region_limit block appeared inside a single limit, but the schema allows at most one.
Source
Thrown at command/quota_apply.go:255
if err := parseQuotaResource(limit.RegionLimit, o); err != nil {
return multierror.Prefix(err, "region_limit ->")
}
}
*result = append(*result, &limit)
}
return nil
}
// parseQuotaResource parses the region_limit resources
func parseQuotaResource(result *api.QuotaResources, list *ast.ObjectList) error {
list = list.Elem()
if len(list.Items) == 0 {
return nil
}
if len(list.Items) > 1 {
return fmt.Errorf("only one 'region_limit' block allowed per limit")
}
// Get our resource object
o := list.Items[0]
// We need this later
var listVal *ast.ObjectList
if ot, ok := o.Val.(*ast.ObjectType); ok {
listVal = ot.List
} else {
return fmt.Errorf("resource: should be an object")
}
// Check for invalid keys
valid := []string{
"cores",
"cpu",
"memory",View on GitHub (pinned to 482b49bf1a)
Solutions
- Keep only one region_limit per limit block; delete the duplicate.
- If you need different resource caps per region, use separate `limit` blocks, each with its own region and region_limit.
- Run `nomad quota apply -parse-only` to validate before applying.
Example fix
// before
limit {
region = "global"
region_limit { cpu = 100 }
region_limit { memory_mb = 512 }
}
// after
limit {
region = "global"
region_limit { cpu = 100 memory_mb = 512 }
} Defensive patterns
Strategy: validation
Validate before calling
const count = (hclBlock.match(/region_limit\s*\{/g) || []).length;
if (count > 1) throw new Error('only one region_limit allowed per limit block; split into separate limit blocks'); Prevention
- One region_limit per limit block; merge resource keys into a single block.
- Use separate limit blocks for per-region caps.
- Add a lint check counting region_limit occurrences per limit.
When it happens
Trigger: Declaring `region_limit` twice inside a single `limit` block in the quota HCL file.
Common situations: Merging quota files or copy-pasting limits where a second region_limit block was left behind; combining region-specific limits into one block instead of separate limit blocks.
Related errors
- error parsing: root should be an object
- limit should be an object
- resource: should be an object
- invalid variables limit: %v
- invalid host_volumes limit: %v
AI-assisted analysis of hashicorp/nomad@482b49bf1a (2026-09-04).
Data as JSON: /api/errors/9cf43357fbcf4fcb.
Report an issue: GitHub.