{"record":{"id":"6ea0f8c3cf550bfb","repo":"hashicorp/nomad","slug":"csi-volumes-lookup-failed-v","errorCode":null,"errorMessage":"csi_volumes lookup failed: %v","messagePattern":"csi_volumes lookup failed: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/state/state_store.go","lineNumber":2709,"sourceCode":"\t\t}\n\t}\n\n\tif err := txn.Insert(\"index\", &IndexEntry{TableCSIVolumes, index}); err != nil {\n\t\treturn fmt.Errorf(\"index update failed: %v\", err)\n\t}\n\n\treturn txn.Commit()\n}\n\n// CSIVolumes returns the unfiltered list of all volumes. Caller should\n// snapshot if it wants to also denormalize the plugins.\nfunc (s *StateStore) CSIVolumes(ws memdb.WatchSet) (memdb.ResultIterator, error) {\n\ttxn := s.db.ReadTxn()\n\tdefer txn.Abort()\n\n\titer, err := txn.Get(TableCSIVolumes, \"id\")\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"csi_volumes lookup failed: %v\", err)\n\t}\n\n\tws.Add(iter.WatchCh())\n\n\treturn iter, nil\n}\n\n// CSIVolumeByID is used to lookup a single volume. Returns a copy of the\n// volume because its plugins and allocations are denormalized to provide\n// accurate Health.\nfunc (s *StateStore) CSIVolumeByID(ws memdb.WatchSet, namespace, id string) (*structs.CSIVolume, error) {\n\ttxn := s.db.ReadTxn()\n\n\twatchCh, obj, err := txn.FirstWatch(TableCSIVolumes, \"id\", namespace, id)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"volume lookup failed for %s: %v\", id, err)\n\t}\n\tws.Add(watchCh)","sourceCodeStart":2691,"sourceCodeEnd":2727,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/state/state_store.go#L2691-L2727","documentation":"Returned by StateStore.CSIVolumes when the read transaction's txn.Get(TableCSIVolumes, \"id\") fails. This is a read-side iterator creation failure inside go-memdb — normally it means the index name is not in the table schema or the read transaction is invalid. It does NOT mean no volumes exist; an empty table returns a valid empty iterator.","triggerScenarios":"Calling CSIVolumes (used by the CSI volume List API / nomad volume status command) while memdb cannot construct the \"id\" index iterator, e.g. schema mismatch or a corrupted read txn.","commonSituations":"Patched table schemas in forks; binary/state incompatibility after an in-place upgrade; extremely rare memdb internal failures.","solutions":["Read the wrapped %v message to see the memdb error","Restart the server to rebuild state from the raft log","Confirm the running binary matches the official Nomad schema (no schema overrides)","If persistent, capture nomad operator debug output and file a Nomad issue"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"vols, _, err := api.CSIVolumes()\nif err != nil && strings.Contains(err.Error(), \"csi_volumes lookup failed\") {\n    // state store read failure: restart server or fail over to another server\n}","preventionTips":["Run multiple Nomad servers for read failover","Avoid in-place major-version upgrades without snapshot round-trip","Watch server logs for early memdb warnings","Use official Nomad builds only"],"tags":["state-store","memdb","csi","read-txn","nomad"],"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"}