{"record":{"id":"cad44fc178a22f64","repo":"hashicorp/nomad","slug":"launch-lookup-failed-v","errorCode":null,"errorMessage":"launch lookup failed: %v","messagePattern":"launch lookup failed: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/state/state_store.go","lineNumber":3388,"sourceCode":"// DeletePeriodicLaunch is used to delete the periodic launch\nfunc (s *StateStore) DeletePeriodicLaunch(index uint64, namespace, jobID string) error {\n\ttxn := s.db.WriteTxn(index)\n\tdefer txn.Abort()\n\n\terr := s.DeletePeriodicLaunchTxn(index, namespace, jobID, txn)\n\tif err == nil {\n\t\treturn txn.Commit()\n\t}\n\treturn err\n}\n\n// DeletePeriodicLaunchTxn is used to delete the periodic launch, like DeletePeriodicLaunch\n// but in a transaction.  Useful for when making multiple modifications atomically\nfunc (s *StateStore) DeletePeriodicLaunchTxn(index uint64, namespace, jobID string, txn Txn) error {\n\t// Lookup the launch\n\texisting, err := txn.First(\"periodic_launch\", \"id\", namespace, jobID)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"launch lookup failed: %v\", err)\n\t}\n\tif existing == nil {\n\t\treturn fmt.Errorf(\"launch not found\")\n\t}\n\n\t// Delete the launch\n\tif err := txn.Delete(\"periodic_launch\", existing); err != nil {\n\t\treturn fmt.Errorf(\"launch delete failed: %v\", err)\n\t}\n\tif err := txn.Insert(\"index\", &IndexEntry{\"periodic_launch\", index}); err != nil {\n\t\treturn fmt.Errorf(\"index update failed: %v\", err)\n\t}\n\n\treturn nil\n}\n\n// PeriodicLaunchByID is used to lookup a periodic launch by the periodic job\n// ID.","sourceCodeStart":3370,"sourceCodeEnd":3406,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/state/state_store.go#L3370-L3406","documentation":"Returned by StateStore.DeletePeriodicLaunchTxn when txn.First on the 'periodic_launch' table fails with an internal error while looking up the launch by (namespace, jobID). This is not 'not found' — that is a separate error — it means the memdb lookup itself errored (e.g. schema/index mismatch).","triggerScenarios":"Calling DeletePeriodicLaunch or DeletePeriodicLaunchTxn for a job when the underlying memdb read of table 'periodic_launch' via the 'id' index returns an error instead of nil/row.","commonSituations":"State store schema/index mismatch after a version upgrade; corrupted in-memory DB; tests constructing a txn with the wrong table definitions.","solutions":["Inspect the wrapped inner error in the message for the memdb cause","Verify the nomad binary version matches the state schema version (upgrade mismatch) and restart agents on the same version","If persistent, restart the server to rebuild in-memory state from the raft/snapshot","Report to nomad with the inner error if it recurs on a healthy cluster"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Verify the launch exists before deleting\nlaunch, err := state.PeriodicLaunchByID(ws, ns, jobID)\nif err != nil { return err }\nif launch == nil { return nil // nothing to delete }","typeGuard":"if l, ok := raw.(*structs.PeriodicLaunch); ok { /* use l */ }","tryCatchPattern":"if err := state.DeletePeriodicLaunch(idx, ns, jobID); err != nil {\n\tif strings.Contains(err.Error(), \"launch lookup failed\") {\n\t\t// memdb read error: log inner cause, do not treat as missing\n\t}\n\treturn err\n}","preventionTips":["Distinguish lookup-error from not-found before retrying","Rebuild state (restart servers) if read errors persist","Avoid custom txns against the live memdb"],"tags":["nomad","memdb","state-store","lookup"],"backgroundTag":"memdb-lookup-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"}