hashicorp/nomad · error
Error querying CSI plugins: %w
Error message
Error querying CSI plugins: %w
What it means
csiVolumesList wraps errors from client.CSIPlugins().List(nil) when the -verbose path queries the plugin list after printing volumes. It indicates the Nomad API call to enumerate CSI plugins failed; the HTTP/API error is wrapped via %w.
Source
Thrown at command/volume_status_csi.go:83
}
if len(vols) == 0 {
c.Ui.Error("No CSI volumes")
return nil // not an empty is not an error
} else {
str, err := csiFormatVolumes(vols, opts.json, opts.template)
if err != nil {
return fmt.Errorf("Error formatting: %w", err)
}
c.Ui.Output(str)
}
if !opts.verbose {
return nil
}
plugins, _, err := client.CSIPlugins().List(nil)
if err != nil {
return fmt.Errorf("Error querying CSI plugins: %w", err)
}
if len(plugins) == 0 {
return nil // No more output if we have no plugins
}
var mErr *multierror.Error
q := &api.QueryOptions{PerPage: 30} // TODO: tune page size
NEXT_PLUGIN:
for _, plugin := range plugins {
if !plugin.ControllerRequired || plugin.ControllersHealthy < 1 {
continue // only controller plugins can support this query
}
for {
externalList, _, err := client.CSIVolumes().ListExternal(plugin.ID, q)
if err != nil && !errors.Is(err, io.EOF) {
mErr = multierror.Append(mErr, fmt.Errorf(View on GitHub (pinned to 482b49bf1a)
Solutions
- Read the wrapped error: if 403, use a token with plugin list permissions (management or plugin:read)
- Verify NOMAD_ADDR/agent reachability with nomad server members or nomad status
- Retry after confirming cluster connectivity; the call is a plain list with no pagination loop
Example fix
// before NOMAD_TOKEN=<read-only-token> nomad volume status -verbose // after NOMAD_TOKEN=<management-or-plugin-read-token> nomad volume status -verbose
Defensive patterns
Strategy: try-catch
Validate before calling
// preflight: check ACL + connectivity before verbose listing
_, err := client.CSIPlugins().List(nil)
if err != nil { /* abort early with clear message */ } Try / catch
err := cmd.Run()
if err != nil {
if strings.Contains(err.Error(), "Error querying CSI plugins") {
// check NOMAD_TOKEN permissions and NOMAD_ADDR reachability
}
} Prevention
- Use a token with plugin:read/list ACLs for -verbose
- Verify NOMAD_ADDR with a cheap call (nomad status) first
- Don't pass -verbose unless plugin data is needed
When it happens
Trigger: Run or csiVolumeStatus invokes csiVolumesList with opts.verbose true, and the CSIPlugins().List API call fails — typically ACL token lacking plugin list capability, unreachable agent, or connection error.
Common situations: Running with an expired or too-restrictive NOMAD_TOKEN (missing plugin:read / list ACL), pointing NOMAD_ADDR at a dead server, or network partition between CLI and Nomad agent.
Understand the failure class
Background: "API request failed": what wrapped HTTP errors from external APIs mean and how to find the real cause — this error's family across 29 libraries.
Related errors
- %w: %w
- Error querying host volume: %w
- Error listing CSI volumes: %w
- Error querying CSI volume: %w
- Error querying CSI volumes: %w
AI-assisted analysis of hashicorp/nomad@482b49bf1a (2026-09-04).
Data as JSON: /api/errors/dabb99ef2c0923e4.
Report an issue: GitHub.