abiosoft/colima · warning

error during teardown of

Error message

error during teardown of %s: %w

What it means

One container runtime's Teardown (host-side cleanup of what provisioning created) failed during delete; deliberately non-fatal, only warned. The VM and config teardown continue, but the named runtime may leave configuration behind on the host.

Solutions

  1. Complete the delete, then remove leftover artifacts by hand (docker context, kubeconfig entries)
  2. Close applications holding colima config files and retry `colima delete --force`
  3. Verify nothing remains: `docker context ls`, `kubectl config get-contexts`
  4. Avoid pre-deleting contexts/configs manually before running colima delete
Defensive patterns

Strategy: fallback

Try / catch

// non-fatal by design; after delete, sweep the named runtime's leftovers:
// docker context rm colima 2>/dev/null; kubectl config delete-context colima 2>/dev/null

Prevention

When it happens

Trigger: `colima delete` when removing a runtime's host artifacts fails: `docker context rm colima` errors because the docker CLI fails, files are locked by another process, or the runtime binaries were already removed manually.

Common situations: Docker CLI upgraded to a version whose context handling changed; user already deleted the context manually; editors/IDEs holding config files open.

Related errors


AI-assisted analysis of abiosoft/colima@c3a5f9184d (2026-08-15). Data as JSON: /api/errors/865ccecba39b6ace. Report an issue: GitHub.

Appendix: source

Thrown at app/app.go:270

	//   container teardown -> vm teardown

	// vm teardown would've sufficed but container provision
	// may have created configurations on the host.
	// it is thereby necessary to teardown containers as well.

	// teardown container runtimes
	if c.guest.Running(ctx) {
		containers, err := c.currentContainerEnvironments(ctx)
		if err != nil {
			log.Warnln(fmt.Errorf("error retrieving runtimes: %w", err))
		}
		for _, cont := range containers {
			log := log.WithField("context", cont.Name())
			log.Println("deleting ...")

			if err := cont.Teardown(ctx); err != nil {
				// failure here is not fatal
				log.Warnln(fmt.Errorf("error during teardown of %s: %w", cont.Name(), err))
			}
		}
	}

	// teardown vm
	if err := c.guest.Teardown(ctx); err != nil {
		return fmt.Errorf("error during teardown of vm: %w", err)
	}

	// delete configs
	if err := configmanager.Teardown(); err != nil {
		return fmt.Errorf("error deleting configs: %w", err)
	}

	// delete runtime disk if disk in use and data deletion is requested
	if diskInUse && data {
		log.Println("deleting container data")
		if err := limautil.DeleteDisk(); err != nil {

View on GitHub (pinned to c3a5f9184d)