{"record":{"id":"a46f12b91f2894ea","repo":"abiosoft/colima","slug":"empty-file-startup-aborted","errorCode":null,"errorMessage":"empty file, startup aborted","messagePattern":"empty file, startup aborted","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/start.go","lineNumber":687,"sourceCode":"\tcurrentFile, err := os.ReadFile(config.CurrentProfile().File())\n\tif err != nil {\n\t\treturn c, fmt.Errorf(\"error reading config file: %w\", err)\n\t}\n\n\t// prepend the config file with termination instruction\n\tabort, err := embedded.ReadString(\"defaults/abort.yaml\")\n\tif err != nil {\n\t\tlog.Warnln(fmt.Errorf(\"unable to read embedded file: %w\", err))\n\t}\n\n\ttmpFile, err := waitForUserEdit(startCmdArgs.Flags.Editor, []byte(abort+\"\\n\"+string(currentFile)))\n\tif err != nil {\n\t\treturn c, fmt.Errorf(\"error editing config file: %w\", err)\n\t}\n\n\t// if file is empty, abort\n\tif tmpFile == \"\" {\n\t\treturn c, fmt.Errorf(\"empty file, startup aborted\")\n\t}\n\n\tdefer func() {\n\t\t_ = os.Remove(tmpFile)\n\t}()\n\tif startCmdArgs.Flags.SaveConfig {\n\t\tif err := configmanager.SaveFromFile(tmpFile); err != nil {\n\t\t\treturn c, err\n\t\t}\n\t}\n\treturn configmanager.LoadFrom(tmpFile)\n}\n\nfunc start(app app.App, conf config.Config) error {\n\tif err := app.Start(conf); err != nil {\n\t\treturn err\n\t}\n\tif startCmdArgs.Flags.Foreground {","sourceCodeStart":669,"sourceCodeEnd":705,"githubUrl":"https://github.com/abiosoft/colima/blob/c3a5f9184d83a197184f897a9f07eb3c01b3bc88/cmd/start.go#L669-L705","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"# before\n$ colima start --edit\n# (in editor: gg d G :wq)\nError: empty file, startup aborted\n\n# after\n$ colima start --edit\n# (in editor: :q  or edit values, save non-empty content)","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"err := startCmd.Execute()\nif err != nil && err.Error() == \"empty file, startup aborted\" {\n    // intentional user abort of `colima start --edit`; treat as success/no-op\n    err = nil\n}","preventionTips":["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"],"tags":["editor","abort","edit","ux"],"backgroundTag":null,"analyzedSha":"c3a5f9184d83a197184f897a9f07eb3c01b3bc88","analyzedAt":"2026-08-15T18:58:08.334Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}