{"record":{"id":"f56b83784a519889","repo":"asdf-vm/asdf","slug":"unable-to-create-install-dir-w","errorCode":null,"errorMessage":"unable to create install dir: %w","messagePattern":"unable to create install dir: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/installtest/installtest.go","lineNumber":56,"sourceCode":"\t\t\"ASDF_INSTALL_VERSION\": version,\n\t\t\"ASDF_INSTALL_PATH\":    installDir,\n\t\t\"ASDF_DOWNLOAD_PATH\":   downloadDir,\n\t\t\"ASDF_CONCURRENCY\":     \"1\",\n\t}\n\n\terr = os.MkdirAll(downloadDir, 0o777)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"unable to create download dir: %w\", err)\n\t}\n\n\terr = plugin.RunCallback(\"download\", []string{}, env, &stdOut, &stdErr)\n\tif _, ok := err.(plugins.NoCallbackError); err != nil && !ok {\n\t\treturn fmt.Errorf(\"failed to run download callback: %w\", err)\n\t}\n\n\terr = os.MkdirAll(installDir, 0o777)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"unable to create install dir: %w\", err)\n\t}\n\n\terr = plugin.RunCallback(\"install\", []string{}, env, &stdOut, &stdErr)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to run install callback: %w\", err)\n\t}\n\n\treturn nil\n}\n\n// InstallPath returns the path to a tool installation\nfunc InstallPath(conf config.Config, plugin plugins.Plugin, version string) string {\n\treturn filepath.Join(pluginInstallPath(conf, plugin), formatVersionStringForFS(version))\n}\n\n// DownloadPath returns the download path for a particular plugin and version\nfunc DownloadPath(conf config.Config, plugin plugins.Plugin, version string) string {\n\treturn filepath.Join(conf.DataDir, dataDirDownloads, plugin.Name, formatVersionStringForFS(version))","sourceCodeStart":38,"sourceCodeEnd":74,"githubUrl":"https://github.com/asdf-vm/asdf/blob/074a1722ca88d6677f228541ce06efaf4f9924d4/internal/installtest/installtest.go#L38-L74","documentation":"After running the download callback, InstallOneVersion creates the final install directory with os.MkdirAll(installDir, 0o777). If that filesystem operation fails, the error is wrapped as 'unable to create install dir'. This is an OS-level permission or path problem, not a plugin problem.","triggerScenarios":"Calling InstallOneVersion when: the parent of installDir does not exist and cannot be created; the process lacks write permission on the path; installDir exists as a regular file; the filesystem is read-only or full; the path contains invalid components.","commonSituations":"ASDF_DATA_DIR pointed at a root-owned or read-only location; HOME unset or not writable in CI containers; disk quota exceeded; a stray file occupying the plugin install path after a corrupted prior install.","solutions":["Check permissions on the install path parent and chown/chmod so the current user can write.","Verify ASDF_DATA_DIR (or default ~/.asdf) points to a writable location.","Remove any regular file occupying the installDir path.","Free disk space or remount the filesystem read-write."],"exampleFix":"// before: data dir not writable\nexport ASDF_DATA_DIR=/opt/asdf   # root-owned\n// after\nexport ASDF_DATA_DIR=\"$HOME/.asdf\"\nmkdir -p \"$ASDF_DATA_DIR\"","handlingStrategy":"validation","validationCode":"if err := os.MkdirAll(installDir, 0o777); err != nil {\n    return fmt.Errorf(\"precheck install dir: %w\", err)\n}\nif fi, err := os.Stat(filepath.Dir(installDir)); err == nil && !fi.IsDir() {\n    return fmt.Errorf(\"%s is not a directory\", filepath.Dir(installDir))\n}","typeGuard":null,"tryCatchPattern":"if err := installtest.InstallOneVersion(conf, plugin, version); err != nil {\n    if strings.Contains(err.Error(), \"unable to create install dir\") {\n        log.Printf(\"check ASDF_DATA_DIR writability: %v\", err)\n    }\n}","preventionTips":["Run mkdir -p on the data dir during environment setup and chown it to the running user.","Keep ASDF_DATA_DIR on local writable storage, not read-only mounts.","Check free disk space before large installs in CI.","Never let a file occupy a directory path under the asdf data dir."],"tags":["filesystem","permissions","install"],"backgroundTag":"mkdir-permission-denied","analyzedSha":"074a1722ca88d6677f228541ce06efaf4f9924d4","analyzedAt":"2026-08-30T19:56:42.972Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}