{"record":{"id":"c5e7781b1b261e3f","repo":"asdf-vm/asdf","slug":"unable-to-create-download-dir-w","errorCode":null,"errorMessage":"unable to create download dir: %w","messagePattern":"unable to create download dir: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/installtest/installtest.go","lineNumber":46,"sourceCode":"\terr := plugin.Exists()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tdownloadDir := DownloadPath(conf, plugin, version)\n\tinstallDir := InstallPath(conf, plugin, version)\n\n\tenv := map[string]string{\n\t\t\"ASDF_INSTALL_TYPE\":    versionType,\n\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","sourceCodeStart":28,"sourceCodeEnd":64,"githubUrl":"https://github.com/asdf-vm/asdf/blob/074a1722ca88d6677f228541ce06efaf4f9924d4/internal/installtest/installtest.go#L28-L64","documentation":"installtest.InstallOneVersion prepares a sandboxed install to test a plugin version: it creates ASDF_DOWNLOAD_PATH via os.MkdirAll before running the plugin's download/install callbacks. If the directory cannot be created, the wrapped error \"unable to create download dir\" is returned.","triggerScenarios":"Running `asdf install <plugin> <version>` (which exercises install tests) where the download path's parent is unwritable, the disk is full, a file exists where the directory should be, or a leftover directory has wrong permissions.","commonSituations":"Read-only ASDF_DATA_DIR (e.g. ~/.asdf mounted read-only in containers/CI); permission changes after running asdf as root/sudo previously; disk quota exceeded.","solutions":["Check and fix permissions on the asdf data dir (typically ~/.asdf): `ls -ld ~/.asdf` and `chown`/`chmod` as needed.","Free disk space or raise quota if the filesystem is full.","Remove any conflicting file at the download path so MkdirAll can create the directory.","Avoid running asdf with sudo, which creates root-owned dirs; fix ownership of previously created dirs."],"exampleFix":"# before (root-owned ~/.asdf)\nsudo asdf install nodejs 20.11.0\n# after\nsudo chown -R $(whoami) ~/.asdf\nasdf install nodejs 20.11.0","handlingStrategy":"validation","validationCode":"test -w \"${ASDF_DATA_DIR:-$HOME/.asdf}\" || { echo \"asdf data dir not writable\"; exit 1; }\ndf -h \"${ASDF_DATA_DIR:-$HOME/.asdf}\" | awk 'NR==2 && $5+0 >= 100 {exit 1}'","typeGuard":null,"tryCatchPattern":"if ! asdf install \"$PLUGIN\" \"$VER\" 2>&1 | grep -q 'unable to create download dir'; then :; else\n  sudo chown -R \"$(whoami)\" \"${ASDF_DATA_DIR:-$HOME/.asdf}\" && asdf install \"$PLUGIN\" \"$VER\"\nfi","preventionTips":["Never run asdf under sudo; fix ownership of root-created dirs","Keep the asdf data dir (~/.asdf) writable by your user","Monitor disk space/quota on the volume holding ~/.asdf","Remove stale files that block directory creation at download paths"],"tags":["filesystem","permissions","install","plugins"],"backgroundTag":"mkdir-permission-denied","analyzedSha":"074a1722ca88d6677f228541ce06efaf4f9924d4","analyzedAt":"2026-08-30T19:56:42.972Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}