{"record":{"id":"eeb2e2a89c94238c","repo":"abiosoft/colima","slug":"error-creating-temp-file-w","errorCode":null,"errorMessage":"error creating temp file: %w","messagePattern":"error creating temp file: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"daemon/process/vmnet/deps.go","lineNumber":61,"sourceCode":"func (v vmnetFile) bins() []string {\n\treturn []string{BinaryPath, ClientBinaryPath}\n}\nfunc (v vmnetFile) Install(host environment.HostActions) error {\n\tarch := \"x86_64\"\n\tif runtime.GOARCH != \"amd64\" {\n\t\tarch = \"arm64\"\n\t}\n\n\t// read the embedded file\n\tgz, err := embedded.Read(\"network/vmnet_\" + arch + \".tar.gz\")\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error retrieving embedded vmnet file: %w\", err)\n\t}\n\n\t// write tar to tmp directory\n\tf, err := os.CreateTemp(\"\", \"vmnet.tar.gz\")\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error creating temp file: %w\", err)\n\t}\n\tif _, err := f.Write(gz); err != nil {\n\t\treturn fmt.Errorf(\"error writing temp file: %w\", err)\n\t}\n\t_ = f.Close() // not a fatal error\n\n\tdefer func() {\n\t\t_ = os.Remove(f.Name())\n\t}()\n\n\t// extract tar to desired location\n\tdir := optDir\n\tif err := host.RunInteractive(\"sudo\", \"mkdir\", \"-p\", dir); err != nil {\n\t\treturn fmt.Errorf(\"error preparing colima privileged dir: %w\", err)\n\t}\n\tif err := host.RunInteractive(\"sudo\", \"sh\", \"-c\", fmt.Sprintf(\"cd %s && tar xfz %s 2>/dev/null\", dir, f.Name())); err != nil {\n\t\treturn fmt.Errorf(\"error extracting vmnet archive: %w\", err)\n\t}","sourceCodeStart":43,"sourceCodeEnd":79,"githubUrl":"https://github.com/abiosoft/colima/blob/c3a5f9184d83a197184f897a9f07eb3c01b3bc88/daemon/process/vmnet/deps.go#L43-L79","documentation":"vmnetFile.Install stages the embedded tarball by writing it to a temp file (os.CreateTemp(\"\", \"vmnet.tar.gz\")) before privileged extraction into /opt/colima. This error means the OS refused to create the temp file: TMPDIR unset/pointing to a nonexistent or protected directory (common in launchd-managed daemon contexts with sterile environments), disk/inode exhaustion, or sandbox denial.","triggerScenarios":"TMPDIR invalid or unwritable in the daemon's environment; /tmp full or mounted read-only; macOS sandboxed execution denying the default temp dir.","commonSituations":"rootful daemon started from a context without the user's env; CI runners with tiny tmpfs; disk quota hit.","solutions":["check and free space: df -h $TMPDIR /tmp","verify writability in the failing context: touch $TMPDIR/colima-probe","set TMPDIR to a writable directory for the process and retry `colima start --network-address`"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"tmp := os.TempDir()\nprobe, err := os.CreateTemp(\"\", \"colima-probe\")\nif err != nil {\n    return fmt.Errorf(\"TMPDIR %q unusable: %w\", tmp, err)\n}\n_ = probe.Close()\n_ = os.Remove(probe.Name())","typeGuard":null,"tryCatchPattern":"if _, err := os.CreateTemp(\"\", \"vmnet.tar.gz\"); err != nil {\n    if pe := new(fs.PathError); errors.As(err, &pe) {\n        // EACCES/EROFS -> fix TMPDIR; ENOSPC -> free space, then retry\n    }\n}","preventionTips":["ensure TMPDIR is set and writable in daemon/launchd/CI environments","monitor free space and inode availability on the temp filesystem","probe temp-dir writability before triggering the privileged vmnet install"],"tags":["filesystem","temp-files","disk-space","vmnet"],"backgroundTag":null,"analyzedSha":"c3a5f9184d83a197184f897a9f07eb3c01b3bc88","analyzedAt":"2026-08-15T18:58:08.334Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}