kubernetes/kops · error
error dumping %q: %v
Error message
error dumping %q: %v
What it means
BuildDump iterates registered resource dumpers and calls each resource's Dumper function; if any dumper returns an error the whole dump fails with 'error dumping %q: %v', where %q is the resource type key. It is a wrapper that aggregates per-resource dump failures (SSH failures, API errors inside the provider dumper, etc.) produced during 'kops toolbox dump'.
Source
Thrown at pkg/resources/dump.go:60
// BuildDump gathers information about the cluster and returns an object for dumping
func BuildDump(ctx context.Context, cloud fi.Cloud, resources map[string]*Resource) (*Dump, error) {
dump := &Dump{}
op := &DumpOperation{
Context: ctx,
Cloud: cloud,
Dump: dump,
}
for k, r := range resources {
if r.Dumper == nil {
klog.V(8).Infof("skipping dump of %q (does not have Dumper)", k)
continue
}
err := r.Dumper(op, r)
if err != nil {
return nil, fmt.Errorf("error dumping %q: %v", k, err)
}
}
sort.SliceStable(dump.Instances, func(i, j int) bool { return dump.Instances[i].Name < dump.Instances[j].Name })
return dump, nil
}
View on GitHub (pinned to 4c8573c808)
Solutions
- Read the wrapped %v message to identify which resource type (k) and underlying cause failed; address that specific cause.
- Re-run toolbox dump with -v8 logging to see which resource is being processed when it fails.
- Fix connectivity/credentials for the failing resource type (SSH keys/bastion for nodes, cloud API creds for provider dumpers).
- If a single broken resource blocks the dump, delete or repair that resource in the cloud console, then retry.
Example fix
// before
err := r.Dumper(op, r)
if err != nil {
return nil, fmt.Errorf("error dumping %q: %v", k, err)
}
// after
err := r.Dumper(op, r)
if err != nil {
return nil, fmt.Errorf("error dumping %q: %w", k, err)
} Defensive patterns
Strategy: try-catch
Validate before calling
// before dumping, confirm each registered resource has a dumper and the cluster is reachable
for k, r := range resources {
if r.Dumper == nil {
klog.V(8).Infof("skipping %q: no dumper", k)
}
} Type guard
func hasDumper(r *resources.Resource) bool { return r != nil && r.Dumper != nil } Try / catch
dump, err := resources.BuildDump(op, cluster)
if err != nil {
klog.Errorf("toolbox dump failed: %v", err)
// parse which resource key failed and address that resource (SSH/API) before retrying
return err
} Prevention
- Ensure nodes are running and SSH (bastion/key) access works before toolbox dump
- Validate cloud credentials before dumping
- Remove or repair dangling resources from partially deleted clusters
- Run with -v8 to trace which resource the dumper is processing
When it happens
Trigger: Any registered dumper (e.g. instance, VPC, load balancer dumpers) returns non-nil: SSH to a node fails, cloud API listing fails inside the dumper, or the resource object is in an unexpected state (e.g. instance has no resolvable address).
Common situations: 'kops toolbox dump <cluster>' run when a node is unhealthy/shut down (SSH unreachable), cloud credentials expired so the provider dumper's API calls fail, or partially deleted cluster leaving dangling resources.
Related errors
- error creating pod log dumper: %w
- error marshaling yaml: %v
- error writing to stdout: %v
- error marshaling json: %v
- unsupported output format: %q
AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05).
Data as JSON: /api/errors/c765867c31d3798c.
Report an issue: GitHub.