{"record":{"id":"676007a53f991b58","repo":"hashicorp/nomad","slug":"job-type-cannot-be-core","errorCode":null,"errorMessage":"job type cannot be core","messagePattern":"job type cannot be core","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/job_endpoint_hooks.go","lineNumber":511,"sourceCode":"\t\tmultierror.Append(validationErrors, err)\n\t}\n\n\t// Get any warnings\n\tjobWarnings := job.Warnings()\n\tif jobWarnings != nil {\n\t\tif multi, ok := jobWarnings.(*multierror.Error); ok {\n\t\t\t// Unpack multiple warnings\n\t\t\twarnings = append(warnings, multi.Errors...)\n\t\t} else {\n\t\t\twarnings = append(warnings, jobWarnings)\n\t\t}\n\t}\n\n\t// TODO: Validate the driver configurations. These had to be removed in 0.9\n\t//       to support driver plugins, but see issue: #XXXX for more info.\n\n\tif job.Type == structs.JobTypeCore {\n\t\tmultierror.Append(validationErrors, fmt.Errorf(\"job type cannot be core\"))\n\t}\n\n\tif len(job.Payload) != 0 {\n\t\tmultierror.Append(validationErrors, fmt.Errorf(\"job can't be submitted with a payload, only dispatched\"))\n\t}\n\n\tif job.Priority < structs.JobMinPriority || job.Priority > v.srv.config.JobMaxPriority {\n\t\tmultierror.Append(validationErrors, fmt.Errorf(\"job priority must be between [%d, %d]\", structs.JobMinPriority, v.srv.config.JobMaxPriority))\n\t}\n\n\tokForIdentity := v.isEligibleForMultiIdentity()\n\n\ttotalCount := 0\n\tfor _, tg := range job.TaskGroups {\n\t\ttotalCount += tg.Count\n\n\t\tfor _, s := range tg.Services {\n\t\t\tserviceErrs := v.validateServiceIdentity(","sourceCodeStart":493,"sourceCodeEnd":529,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/job_endpoint_hooks.go#L493-L529","documentation":"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.","triggerScenarios":"POSTing/validating a job whose top-level type field equals \"core\".","commonSituations":"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.","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"],"exampleFix":"// before\njob \"myapp\" { type = \"core\" }\n// after\njob \"myapp\" { type = \"service\" }","handlingStrategy":"validation","validationCode":"if job.Type == \"core\" {\n\treturn errors.New(\"type must be service, batch, or system\")\n}","typeGuard":"func userSubmittableType(t string) bool {\n\tswitch t { case \"service\", \"batch\", \"system\": return true }\n\treturn false\n}","tryCatchPattern":null,"preventionTips":["Never hardcode type; use an explicit constant/enum in generators","Reject \"core\" in job-spec linting pre-submit"],"tags":["nomad","job-spec","validation"],"backgroundTag":"invalid-job-type","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"}