GoogleContainerTools/skaffold · warning
cleaning up debug support volume
Error message
cleaning up debug support volume
What it means
Cleanup removes the debug support volumes created for init containers via d.client.VolumeRemove for each mount in d.debugger.SupportMounts(). Failure to remove a volume (in use, not found, daemon error) is wrapped with this message.
Source
Thrown at pkg/skaffold/deploy/docker/deploy.go:373
func (d *Deployer) Cleanup(ctx context.Context, out io.Writer, dryRun bool, _ manifest.ManifestListByConfig) error {
if dryRun {
for _, container := range d.tracker.DeployedContainers() {
output.Yellow.Fprintln(out, container.ID)
}
return nil
}
for _, container := range d.tracker.DeployedContainers() {
if err := d.client.Delete(ctx, out, container.ID); err != nil {
// TODO(nkubala): replace with actionable error
return errors.Wrap(err, "cleaning up deployed container")
}
d.portManager.RelinquishPorts(container.ID)
}
for _, m := range d.debugger.SupportMounts() {
if err := d.client.VolumeRemove(ctx, m.Source); err != nil {
return errors.Wrap(err, "cleaning up debug support volume")
}
}
if err := d.client.NetworkRemove(ctx, d.network); d.networkDeployed && err != nil {
return errors.Wrap(err, "cleaning up skaffold created network")
}
return d.cleanPreviousDeployments(ctx)
}
func (d *Deployer) cleanPreviousDeployments(ctx context.Context) error {
ctd, err := d.containersToDelete(ctx)
if err != nil {
return err
}
ntd, err := d.networksToDelete(ctx, ctd)
if err != nil {View on GitHub (pinned to a1189de023)
Solutions
- Remove the using container first, then `docker volume rm <volume>` manually
- Re-run `skaffold delete` after the container cleanup step succeeds
- List and delete orphaned volumes: `docker volume ls --filter label=<skaffold-label>` then `docker volume prune`
- If the volume is already gone (404/no such volume), it's safe to ignore and continue
- Check the wrapped inner error to distinguish 'in use' vs 'not found'
Example fix
// before error: cleaning up debug support volume: volume in use // after $ docker ps -a --filter volume=<volume-name> -q | xargs docker rm -f $ docker volume rm <volume-name> $ skaffold delete
Defensive patterns
Strategy: try-catch
Validate before calling
if out, err := exec.Command("sh", "-c", "docker volume ls -q --filter label=<skaffold-label>").CombinedOutput(); err == nil && len(out) > 0 {
log.Printf("support volumes pending cleanup: %s", out)
} Type guard
null
Try / catch
if err := deployer.Cleanup(ctx, out); err != nil && strings.Contains(err.Error(), "cleaning up debug support volume") {
exec.Command("sh", "-c", "docker volume prune -f").Run()
log.Printf("volume cleanup failed (%v); pruned manually", err)
} Prevention
- Ensure container cleanup succeeds before volumes are removed (fix container errors first)
- Periodically run `docker volume prune`
- Avoid external processes mounting skaffold-created volumes
- Re-run `skaffold delete` when volumes are reported in use
When it happens
Trigger: Deployer.Cleanup calls d.client.VolumeRemove(ctx, m.Source) for each support mount; the daemon refuses because a container still uses the volume, the volume was already removed, or the daemon is unreachable.
Common situations: Volume still attached because a previous container-delete step failed or was skipped; volume removed manually with `docker volume rm`; leftover volume mounted by a container created outside skaffold; daemon shut down mid-cleanup.
Related errors
- pruning removed container: %w
- pruning images: %w
- unable to remove container: %w
- cleaning up skaffold created network
- cleaning up deployed container
AI-assisted analysis of GoogleContainerTools/skaffold@a1189de023 (2026-09-05).
Data as JSON: /api/errors/d9329aa3c4cbc1f6.
Report an issue: GitHub.