{"record":{"id":"1458c9b9bd947468","repo":"tonhowtf/omniget","slug":"failed-to-start-yt-dlp","errorCode":null,"errorMessage":"Failed to start yt-dlp: {}","messagePattern":"Failed to start yt-dlp: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"src-tauri/omniget-core/src/core/ytdlp.rs","lineNumber":3457,"sourceCode":"            &args,\n            attempt as u32 + 1,\n            max_attempts as u32,\n            yt_args.player_client.clone().filter(|_| is_youtube),\n            effective_fragments,\n            engine,\n            false,\n        );\n        let attempt_started = std::time::Instant::now();\n\n        let boot_slot = hold_boot_slot(\"download\").await;\n        let mut cmd = ytdlp_command(ytdlp);\n        cmd.args(&args)\n            .stdout(Stdio::piped())\n            .stderr(Stdio::piped())\n            .kill_on_drop(true);\n        let mut child = cmd\n            .spawn()\n            .map_err(|e| anyhow!(\"Failed to start yt-dlp: {}\", e))?;\n        let registered_download_id = log_hook::current_download_id();\n        if let (Some(download_id), Some(pid)) = (registered_download_id, child.id()) {\n            register_download_process(download_id, pid);\n        }\n        tracing::debug!(\n            \"[perf] download_video: yt-dlp process spawned at {:?} (attempt {})\",\n            _timer_start.elapsed(),\n            attempt + 1\n        );\n\n        let _ = progress.send(ProgressUpdate::percent(-2.0)).await;\n\n        let stdout = child.stdout.take().ok_or_else(|| anyhow!(\"No stdout\"))?;\n        let stderr_pipe = child.stderr.take().ok_or_else(|| anyhow!(\"No stderr\"))?;\n\n        let lines = BufReader::new(stdout).lines();\n\n        let captured_path: Arc<Mutex<Option<PathBuf>>> = Arc::new(Mutex::new(None));","sourceCodeStart":3439,"sourceCodeEnd":3475,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/ytdlp.rs#L3439-L3475","documentation":"This error is raised when `Command::spawn()` fails to launch the yt-dlp executable. The library built the command with piped stdout/stderr and kill_on_drop, then attempted to spawn the child process; the OS refused to start it (typically because the binary path does not exist or is not executable). The underlying OS error is interpolated into the message.","triggerScenarios":"Calling the download path in src-tauri/omniget-core/src/core/ytdlp.rs (~line 3457) when the resolved yt-dlp binary is missing, not executable, deleted mid-run, or blocked from exec (permissions, AppArmor/SELinux, quarantine flag).","commonSituations":"yt-dlp was never installed or was auto-updated and the binary path changed; the configured custom yt-dlp path in Settings → Dependencies points to a nonexistent file; the binary lost its +x bit; on Windows the executable is quarantined by antivirus.","solutions":["Verify the yt-dlp binary exists at the resolved path and is executable (`which yt-dlp`, `chmod +x`).","Reinstall/update yt-dlp via Settings → Dependencies in the app.","Check the configured custom yt-dlp path setting and correct or clear it.","On Windows/macOS, un-quarantine the binary (antivirus / `xattr -d com.apple.quarantine yt-dlp`).","Confirm PATH contains the directory holding yt-dlp if a bare name is used."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"let path = resolve_ytdlp_path()?;\nif !path.exists() { return Err(anyhow!(\"yt-dlp binary not found at {}\", path.display())); }\n#[cfg(unix)]\n{\n    use std::os::unix::fs::PermissionsExt;\n    let mode = std::fs::metadata(&path)?.permissions().mode();\n    if mode & 0o111 == 0 { return Err(anyhow!(\"yt-dlp binary is not executable\")); }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Resolve and validate the yt-dlp path (exists + executable) before every download session.","Pin a known-good yt-dlp install via the app's dependency manager.","Add the yt-dlp directory to PATH explicitly rather than relying on ambient PATH.","Exclude the download/tool directory from antivirus quarantine on Windows."],"tags":["rust","process-spawn","ytdlp","external-binary"],"backgroundTag":"command-not-found","analyzedSha":"8600b91f4246848bac346874daa9e61c1fc5677a","analyzedAt":"2026-09-12T14:29:19.317Z","contentChangedAt":"2026-09-12T14:29:19.317Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}