{"record":{"id":"ae4bac76abb2b771","repo":"hashicorp/nomad","slug":"csi-controllercreatesnapshot-v","errorCode":null,"errorMessage":"CSI.ControllerCreateSnapshot: %v","messagePattern":"CSI\\.ControllerCreateSnapshot: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"client/csi_endpoint.go","lineNumber":383,"sourceCode":"\n\treturn nil\n}\n\nfunc (c *CSI) ControllerCreateSnapshot(req *structs.ClientCSIControllerCreateSnapshotRequest, resp *structs.ClientCSIControllerCreateSnapshotResponse) error {\n\tdefer metrics.MeasureSince([]string{\"client\", \"csi_controller\", \"create_snapshot\"}, time.Now())\n\n\tplugin, err := c.findControllerPlugin(req.PluginID)\n\tif err != nil {\n\t\t// the server's view of the plugin health is stale, so let it know it\n\t\t// should retry with another controller instance\n\t\treturn fmt.Errorf(\"CSI.ControllerCreateSnapshot: %w: %v\",\n\t\t\tnstructs.ErrCSIClientRPCRetryable, err)\n\t}\n\tdefer plugin.Close()\n\n\tcsiReq, err := req.ToCSIRequest()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"CSI.ControllerCreateSnapshot: %v\", err)\n\t}\n\n\tctx, cancelFn := c.requestContext()\n\tdefer cancelFn()\n\n\t// CSI ControllerCreateSnapshot errors for timeout, codes.Unavailable and\n\t// codes.ResourceExhausted are retried; all other errors are fatal.\n\tcresp, err := plugin.ControllerCreateSnapshot(ctx, csiReq,\n\t\tgrpc_retry.WithPerRetryTimeout(CSIPluginRequestTimeout),\n\t\tgrpc_retry.WithMax(3),\n\t\tgrpc_retry.WithBackoff(grpc_retry.BackoffExponential(100*time.Millisecond)))\n\tif err != nil {\n\t\treturn fmt.Errorf(\"CSI.ControllerCreateSnapshot: %v\", err)\n\t}\n\n\tif cresp == nil || cresp.Snapshot == nil {\n\t\tc.c.logger.Warn(\"plugin did not return error or snapshot; this is a bug in the plugin and should be reported to the plugin author\")\n\t\treturn fmt.Errorf(\"CSI.ControllerCreateSnapshot: plugin did not return error or snapshot\")","sourceCodeStart":365,"sourceCodeEnd":401,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/client/csi_endpoint.go#L365-L401","documentation":"CSI.ControllerCreateSnapshot also wraps the error from req.ToCSIRequest() with this message. ToCSIRequest converts the Nomad RPC request into a CSI protobuf request; failure here means the request itself could not be converted, e.g. required fields are missing or invalid before any plugin is contacted.","triggerScenarios":"req.ToCSIRequest() returns an error while building the CSI CreateSnapshotRequest from the ClientCSIControllerCreateSnapshotRequest, typically because source volume ID or other required fields are empty/invalid.","commonSituations":"Snapshot requests referencing a volume whose CSI metadata is incomplete; server-side request construction passing an unset SourceVolumeID; older Nomad server talking to newer client (or vice versa) with divergent request schemas.","solutions":["Check the snapshot request carries a valid source volume ID / secret fields","Re-run `nomad volume status` to confirm the source volume is registered with complete data","Align Nomad server and client versions so request schemas match","Retry the nomad volume snapshot create command with corrected arguments"],"exampleFix":"// before\nnomad volume snapshot create \"\" my-snap  # empty volume ID\n// after\nnomad volume snapshot create web-data my-snap","handlingStrategy":"validation","validationCode":"// Ensure the source volume is registered and has an external ID before snapshotting:\nvol, err := client.Volumes().Get(ctx, \"web-data\")\nif err != nil || vol.ID == \"\" {\n    // cannot build a valid CSI CreateSnapshotRequest\n    return fmt.Errorf(\"source volume missing: %w\", err)\n}","typeGuard":null,"tryCatchPattern":"// Detect the wrapping prefix to distinguish conversion failures\nif err := c.ControllerCreateSnapshot(req, resp); err != nil {\n    var convErr error\n    if strings.HasPrefix(err.Error(), \"CSI.ControllerCreateSnapshot:\") {\n        convErr = err // inspect message for the underlying cause\n    }\n}","preventionTips":["Run `nomad volume status` to confirm the volume exists before snapshotting","Keep Nomad server and client versions in sync","Don't pass empty volume IDs to nomad volume snapshot create","Validate secrets/parameters against the plugin's documented schema"],"tags":["csi","snapshot","request-validation"],"backgroundTag":"csi-request-conversion-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"}