{"record":{"id":"a8ee659a70b6df28","repo":"hashicorp/nomad","slug":"s-error-w-a8ee65","errorCode":null,"errorMessage":"%s error: %w","messagePattern":"(.+?) error: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nomad/client_host_volume_endpoint.go","lineNumber":93,"sourceCode":"\tsnap, err := c.srv.State().Snapshot()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t_, err = getNodeForRpc(snap, nodeID)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Get the connection to the client\n\tstate, ok := c.srv.getNodeConn(nodeID)\n\tif !ok {\n\t\treturn findNodeConnAndForward(c.srv, nodeID, fwdMethod, args, reply)\n\t}\n\n\t// Make the RPC\n\tif err := NodeRpc(state.Session, method, args, reply); err != nil {\n\t\treturn fmt.Errorf(\"%s error: %w\", method, err)\n\t}\n\treturn nil\n}\n","sourceCodeStart":75,"sourceCodeEnd":97,"githubUrl":"https://github.com/hashicorp/nomad/blob/482b49bf1aec006f089bcfc7e632d8f6ac303e5e/nomad/client_host_volume_endpoint.go#L75-L97","documentation":"sendVolumeRPC wraps any error returned by the node-local host volume RPC (NodeRpc) with the RPC method name as prefix (%s error: %w). This is a wrapper: the underlying cause (transport failure, client-side handler error, session issue) is preserved via %w and should be unwrapped. It tells you which host-volume method (Create/Register/Delete) failed on the client.","triggerScenarios":"Calling host volume Create, Register, or Delete where the target node is local (no forwarding needed) and the NodeRpc call to the client fails: client RPC handler error, closed yamux session, network interruption, or the client rejects the operation.","commonSituations":"Host volume directory does not exist / permission denied on the client; client agent restarting mid-RPC; network partition between server and client; invalid volume arguments rejected by the node plugin handler.","solutions":["Unwrap the error (errors.Unwrap / %v print) to see the root cause from the client RPC.","Check the target client's nomad agent logs for the corresponding host-volume handler error.","Verify the host volume path exists and the nomad agent has permissions on the client.","Retry the operation; if the session was transiently broken the agent re-establishes it."],"exampleFix":"// Go caller: unwrap to root cause\nif err := c.Create(args, vol); err != nil {\n    log.Printf(\"root cause: %v\", errors.Unwrap(err))\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"err := c.Create(args, vol)\nif err != nil {\n    var root error = err\n    for errors.Unwrap(root) != nil { root = errors.Unwrap(root) }\n    log.Printf(\"host volume %s failed: %v\", method, root)\n    if isTransient(root) { retry(method, args, vol) }\n}","preventionTips":["Always unwrap (%w) to find the true client-side cause.","Pre-provision host volume paths with correct ownership on clients.","Watch client agent availability before volume mutations."],"tags":["host-volumes","rpc","nomad","error-wrapping"],"backgroundTag":"rpc-call-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"}