abiosoft/colima · warning

error retrieving runtimes: %w

Error message

error retrieving runtimes: %w

What it means

During Stop, colima asks currentContainerEnvironments which runtimes to shut down gracefully; if that lookup fails it only warns and proceeds to stop the VM anyway. The lookup reads the persisted runtime from the store and constructs the matching environment, so it fails on a corrupt/unknown runtime setting or an unreadable instance config.

Source

Thrown at app/app.go:190

		}
	}
	if failed {
		log.Warnln(fmt.Errorf("error running %s provision script(s)", mode))
	}
}

func (c colimaApp) Stop(force bool) error {
	ctx := context.Background()
	log.Println("stopping", config.CurrentProfile().DisplayName)

	// the order for stop is:
	//   container stop -> vm stop

	// stop container runtimes only if the guest is responsive
	if c.guest.Running(ctx) && c.guestResponsive() {
		containers, err := c.currentContainerEnvironments(ctx)
		if err != nil {
			log.Warnln(fmt.Errorf("error retrieving runtimes: %w", err))
		}

		// stop happens in reverse of start
		for i := len(containers) - 1; i >= 0; i-- {
			cont := containers[i]

			log := log.WithField("context", cont.Name())
			log.Println("stopping ...")

			if err := cont.Stop(ctx, force); err != nil {
				// failure to stop a container runtime is not fatal
				// it is only meant for graceful shutdown.
				// the VM will shut down anyways.
				log.Warnln(fmt.Errorf("error stopping %s: %w", cont.Name(), err))
			}
		}
	} else if c.guest.Running(ctx) {
		log.Warnln("vm not responsive, skipping runtime shutdown")

View on GitHub (pinned to c3a5f9184d)

Solutions

  1. Proceed with `colima stop`: the VM stops regardless, graceful runtime shutdown is simply skipped
  2. Inspect and repair the instance config/runtime key (colima status, config files under the colima config dir)
  3. Recreate the instance (`colima delete && colima start`) to rewrite a consistent config
  4. Keep colima and lima at matching versions to avoid unreadable versioned configs
Defensive patterns

Strategy: fallback

Validate before calling

// probe profile health before stop
if err := exec.Command("colima", "status").Run(); err != nil {
    // expect a degraded stop; plan to use --force if it hangs
}

Try / catch

if err := a.Stop(false); err != nil {
    if strings.Contains(err.Error(), "error stopping vm") {
        // runtime lookup already degraded gracefully; only the VM stop failed here
        return a.Stop(true) // force
    }
}

Prevention

When it happens

Trigger: `colima stop` when the stored runtime key references a runtime colima no longer recognizes (config written by a much older/newer version) or the instance config under the colima/lima config dirs cannot be loaded.

Common situations: Downgrading colima after a newer version wrote the config; partially deleted profile; hand-edited config with a bad runtime name.

Related errors


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