hashicorp/nomad · error
job type cannot be core
Error message
job type cannot be core
What it means
The 'core' job type is reserved for Nomad's internal system jobs (e.g. garbage collection, evaluation machinery). Submitting a job with type = "core" via the API is rejected because user submissions must be service, batch, or system.
Source
Thrown at nomad/job_endpoint_hooks.go:511
multierror.Append(validationErrors, err)
}
// Get any warnings
jobWarnings := job.Warnings()
if jobWarnings != nil {
if multi, ok := jobWarnings.(*multierror.Error); ok {
// Unpack multiple warnings
warnings = append(warnings, multi.Errors...)
} else {
warnings = append(warnings, jobWarnings)
}
}
// TODO: Validate the driver configurations. These had to be removed in 0.9
// to support driver plugins, but see issue: #XXXX for more info.
if job.Type == structs.JobTypeCore {
multierror.Append(validationErrors, fmt.Errorf("job type cannot be core"))
}
if len(job.Payload) != 0 {
multierror.Append(validationErrors, fmt.Errorf("job can't be submitted with a payload, only dispatched"))
}
if job.Priority < structs.JobMinPriority || job.Priority > v.srv.config.JobMaxPriority {
multierror.Append(validationErrors, fmt.Errorf("job priority must be between [%d, %d]", structs.JobMinPriority, v.srv.config.JobMaxPriority))
}
okForIdentity := v.isEligibleForMultiIdentity()
totalCount := 0
for _, tg := range job.TaskGroups {
totalCount += tg.Count
for _, s := range tg.Services {
serviceErrs := v.validateServiceIdentity(View on GitHub (pinned to 482b49bf1a)
Solutions
- Change the job's type field to "service", "batch", or "system"
- If submitting JSON, ensure the "Type" key is one of the allowed user job types
Example fix
// before
job "myapp" { type = "core" }
// after
job "myapp" { type = "service" } Defensive patterns
Strategy: validation
Validate before calling
if job.Type == "core" {
return errors.New("type must be service, batch, or system")
} Type guard
func userSubmittableType(t string) bool {
switch t { case "service", "batch", "system": return true }
return false
} Prevention
- Never hardcode type; use an explicit constant/enum in generators
- Reject "core" in job-spec linting pre-submit
When it happens
Trigger: POSTing/validating a job whose top-level type field equals "core".
Common situations: Copy-pasting an internal job spec from logs or docs; generating job JSON programmatically and defaulting type to core; typos leaving type unset then hardcoded incorrectly.
Related errors
- Disconnect cannot be configured with both lost_after and sto
- lost_after cannot be a negative duration
- stop_after cannot be a negative duration
- Missing job ID
- Job ID contains a space
AI-assisted analysis of hashicorp/nomad@482b49bf1a (2026-09-04).
Data as JSON: /api/errors/676007a53f991b58.
Report an issue: GitHub.