abiosoft/colima · warning

error persisting runtime settings: %w

Error message

error persisting runtime settings: %w

What it means

After a successful start, colima persists the chosen runtime into its config store via c.setRuntime; a failure is logged with log.Error but deliberately not returned, because start already succeeded. It means writing to colima's config store (~/.colima/<profile>) failed. Consequence: the next command may not see which runtime is active.

Source

Thrown at app/app.go:148

	// provision and start container runtimes
	for _, cont := range containers {
		log := log.WithField("context", cont.Name())
		log.Println("provisioning ...")
		if err := cont.Provision(ctx); err != nil {
			return fmt.Errorf("error provisioning %s: %w", cont.Name(), err)
		}
		log.Println("starting ...")
		if err := cont.Start(ctx); err != nil {
			return fmt.Errorf("error starting %s: %w", cont.Name(), err)
		}
	}

	// run ready provision scripts
	c.runProvisionScripts(conf, config.ProvisionModeReady)

	// persist the current runtime
	if err := c.setRuntime(conf.Runtime); err != nil {
		log.Error(fmt.Errorf("error persisting runtime settings: %w", err))
	}

	// persist the kubernetes config
	if err := c.setKubernetes(conf.Kubernetes); err != nil {
		log.Error(fmt.Errorf("error persisting kubernetes settings: %w", err))
	}

	log.Println("done")

	if err := generateSSHConfig(conf.SSHConfig); err != nil {
		log.Trace("error generating ssh_config: %w", err)
	}
	return nil
}

func (c colimaApp) runProvisionScripts(conf config.Config, mode string) {
	var failed bool
	for _, s := range conf.Provision {

View on GitHub (pinned to c3a5f9184d)

Solutions

  1. Fix ownership/permissions: `sudo chown -R $(whoami) ~/.colima` and ensure it is writable
  2. Free disk or quota on the home volume
  3. Re-run `colima start` when no other colima process holds the profile, then verify with `colima status` that the runtime persisted
  4. If the store file is corrupt, delete the profile config and recreate the instance
Defensive patterns

Strategy: fallback

Validate before calling

// ensure the config store is writable before start
home, _ := os.UserHomeDir()
configDir := filepath.Join(home, ".colima")
if fi, err := os.Stat(configDir); err == nil && fi.Mode().Perm()&0200 == 0 {
    // fix perms (chmod u+w / chown -R $(id -u)) before starting
}

Try / catch

// the library already logs-and-continues; the caller verifies afterwards
if err := a.Start(ctx, conf); err == nil {
    if r, rerr := a.Runtime(); rerr != nil || r != conf.Runtime {
        // runtime was not persisted: repair store permissions and re-run start
    }
}

Prevention

When it happens

Trigger: HOME or ~/.colima is read-only or owned by another user; disk quota exhausted; the store file is corrupt or being mutated by a concurrent colima process.

Common situations: Running colima under sudo so ~/.colima entries end up root-owned; NFS or read-only home directories in corporate setups; two colima commands racing on the same profile.

Related errors


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