{"record":{"id":"5f1c2021d165df92","repo":"hashicorp/nomad","slug":"csi-plugins-insert-error-v","errorCode":null,"errorMessage":"csi_plugins insert error: %v","messagePattern":"csi_plugins insert error: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/state/state_store.go","lineNumber":1446,"sourceCode":"\t\t\tplug = structs.NewCSIPlugin(info.PluginID, index)\n\t\t}\n\n\t\t// the plugin may have been created by the job being updated, in which case\n\t\t// this data will not be configured, it's only available to the fingerprint\n\t\t// system\n\t\tplug.Provider = info.Provider\n\t\tplug.Version = info.ProviderVersion\n\n\t\terr = plug.AddPlugin(node.ID, info)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tplug.ModifyIndex = index\n\n\t\terr = txn.Insert(TableCSIPlugins, plug)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"csi_plugins insert error: %v\", err)\n\t\t}\n\n\t\treturn nil\n\t}\n\n\tinUseController := map[string]struct{}{}\n\tinUseNode := map[string]struct{}{}\n\n\tfor _, info := range node.CSIControllerPlugins {\n\t\terr := upsertFn(info)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tinUseController[info.PluginID] = struct{}{}\n\t}\n\n\tfor _, info := range node.CSINodePlugins {\n\t\terr := upsertFn(info)","sourceCodeStart":1428,"sourceCodeEnd":1464,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/state/state_store.go#L1428-L1464","documentation":"Wraps a memdb Insert failure when writing (creating or updating) a structs.CSIPlugin row during node registration in the state store. The transaction cannot persist the plugin record, so the whole node-upsert transaction rolls back and the Raft write fails.","triggerScenarios":"upsertCSIPluginsForNode inserting a new or modified CSIPlugin via txn.Insert(TableCSIPlugins, plug); fails on transaction invariants (e.g. inserting after an error) or internal memdb faults.","commonSituations":"Appears in server logs when a node registers with CSI plugins and the state write fails; usually tied to server-side resource/memory issues or Nomad bugs rather than operator config.","solutions":["Retry the node registration; Raft-backed writes commonly succeed on retry after transient failure.","Inspect the wrapped %v error for the underlying memdb reason and address that root cause.","Ensure sufficient server memory; large plugin tables plus state churn can surface allocator failures.","Upgrade Nomad to a release with CSI state-store fixes if reproducible."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"if err != nil && strings.Contains(err.Error(), \"csi_plugins insert error\") {\n    time.Sleep(backoff)\n    return retryNodeRegister(node)\n}","preventionTips":["Provision adequate memory on Nomad servers.","Keep CSI plugin task definitions minimal and healthy.","Patch Nomad promptly; CSI code churns across releases.","Alert on failed Raft writes in server logs."],"tags":["nomad","csi","state-store","memdb"],"backgroundTag":"csi-plugin-registration-failure","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"}