{"record":{"id":"0cf30fe0aec93c7a","repo":"hashicorp/nomad","slug":"csi-controllercreatevolume-v","errorCode":null,"errorMessage":"CSI.ControllerCreateVolume: %v","messagePattern":"CSI\\.ControllerCreateVolume: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"client/csi_endpoint.go","lineNumber":199,"sourceCode":"\t}\n\treturn err\n}\n\nfunc (c *CSI) ControllerCreateVolume(req *structs.ClientCSIControllerCreateVolumeRequest, resp *structs.ClientCSIControllerCreateVolumeResponse) error {\n\tdefer metrics.MeasureSince([]string{\"client\", \"csi_controller\", \"create_volume\"}, 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.ControllerCreateVolume: %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.ControllerCreateVolume: %v\", err)\n\t}\n\n\tctx, cancelFn := c.requestContext()\n\tdefer cancelFn()\n\n\t// CSI ControllerCreateVolume errors for timeout, codes.Unavailable and\n\t// codes.ResourceExhausted are retried; all other errors are fatal.\n\tcresp, err := plugin.ControllerCreateVolume(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.ControllerCreateVolume: %v\", err)\n\t}\n\n\tif cresp == nil || cresp.Volume == nil {\n\t\tc.c.logger.Warn(\"plugin did not return error or volume; this is a bug in the plugin and should be reported to the plugin author\")\n\t\treturn fmt.Errorf(\"CSI.ControllerCreateVolume: plugin did not return error or volume\")","sourceCodeStart":181,"sourceCodeEnd":217,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/client/csi_endpoint.go#L181-L217","documentation":"This error is returned by the Nomad client's CSI ControllerCreateVolume RPC handler when the client-side request fails during req.ToCSIRequest() — the conversion of Nomad's internal volume-creation request into a CSI protobuf request. It wraps the conversion error with the 'CSI.ControllerCreateVolume' prefix so server logs identify the failing controller operation.","triggerScenarios":"req.ToCSIRequest() returns an error, which occurs when the incoming ClientCSIControllerCreateVolumeRequest cannot be translated into a csi.CreateVolumeRequest (e.g. invalid/nil fields in the request struct produced upstream by the Nomad server).","commonSituations":"Bugs or version mismatches between the Nomad server and client producing malformed controller requests; volume spec fields that fail protobuf conversion; a plugin/job registration path populating inconsistent capacity or capability fields.","solutions":["Inspect the wrapped '%v' detail message to see why ToCSIRequest failed and fix the offending field in the volume registration/spec","Verify Nomad server and client are the same version to avoid incompatible CSI request structs","Check how the volume was registered (nomad volume register / CSI spec) for invalid capacity or capability values","If it persists on valid input, file a Nomad issue with the full error and volume spec"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Before issuing a controller create-volume RPC, validate the volume spec\n// that will be converted by ToCSIRequest\nif vol == nil || vol.ID == \"\" || vol.PluginID == \"\" {\n    return fmt.Errorf(\"volume spec incomplete: id=%q pluginID=%q\", vol.ID, vol.PluginID)\n}\nif vol.RequestedCapacityMin <= 0 {\n    return fmt.Errorf(\"volume %q: invalid requested capacity %d\", vol.ID, vol.RequestedCapacityMin)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep Nomad server and client on matching versions","Validate volume registrations (capacity, capabilities, pluginID) before submitting create-volume requests","Pin CSI plugin versions and test volume lifecycle in staging","Capture the full wrapped error detail when it occurs and compare against a known-good volume spec"],"tags":["csi","grpc","volume-provisioning","request-conversion"],"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"}