abiosoft/colima · warning
error persisting Colima state: %w
Error message
error persisting Colima state: %w
What it means
Warning logged when configmanager.SaveToFile cannot persist the resolved VM configuration to the current profile's state file (config.CurrentProfile().StateFile()) during the post-start actions. The start itself already succeeded; only the on-disk state snapshot is lost, so colima logs and continues.
Source
Thrown at environment/vm/lima/lima.go:352
}
}
}
return nil
})
// replicate addresses when network address is disabled
a.Add(func() error {
if err := l.replicateHostAddresses(conf); err != nil {
logrus.Warnln(fmt.Errorf("unable to assign host IP addresses to the VM: %w", err))
}
return nil
})
// preserve state
a.Add(func() error {
if err := configmanager.SaveToFile(conf, config.CurrentProfile().StateFile()); err != nil {
logrus.Warnln(fmt.Errorf("error persisting Colima state: %w", err))
}
return nil
})
// save store settings
a.Add(func() error {
if len(l.limaConf.AdditionalDisks) == 0 {
return nil
}
// startup is successful
// if additional disk is present, then it must've been formatted correctly.
if err := store.Set(func(s *store.Store) {
s.DiskFormatted = true
}); err != nil {
// not fatal, but should be logged
logrus.Warnln(fmt.Errorf("error persisting store settings: %w", err))
}View on GitHub (pinned to c3a5f9184d)
Solutions
- Check free space with 'df -h ~' and free space if needed
- Fix ownership of the profile directory: sudo chown -R $(whoami) ~/.colima
- Ensure only one colima process touches the profile: 'colima list' then stop duplicates
- Re-run 'colima start' after fixing; the state file is rewritten on each successful start
Defensive patterns
Strategy: try-catch
Validate before calling
// ensure the state file's directory is writable before starting
func stateDirWritable(p config.Profile) error {
dir := filepath.Dir(p.StateFile())
if info, err := os.Stat(dir); err != nil || !info.IsDir() {
return fmt.Errorf("state dir unavailable: %w", err)
}
probe := filepath.Join(dir, ".write-probe")
return os.WriteFile(probe, nil, 0600)
} Try / catch
In Go: wrap the start call and inspect the warning path indirectly — colima already downgrades this to a log. Callers should check errors.Is(err, fs.ErrPermission) / fs.ErrNoSpace only if surfacing the log, and continue since startup already succeeded.
Prevention
- Keep the home volume from running full; the state file is small but writes fail on ENOSPC
- Never run colima under sudo (leaves root-owned files) — fix with chown if already done
- One colima process per profile at a time
When it happens
Trigger: configmanager.SaveToFile fails: no space left on the host filesystem holding ~/.colima/<profile>/*.state, permission/ownership problems in the profile directory, or two colima processes writing the same profile concurrently.
Common situations: Full disk on macOS home volume; ~/.colima owned by root after running with sudo once; running 'colima start' from two terminals against the same profile; antivirus/backup tool holding the state file open.
Related errors
- error preparing vmnet: %w
- error preparing daemon directory: %w
- error creating Lima config directory: %w
- error saving provisioning state: %w
- error writing store file: %w
AI-assisted analysis of abiosoft/colima@c3a5f9184d (2026-08-15).
Data as JSON: /api/errors/baf2f4c8367c4988.
Report an issue: GitHub.