{"record":{"id":"3d41681d94840e10","repo":"hashicorp/nomad","slug":"periodic-launch-lookup-failed-v","errorCode":null,"errorMessage":"periodic launch lookup failed: %v","messagePattern":"periodic launch lookup failed: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/state/state_store.go","lineNumber":3347,"sourceCode":"\t\treturn structs.ErrCSIPluginInUse\n\t}\n\n\terr = txn.Delete(TableCSIPlugins, plug)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"csi_plugins delete error: %v\", err)\n\t}\n\treturn txn.Commit()\n}\n\n// UpsertPeriodicLaunch is used to register a launch or update it.\nfunc (s *StateStore) UpsertPeriodicLaunch(index uint64, launch *structs.PeriodicLaunch) error {\n\ttxn := s.db.WriteTxn(index)\n\tdefer txn.Abort()\n\n\t// Check if the job already exists\n\texisting, err := txn.First(\"periodic_launch\", \"id\", launch.Namespace, launch.ID)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"periodic launch lookup failed: %v\", err)\n\t}\n\n\t// Setup the indexes correctly\n\tif existing != nil {\n\t\tlaunch.CreateIndex = existing.(*structs.PeriodicLaunch).CreateIndex\n\t\tlaunch.ModifyIndex = index\n\t} else {\n\t\tlaunch.CreateIndex = index\n\t\tlaunch.ModifyIndex = index\n\t}\n\n\t// Insert the job\n\tif err := txn.Insert(\"periodic_launch\", launch); err != nil {\n\t\treturn fmt.Errorf(\"launch insert 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}","sourceCodeStart":3329,"sourceCodeEnd":3365,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/state/state_store.go#L3329-L3365","documentation":"UpsertPeriodicLaunch checks for an existing PeriodicLaunch row (per namespace+ID) with txn.First before writing the new launch record. This error wraps a First failure on the periodic_launch table's \"id\" index. It is an internal memdb error, distinct from simply not finding an existing launch (which returns nil).","triggerScenarios":"Job submission of a periodic job where the leader calls UpsertPeriodicLaunch and txn.First(\"periodic_launch\", \"id\", namespace, id) errors — memdb index/table failure.","commonSituations":"Corrupt state store on the leader, version mismatch after upgrade, or heavy memory pressure corrupting memdb during Raft replay.","solutions":["Read the wrapped error for the underlying memdb cause.","Restart the server agent; leadership will re-establish and rebuild state from Raft.","Align Nomad versions across all servers.","If it persists, run the Raft recovery procedure."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"err := store.UpsertPeriodicLaunch(index, launch)\nif err != nil && strings.Contains(err.Error(), \"periodic launch lookup failed\") {\n    // leadership will retry on the next periodic tick\n    return retry.WithBackoff(3, func() error { return store.UpsertPeriodicLaunch(index, launch) })\n}","preventionTips":["Rely on the periodic runner's next tick to retry failed launches","Restart servers promptly if lookup errors repeat (state rebuild)","Keep Nomad versions consistent across servers","Monitor leader memory pressure"],"tags":["nomad","state-store","periodic-job","lookup-failed"],"backgroundTag":"memdb-index-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"}