{"record":{"id":"a7cb0082ec3ebd03","repo":"lima-vm/lima","slug":"failed-to-write-temp-plist-w","errorCode":null,"errorMessage":"failed to write temp plist: %w","messagePattern":"failed to write temp plist: %w","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/limactl/autostart_darwin.go","lineNumber":124,"sourceCode":"\t\t\"Instance\": instName,\n\t\t\"WorkDir\":  workDir,\n\t\t\"UserName\": userName,\n\t}\n\tif keepAlive {\n\t\tvars[\"KeepAlive\"] = \"true\"\n\t}\n\tcontent, err := textutil.ExecuteTemplate(launchd.DaemonTemplate, vars)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to render daemon plist: %w\", err)\n\t}\n\n\ttmp, err := os.CreateTemp(\"\", \"io.lima-vm.daemon.*.plist\")\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to create temp file: %w\", err)\n\t}\n\tdefer os.Remove(tmp.Name())\n\tif _, err := tmp.Write(content); err != nil {\n\t\treturn fmt.Errorf(\"failed to write temp plist: %w\", err)\n\t}\n\ttmp.Close()\n\n\tdestPath := launchd.GetDaemonPlistPath(instName)\n\tsvcTarget := \"system/\" + launchd.DaemonServiceNameFrom(instName)\n\n\t_ = runSudo(ctx, \"launchctl\", \"bootout\", svcTarget)\n\tif err := runSudo(ctx, \"install\", \"-m\", \"644\", tmp.Name(), destPath); err != nil {\n\t\treturn fmt.Errorf(\"failed to install plist to %s: %w\", destPath, err)\n\t}\n\tif err := runSudo(ctx, \"launchctl\", \"enable\", svcTarget); err != nil {\n\t\treturn fmt.Errorf(\"failed to enable LaunchDaemon: %w\", err)\n\t}\n\tif err := runSudo(ctx, \"launchctl\", \"bootstrap\", \"system\", destPath); err != nil {\n\t\treturn fmt.Errorf(\"failed to bootstrap LaunchDaemon: %w\", err)\n\t}\n\n\tlogrus.Infof(\"LaunchDaemon installed for instance %q (runs as %q at boot)\", instName, userName)","sourceCodeStart":106,"sourceCodeEnd":142,"githubUrl":"https://github.com/lima-vm/lima/blob/dd909d0973cd84fa35f9e1693181b4585ea616c1/cmd/limactl/autostart_darwin.go#L106-L142","documentation":"daemonInstall renders the launchd plist and writes it to the os.CreateTemp file; this error wraps a short or failed write (tmp.Write returned an error). It indicates the temp file descriptor became unwritable after creation — typically disk-full or an I/O error.","triggerScenarios":"Calling `limactl autostart <instance> --condition=boot` on macOS when writing the rendered plist bytes to the just-created temp file fails: disk quota/full volume, I/O error on the temp filesystem, or fd closed/limit issues.","commonSituations":"Root volume hitting capacity during install; APFS quota; flaky external TMPDIR on a network volume.","solutions":["Check disk space with `df -h` and free space on the temp volume","Retry the limactl autostart command after freeing space","If TMPDIR points to a network/unstable volume, point TMPDIR back to the local disk"],"exampleFix":"// before: limactl autostart myinstance --condition=boot  (fails, disk full)\n// after:  df -h && rm -rf ~/Library/Caches/bulk-data && limactl autostart myinstance --condition=boot","handlingStrategy":"validation","validationCode":"avail=$(df -k \"$TMPDIR\" | awk 'NR==2 {print $4}')\nif [ \"$avail\" -lt 1024 ]; then\n  echo \"Less than 1MB free on temp volume\"; exit 1\nfi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Monitor disk space on the boot volume","Avoid network-backed TMPDIR","Retry installs after freeing space, they are idempotent"],"tags":["macos","launchd","filesystem","disk-full"],"backgroundTag":"disk-full-write-failed","analyzedSha":"dd909d0973cd84fa35f9e1693181b4585ea616c1","analyzedAt":"2026-09-01T14:24:59.842Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}