{"record":{"id":"1d7f58cc627d9d44","repo":"hashicorp/nomad","slug":"volume-existence-check-error-v","errorCode":null,"errorMessage":"volume existence check error: %v","messagePattern":"volume existence check error: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/state/state_store.go","lineNumber":2661,"sourceCode":"\n\treturn iter, nil\n}\n\n// UpsertCSIVolume inserts a volume in the state store.\nfunc (s *StateStore) UpsertCSIVolume(index uint64, volumes []*structs.CSIVolume) error {\n\ttxn := s.db.WriteTxnMsgT(structs.CSIVolumeRegisterRequestType, index)\n\tdefer txn.Abort()\n\n\tfor _, v := range volumes {\n\t\tif exists, err := s.namespaceExists(txn, v.Namespace); err != nil {\n\t\t\treturn err\n\t\t} else if !exists {\n\t\t\treturn fmt.Errorf(\"volume %s is in nonexistent namespace %s\", v.ID, v.Namespace)\n\t\t}\n\n\t\tobj, err := txn.First(TableCSIVolumes, \"id\", v.Namespace, v.ID)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"volume existence check error: %v\", err)\n\t\t}\n\t\tif obj != nil {\n\t\t\t// Allow some properties of a volume to be updated in place, but\n\t\t\t// prevent accidentally overwriting important properties.\n\t\t\told := obj.(*structs.CSIVolume)\n\t\t\tif old.ExternalID != v.ExternalID ||\n\t\t\t\told.PluginID != v.PluginID ||\n\t\t\t\told.Provider != v.Provider {\n\t\t\t\treturn fmt.Errorf(\"volume identity cannot be updated: %s\", v.ID)\n\t\t\t}\n\t\t} else {\n\t\t\tv.CreateIndex = index\n\t\t}\n\t\tv.ModifyIndex = index\n\n\t\t// Allocations are copy on write, so we want to keep the Allocation ID\n\t\t// but we need to clear the pointer so that we don't store it when we\n\t\t// write the volume to the state store. We'll get it from the db in","sourceCodeStart":2643,"sourceCodeEnd":2679,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/state/state_store.go#L2643-L2679","documentation":"While registering CSI volumes, the store checks whether the volume already exists with txn.First on the csi_volumes table. If that internal lookup returns an error (as opposed to just nil), registration is aborted with this wrapped error. It indicates a state store query failure, not a duplicate-volume condition (which is handled separately).","triggerScenarios":"CSIVolumeRegister/CSIVolumeCreate path where txn.First(TableCSIVolumes, \"id\", namespace, id) errors during existence checking.","commonSituations":"Rare memdb/txn failures on servers; usually transient and seen in server logs during volume registration.","solutions":["Check the wrapped %v underlying error","Retry the volume registration","If persistent, inspect server state store health and report to Nomad"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"_, err := client.CSIVolumes().Register(vol, nil, nil)\nif err != nil && strings.Contains(err.Error(), \"volume existence check error\") {\n  time.Sleep(backoff)\n  return retry() // transient query failure, safe to retry\n}","preventionTips":["Retry volume registration on transient failures","Check Nomad server logs if persistent","Verify plugin/controller health before registering"],"tags":["nomad","csi","volume","state-store"],"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"}