{"record":{"id":"cff3a0eddc8d748b","repo":"hashicorp/nomad","slug":"controller-delete-snapshot-v","errorCode":null,"errorMessage":"controller delete snapshot: %v","messagePattern":"controller delete snapshot: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/client_csi_endpoint.go","lineNumber":154,"sourceCode":"\t\t\"ClientCSI.ControllerCreateSnapshot\",\n\t\tstructs.RateMetricWrite,\n\t\targs, reply)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"controller create snapshot: %v\", err)\n\t}\n\treturn nil\n}\n\nfunc (a *ClientCSI) ControllerDeleteSnapshot(args *cstructs.ClientCSIControllerDeleteSnapshotRequest, reply *cstructs.ClientCSIControllerDeleteSnapshotResponse) error {\n\tdefer metrics.MeasureSince([]string{\"nomad\", \"client_csi_controller\", \"delete_snapshot\"}, time.Now())\n\n\terr := a.sendCSIControllerRPC(args.PluginID,\n\t\t\"CSI.ControllerDeleteSnapshot\",\n\t\t\"ClientCSI.ControllerDeleteSnapshot\",\n\t\tstructs.RateMetricWrite,\n\t\targs, reply)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"controller delete snapshot: %v\", err)\n\t}\n\treturn nil\n}\n\nfunc (a *ClientCSI) ControllerListSnapshots(args *cstructs.ClientCSIControllerListSnapshotsRequest, reply *cstructs.ClientCSIControllerListSnapshotsResponse) error {\n\tdefer metrics.MeasureSince([]string{\"nomad\", \"client_csi_controller\", \"list_snapshots\"}, time.Now())\n\n\terr := a.sendCSIControllerRPC(args.PluginID,\n\t\t\"CSI.ControllerListSnapshots\",\n\t\t\"ClientCSI.ControllerListSnapshots\",\n\t\tstructs.RateMetricList,\n\t\targs, reply)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"controller list snapshots: %v\", err)\n\t}\n\treturn nil\n}\n","sourceCodeStart":136,"sourceCodeEnd":172,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/client_csi_endpoint.go#L136-L172","documentation":"Nomad's ClientCSI.ControllerDeleteSnapshot forwards a CSI.ControllerDeleteSnapshot RPC to a controller plugin via sendCSIControllerRPC, wrapping any failure as 'controller delete snapshot: %v'. The snapshot deletion did not reach (or was rejected by) the storage backend.","triggerScenarios":"Calling ControllerDeleteSnapshot (e.g. `nomad volume snapshot delete`) with no healthy controller instance, a stale plugin registration, or when the plugin/driver rejects the delete (snapshot already gone, backend error).","commonSituations":"Controller plugin deregistered or dead; snapshot was already deleted out-of-band causing driver errors; connectivity loss to the client hosting the plugin; driver-specific delete restrictions (clone in use).","solutions":["Verify controller plugin health with `nomad plugin status <pluginID>` and restart its job if needed.","If the snapshot no longer exists in the backend, the delete may have effectively succeeded; force-deregister the snapshot record if Nomad tracks it.","Inspect server and plugin logs for the wrapped root error.","Retry after the plugin re-registers and reports healthy."],"exampleFix":"# before: deleting snapshot with dead controller fails\nnomad volume snapshot delete aws-ebs-controller snap-123\n# after: restart controller, confirm healthy, then delete\nnomad job run aws-ebs-csi-controller.nomad.hcl\nnomad plugin status aws-ebs-controller\nnomad volume snapshot delete aws-ebs-controller snap-123","handlingStrategy":"try-catch","validationCode":"// confirm the controller is up and the snapshot id is well-formed\nif p.ControllersHealthy == 0 || !strings.HasPrefix(snapID, \"snap-\") {\n    return fmt.Errorf(\"invalid delete-snapshot preconditions\")\n}","typeGuard":"func controllerReady(p *api.CSIPlugin) bool { return p != nil && p.ControllersHealthy > 0 }","tryCatchPattern":"err := csi.ControllerDeleteSnapshot(args, reply)\nif err != nil {\n    // treat 'not found' style wrapped errors as idempotent success\n    log.Printf(\"delete snapshot: %v\", err)\n}","preventionTips":["Treat snapshot deletion as idempotent — the snapshot may already be gone.","Keep the controller job healthy before maintenance windows.","Check driver docs for delete restrictions (in-use clones).","Log the wrapped root error for backend diagnostics."],"tags":["csi","nomad","snapshot","rpc-forwarding"],"backgroundTag":"csi-controller-unavailable","analyzedSha":"482b49bf1aec006f089bcfc7e632d8f6ac303e5e","analyzedAt":"2026-09-04T07:54:14.808Z","contentChangedAt":"2026-09-04T07:54:14.808Z","schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}