{"record":{"id":"3d31c7356f06da75","repo":"jdx/mise","slug":"no-executable-files-found-in-archive","errorCode":null,"errorMessage":"No executable files found in archive","messagePattern":"No executable files found in archive","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cli/generate/tool_stub.rs","lineNumber":649,"sourceCode":"        file::extract_archive(\n            archive_path,\n            &extracted_dir,\n            format,\n            &file::ExtractOptions {\n                pr: Some(pr),\n                ..Default::default()\n            },\n        )?;\n\n        // Check if strip_components would be applied during actual installation\n        let format =\n            ExtractionFormat::from_file_name(&archive_path.file_name().unwrap().to_string_lossy());\n        let will_strip = file::should_strip_components(archive_path, format)?;\n\n        // Find executable files\n        let executables = self.find_executables(&extracted_dir)?;\n        if executables.is_empty() {\n            bail!(\"No executable files found in archive\");\n        }\n\n        // Look for exact filename match only\n        let tool_name = self.get_tool_name();\n        let selected_exe = self.find_exact_binary_match(&executables, &tool_name)?;\n\n        // If strip_components will be applied, remove the first path component\n        if will_strip {\n            let path = std::path::Path::new(&selected_exe);\n            if let Ok(stripped) = path.strip_prefix(path.components().next().unwrap()) {\n                let stripped_str = stripped.to_string_lossy().to_string();\n                // Don't return empty string if stripping removed everything\n                if !stripped_str.is_empty() {\n                    return Ok(stripped_str);\n                }\n            }\n        }\n","sourceCodeStart":631,"sourceCodeEnd":667,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/cli/generate/tool_stub.rs#L631-L667","documentation":"This error is thrown by `extract_and_find_binary` after downloading and extracting an archive: the extractor found no files it recognizes as executables in the extracted directory. It guards against proceeding with an archive that contains only docs, data files, or platform binaries for other OSes.","triggerScenarios":"Downloading a URL that points to an archive whose contents contain no executable-bit files (e.g. a source tarball, a docs zip, or a `.deb`/`.pkg` installer archive the extractor can't scan for exec bits).","commonSituations":"Pointing the stub at a source-code tarball instead of a prebuilt release; macOS users grabbing a .pkg installer instead of the darwin tarball; archives whose executables are nested without executable permissions preserved.","solutions":["Point the stub URL at a prebuilt release archive containing executables rather than a source tarball","Use --bin to explicitly name the binary path inside the archive (also check the archive contents manually: tar -tf or unzip -l)","Verify the archive matches your platform (a linux-only archive viewed from mac may show no usable executables)"],"exampleFix":"// before\nurl = \"https://github.com/org/tool/archive/refs/tags/v1.0.tar.gz\"\n// after\nurl = \"https://github.com/org/tool/releases/download/v1.0/tool-linux-amd64.tar.gz\"","handlingStrategy":"validation","validationCode":"# Inspect the archive before wiring it into a stub\nif [[ \"$URL\" == *.tar.gz ]]; then\n  curl -fsSL \"$URL\" | tar -tz | head\nelif [[ \"$URL\" == *.zip ]]; then\n  curl -fsSL \"$URL\" -o a.zip && unzip -l a.zip\nfi","typeGuard":null,"tryCatchPattern":"# On failure, fall back to explicit --bin once the archive layout is known\nmise generate tool-stub mytool --url \"$URL\" || \\\n  mise generate tool-stub mytool --url \"$URL\" --bin bin/mytool","preventionTips":["Use prebuilt release archives, not source tarballs or installer packages (.pkg/.deb)","Inspect archive contents (tar -tz / unzip -l) before generating the stub","Confirm the archive matches the target platform"],"tags":["archive","tool-stub","download"],"backgroundTag":"empty-result-set","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}