{"record":{"id":"48cd722a4af18294","repo":"hashicorp/nomad","slug":"unable-to-update-preserved-values-v","errorCode":null,"errorMessage":"unable to update preserved values: %v","messagePattern":"unable to update preserved values: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/state/state_store.go","lineNumber":1908,"sourceCode":"\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\n// make sure none of them were dispatched with the idempotency token passed as\n// an argument. Returns the child job found, if any.\nfunc (s *StateStore) CheckIdempotencyToken(ns, parentID, idempotencyToken string) (*structs.Job, error) {\n\titer, err := s.JobsByIDPrefix(nil, ns, parentID, SortDefault)","sourceCodeStart":1890,"sourceCodeEnd":1926,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/state/state_store.go#L1890-L1926","documentation":"UpsertJob failed in updatePreservedValues, which copies multiregion/preserved fields (e.g. multiregion run settings, submit time/flags) from the existing job and request into the new job object before insertion. The wrapped error aborts the registration transaction.","triggerScenarios":"Registering a job where preserving values from the existing job or request fails, typically tied to multiregion deployments or malformed request fields on the update path.","commonSituations":"Multiregion enterprise deployments, or federated clusters where the previous job copy is inconsistent during region failover.","solutions":["Read the wrapped cause in server logs","Retry the job registration","Verify multiregion/authorization fields in the request (multiregion tokens/authorization) are set correctly","Upgrade Nomad if reproducible on your version"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Verify multiregion fields are complete before regional registration\nif job.Multiregion != nil {\n  for _, r := range job.Multiregion.Regions {\n    if r.Region == \"\" || len(r.Datacenters) == 0 {\n      return fmt.Errorf(\"multiregion region entry missing region or datacenters\")\n    }\n  }\n}","typeGuard":"func isPreservedValuesError(err error) bool {\n  return err != nil && strings.Contains(err.Error(), \"preserved values\")\n}","tryCatchPattern":"_, err := client.Jobs().Register(job, nil, nil, nil)\nif isPreservedValuesError(err) {\n  // check multiregion authorization and retry\n  _, err = client.Jobs().Register(job, nil, nil, nil)\n}\nreturn err","preventionTips":["Send identical multiregion job specs to every region","Ensure multiregion authorization tokens are valid when cross-registering","Verify the existing job copy is readable (Jobs().Info) before updating","Keep federated servers on consistent versions"],"tags":["nomad","state-store","multiregion"],"backgroundTag":"preserved-values-update-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"}