abiosoft/colima · error
empty file, startup aborted
Error message
empty file, startup aborted
What it means
Returned by editConfigFile when the temp file handed to the editor comes back empty (only whitespace). waitForUserEdit treats an empty saved file as the user's abort gesture and returns ("", nil); editConfigFile converts that into this error, so `colima start --edit` exits non-zero even when clearing the file was intentional. A non-empty file always proceeds to validation.
Source
Thrown at cmd/start.go:687
currentFile, err := os.ReadFile(config.CurrentProfile().File())
if err != nil {
return c, fmt.Errorf("error reading config file: %w", err)
}
// prepend the config file with termination instruction
abort, err := embedded.ReadString("defaults/abort.yaml")
if err != nil {
log.Warnln(fmt.Errorf("unable to read embedded file: %w", err))
}
tmpFile, err := waitForUserEdit(startCmdArgs.Flags.Editor, []byte(abort+"\n"+string(currentFile)))
if err != nil {
return c, fmt.Errorf("error editing config file: %w", err)
}
// if file is empty, abort
if tmpFile == "" {
return c, fmt.Errorf("empty file, startup aborted")
}
defer func() {
_ = os.Remove(tmpFile)
}()
if startCmdArgs.Flags.SaveConfig {
if err := configmanager.SaveFromFile(tmpFile); err != nil {
return c, err
}
}
return configmanager.LoadFrom(tmpFile)
}
func start(app app.App, conf config.Config) error {
if err := app.Start(conf); err != nil {
return err
}
if startCmdArgs.Flags.Foreground {View on GitHub (pinned to c3a5f9184d)
Solutions
- If aborting was the intent, no fix needed — this error IS the confirmation; exit code is just non-zero
- To proceed with edits, keep (or re-add) valid YAML content and save; the abort header comment at the top does not count as content? no — it does count, so keeping the file as-is and saving is safe
- Re-run `colima start --edit` and quit the editor without deleting content to accept the current config
- Scripts should expect exit != 0 when the operator clears the file
Example fix
# before $ colima start --edit # (in editor: gg d G :wq) Error: empty file, startup aborted # after $ colima start --edit # (in editor: :q or edit values, save non-empty content)
Defensive patterns
Strategy: try-catch
Try / catch
err := startCmd.Execute()
if err != nil && err.Error() == "empty file, startup aborted" {
// intentional user abort of `colima start --edit`; treat as success/no-op
err = nil
} Prevention
- Teach users/scripts that emptying the editor buffer is the abort gesture and yields exit != 0
- To keep the current config unchanged, quit the editor without deleting content
When it happens
Trigger: During `colima start --edit`, selecting all content in the editor and saving an empty buffer, then closing the editor; also triggered by macros/scripts that save an empty file.
Common situations: Users trying to abort the edit by emptying the file (the supported gesture — the error message confirms the abort); accidental select-all deletes; CI automation that truncates the buffer.
Related errors
- empty file, template edit aborted
- error editing config file: %w
- error reading config file: %w
- unable to read embedded file: %w
- error editing template file: %w
AI-assisted analysis of abiosoft/colima@c3a5f9184d (2026-08-15).
Data as JSON: /api/errors/a46f12b91f2894ea.
Report an issue: GitHub.