abiosoft/colima · error

config missing for colima profile '%s': %w

Error message

config missing for colima profile '%s': %w

What it means

Returned by `colima clone` (cmd/clone.go:58) during the 'copying config' phase when a second os.Stat on the source Lima instance directory fails. The same directory passed the initial existence check, so this fires only if it disappeared or became unreadable between the two checks.

Source

Thrown at cmd/clone.go:58

				return fmt.Errorf("error preparing to copy VM: %w", err)
			}

			if err := cli.Command("cp",
				filepath.Join(from.LimaInstanceDir(), "basedisk"),
				filepath.Join(from.LimaInstanceDir(), "diffdisk"),
				filepath.Join(from.LimaInstanceDir(), "cidata.iso"),
				filepath.Join(from.LimaInstanceDir(), "lima.yaml"),
				to.LimaInstanceDir(),
			).Run(); err != nil {
				return fmt.Errorf("error copying VM: %w", err)
			}
		}

		{
			logrus.Info("copying config...")
			// verify source config exists
			if _, err := os.Stat(from.LimaInstanceDir()); err != nil {
				return fmt.Errorf("config missing for colima profile '%s': %w", from.ShortName, err)
			}

			// ensure destination config directory
			if err := cli.Command("mkdir", "-p", filepath.Dir(to.LimaInstanceDir())).Run(); err != nil {
				return fmt.Errorf("cannot copy config to new profile '%s': %w", to.ShortName, err)
			}

			if err := cli.Command("cp", from.LimaInstanceDir(), to.LimaInstanceDir()).Run(); err != nil {
				return fmt.Errorf("error copying VM config: %w", err)
			}
		}

		logrus.Info("clone successful")
		logrus.Infof("run `colima start %s` to start the newly cloned profile", to.ShortName)
		return nil
	},
}

View on GitHub (pinned to c3a5f9184d)

Solutions

  1. Ensure no other colima/limactl operation touches the source profile during the clone, then retry
  2. Verify the directory still exists: `ls -ld ~/.colima/_lima/<src-profile>`
  3. If the source was deleted, recreate it with `colima start -p <src>` before cloning again
Defensive patterns

Strategy: validation

Validate before calling

// Serialize profile operations: hold a lock or simply verify presence right before the call
if _, err := os.Stat(from.LimaInstanceDir()); err != nil {
    return fmt.Errorf("source profile vanished; concurrent colima operation detected: %w", err)
}

Prevention

When it happens

Trigger: Concurrent removal of the source profile (a parallel `colima delete` or `limactl delete`), or a permission/IO error surfacing on the second stat (e.g. ACL change mid-clone).

Common situations: Running two colima commands against the same profile simultaneously; automation scripts racing cleanup jobs against clones.

Related errors


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