{"record":{"id":"462aaf132e38e1bf","repo":"asdf-vm/asdf","slug":"failed-to-run-download-callback-w-462aaf","errorCode":null,"errorMessage":"failed to run download callback: %w","messagePattern":"failed to run download callback: %w","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/versions/versions.go","lineNumber":184,"sourceCode":"\t\t\"ASDF_INSTALL_VERSION\": version.Value,\n\t\t\"ASDF_INSTALL_PATH\":    installDir,\n\t\t\"ASDF_DOWNLOAD_PATH\":   downloadDir,\n\t\t\"ASDF_CONCURRENCY\":     concurrency,\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 = hook.RunWithOutput(conf, fmt.Sprintf(\"pre_asdf_download_%s\", plugin.Name), []string{version.Value}, stdOut, stdErr)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to run pre-download hook: %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 = hook.RunWithOutput(conf, fmt.Sprintf(\"pre_asdf_install_%s\", plugin.Name), []string{version.Value}, stdOut, stdErr)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to run pre-install hook: %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\tif rmErr := os.RemoveAll(installDir); rmErr != nil {\n\t\t\tfmt.Fprintf(stdErr, \"failed to clean up '%s' due to %s\\n\", installDir, rmErr)\n\t\t}\n\t\treturn fmt.Errorf(\"failed to run install callback: %w\", err)","sourceCodeStart":166,"sourceCodeEnd":202,"githubUrl":"https://github.com/asdf-vm/asdf/blob/074a1722ca88d6677f228541ce06efaf4f9924d4/internal/versions/versions.go#L166-L202","documentation":"InstallOneVersion invokes the plugin's `download` callback (the plugin script's download command) with env including ASDF_DOWNLOAD_PATH. NoCallbackError is tolerated (plugin has no download step), but any other non-nil error is wrapped as 'failed to run download callback', meaning the plugin's own download script failed. The plugin's stdout/stderr already carried the underlying diagnostics.","triggerScenarios":"plugin.RunCallback(\"download\", ...) returns an error that is not NoCallbackError — the plugin's download script exits non-zero (curl failure, bad URL, checksum mismatch, missing download tool).","commonSituations":"Network failures or blocked downloads, plugin pointing at a version that no longer exists upstream, missing system deps (curl/tar), corrupted ASDF_DOWNLOAD_PATH contents.","solutions":["Re-run with the plugin's stderr visible — the actual cause (HTTP error, bad URL) is printed by the plugin script","Check network/proxy connectivity to the download URL","Verify the requested version exists for the plugin; update the plugin (`asdf plugin update <name>`)","Install missing dependencies the plugin's download script needs (curl, git, tar, etc.)"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"// ensure required tools exist before install:\nfor _, bin := range []string{\"curl\", \"git\", \"tar\"} {\n    if _, err := exec.LookPath(bin); err != nil {\n        return fmt.Errorf(\"missing dependency: %s\", bin)\n    }\n}","typeGuard":null,"tryCatchPattern":"if err != nil && strings.Contains(err.Error(), \"failed to run download callback\") {\n    // check network, then retry with backoff\n}","preventionTips":["Check network/proxy availability before scripted installs","Keep plugins updated so download URLs stay valid","Pre-install common download dependencies (curl, tar, git)"],"tags":["network","plugin-callback","install"],"backgroundTag":"download-callback-failed","analyzedSha":"074a1722ca88d6677f228541ce06efaf4f9924d4","analyzedAt":"2026-08-30T19:56:42.972Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}