{"record":{"id":"0d67d28e972aa9f5","repo":"hashicorp/nomad","slug":"job-submissions-lookup-failed-v","errorCode":null,"errorMessage":"job submissions lookup failed: %v","messagePattern":"job submissions lookup failed: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/state/state_store.go","lineNumber":2298,"sourceCode":"\t// Delete the oldest one\n\td := all[max]\n\tif err := txn.Delete(\"job_version\", d); err != nil {\n\t\treturn fmt.Errorf(\"failed to delete job %v (%d) from job_version\", d.ID, d.Version)\n\t}\n\n\treturn nil\n}\n\n// GetJobSubmissions returns an iterator that contains all job submissions\n// stored within state. This is not currently exposed via RPC and is only used\n// for snapshot persist and restore functionality.\nfunc (s *StateStore) GetJobSubmissions(ws memdb.WatchSet) (memdb.ResultIterator, error) {\n\ttxn := s.db.ReadTxn()\n\n\t// Walk the entire table to get all job submissions.\n\titer, err := txn.Get(TableJobSubmission, indexID)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"job submissions lookup failed: %v\", err)\n\t}\n\tws.Add(iter.WatchCh())\n\n\treturn iter, nil\n}\n\n// JobSubmission returns the original HCL/Variables context of a job, if available.\n//\n// Note: it is a normal case for the submission context to be unavailable, in which case\n// nil is returned with no error.\nfunc (s *StateStore) JobSubmission(ws memdb.WatchSet, namespace, jobName string, version uint64) (*structs.JobSubmission, error) {\n\ttxn := s.db.ReadTxn()\n\treturn s.jobSubmission(ws, namespace, jobName, version, txn)\n}\n\nfunc (s *StateStore) jobSubmission(ws memdb.WatchSet, namespace, jobName string, version uint64, txn Txn) (*structs.JobSubmission, error) {\n\twatchCh, existing, err := txn.FirstWatch(\"job_submission\", \"id\", namespace, jobName, version)\n\tif err != nil {","sourceCodeStart":2280,"sourceCodeEnd":2316,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/state/state_store.go#L2280-L2316","documentation":"GetJobSubmissions lists all job_submission table entries (HCL/spec submissions attached to job versions). The error wraps a failure from txn.Get on the job_submission table with the id index, meaning the table lookup itself failed rather than returning an iterator.","triggerScenarios":"Calling StateStore.GetJobSubmissions (or the JobSubmissionsList RPC) when the memdb lookup on TableJobSubmission/indexID fails, e.g. invalid index name or txn error.","commonSituations":"Rare internal errors; usually only encountered by developers extending Nomad's state store or during corrupted indexes.","solutions":["Check the wrapped %v cause for the memdb error","Retry the request; read txns are lightweight and the failure is usually transient","If persistent, verify state store integrity and file a Nomad issue"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":"func isLookupErr(err error) bool { return err != nil && strings.Contains(err.Error(), \"job submissions lookup failed\") }","tryCatchPattern":"iter, err := client.Jobs().Submissions(...)\nif err != nil {\n  log.Printf(\"submission list unavailable: %v\", err) // inspect wrapped cause\n  return fallbackResult\n}","preventionTips":["Handle nil/empty submission lists gracefully","Retry transient failures","Monitor Nomad server health"],"tags":["nomad","state-store","job-submissions"],"backgroundTag":"state-store-read-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"}