{"record":{"id":"5207c3198bc39df0","repo":"hashicorp/nomad","slug":"unable-to-update-job-submission-v","errorCode":null,"errorMessage":"unable to update job submission: %v","messagePattern":"unable to update job submission: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/state/state_store.go","lineNumber":1904,"sourceCode":"\n\tif err := s.upsertJobVersion(index, job, txn); err != nil {\n\t\treturn fmt.Errorf(\"unable to upsert job into job_version table: %v\", err)\n\t}\n\n\tif err := s.updateJobScalingPolicies(index, job, txn); err != nil {\n\t\treturn fmt.Errorf(\"unable to update job scaling policies: %v\", err)\n\t}\n\n\tif err := s.updateJobRecommendations(index, txn, existingJob, job); err != nil {\n\t\treturn fmt.Errorf(\"unable to update job recommendations: %v\", err)\n\t}\n\n\tif err := s.updateJobCSIPlugins(index, job, existingJob, txn); err != nil {\n\t\treturn fmt.Errorf(\"unable to update job csi plugins: %v\", err)\n\t}\n\n\tif err := s.updateJobSubmission(index, sub, job.Namespace, job.ID, job.Version, txn); err != nil {\n\t\treturn fmt.Errorf(\"unable to update job submission: %v\", err)\n\t}\n\n\tif err := s.updatePreservedValues(job, existingJob, req); err != nil {\n\t\treturn fmt.Errorf(\"unable to update preserved values: %v\", err)\n\t}\n\n\t// Insert the job\n\tif err := txn.Insert(\"jobs\", job); err != nil {\n\t\treturn fmt.Errorf(\"job insert failed: %v\", err)\n\t}\n\tif err := txn.Insert(\"index\", &IndexEntry{\"jobs\", index}); err != nil {\n\t\treturn fmt.Errorf(\"index update failed: %v\", err)\n\t}\n\n\treturn nil\n}\n\n// CheckIdempotencyToken finds all children of the parent job ID and checks to","sourceCodeStart":1886,"sourceCodeEnd":1922,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/state/state_store.go#L1886-L1922","documentation":"UpsertJob failed while persisting the job's submission metadata (original HCL/variables) via updateJobSubmission into the job_submission table, used for jobs submitted with HCL2 variable files so the source can be audited later. The failure aborts the registration transaction.","triggerScenarios":"Registering a job that includes JobSubmission data (submitted via API with the submission field) where the job_submission table write fails in-transaction.","commonSituations":"Clusters on Nomad 1.1+ using 'nomad job run' with variables where state store inconsistencies or upgrade migrations break the job_submission table.","solutions":["Check the wrapped cause in server logs","Retry the job submission","Re-submit the job without the submission payload if that unblocks you (loses source-audit history for that version)","Upgrade Nomad if reproducible"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// Ensure submission payload is set consistently when submitting with variables\n// (CLI does this automatically; API callers must populate it or omit it)\nif jobSource != \"\" && job.Submission == nil {\n  return fmt.Errorf(\"submission source provided without JobSubmission payload\")\n}","typeGuard":"func isJobSubmissionError(err error) bool {\n  return err != nil && strings.Contains(err.Error(), \"job submission\")\n}","tryCatchPattern":"_, err := client.Jobs().Register(job, nil, nil, nil)\nif isJobSubmissionError(err) {\n  // retry; optionally re-submit without the Submission field to unblock\n  job.Submission = nil\n  _, err = client.Jobs().Register(job, nil, nil, nil)\n}\nreturn err","preventionTips":["Use 'nomad job run' which populates submission metadata correctly","Keep servers on Nomad >=1.1 when relying on job submission history","Retry submissions after transient state-store failures","Accept that dropping the Submission field loses HCL source audit"],"tags":["nomad","state-store","job-submission"],"backgroundTag":"job-submission-write-failed","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"}