{"record":{"id":"ebb8bebdaddd0c8a","repo":"tonhowtf/omniget","slug":"yt-dlp-process-failed","errorCode":null,"errorMessage":"yt-dlp process failed: {}","messagePattern":"yt-dlp process failed: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/ytdlp.rs","lineNumber":3508,"sourceCode":"            let stderr_buf = BufReader::new(stderr_pipe);\n            let mut stderr_lines = stderr_buf.lines();\n            let mut first = true;\n            while let Ok(Some(line)) = stderr_lines.next_line().await {\n                if first {\n                    first = false;\n                    release_boot_slot(&stderr_boot_slot);\n                }\n                if let Some(id) = stderr_log_id {\n                    log_hook::emit_log(id, &line);\n                }\n                buf.push_str(&line);\n                buf.push('\\n');\n            }\n            buf\n        });\n\n        let status = tokio::select! {\n            s = child.wait() => s.map_err(|e| anyhow!(\"yt-dlp process failed: {}\", e))?,\n            _ = cancel_token.cancelled() => {\n                let _ = child.kill().await;\n                if let Some(download_id) = registered_download_id {\n                    unregister_download_process(download_id);\n                }\n                let _ = line_reader.await;\n                let _ = stderr_reader.await;\n                cleanup_part_files(output_dir).await;\n                tracing::debug!(\"[perf] download_video took {:?}\", _timer_start.elapsed());\n                anyhow::bail!(\"Download cancelled\");\n            }\n        };\n\n        if let Some(download_id) = registered_download_id {\n            unregister_download_process(download_id);\n        }\n        release_boot_slot(&boot_slot);\n","sourceCodeStart":3490,"sourceCodeEnd":3526,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/ytdlp.rs#L3490-L3526","documentation":"Raised when the async `child.wait()` on the yt-dlp process itself fails — i.e. the OS-level wait errored rather than yt-dlp exiting with a nonzero code. This is not a yt-dlp extraction failure; it means the runtime could not reap or communicate with the child process.","triggerScenarios":"tokio::select! branch at ytdlp.rs:3508 where `child.wait()` returns Err — child process killed by a signal outside the app's control, PID recycled/invalid, or tokio runtime I/O driver issues.","commonSituations":"The yt-dlp process was killed by the OOM killer or an external tool; system resource exhaustion; corrupted process state after system suspend/resume during a long download.","solutions":["Retry the download; transient wait errors usually disappear on a fresh spawn.","Check system logs (dmesg/journalctl) for OOM-killer or signal kills of yt-dlp.","Free memory / close other apps if OOM is implicated.","Update the app and yt-dlp to current versions."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"let status = match child.wait().await {\n    Ok(s) => s,\n    Err(e) => {\n        tracing::warn!(\"wait() failed (child killed externally?): {e}\");\n        return Err(anyhow!(\"yt-dlp process failed: {}\", e));\n    }\n};","preventionTips":["Monitor available memory; large downloads can push yt-dlp into the OOM killer.","Avoid suspending the machine mid-download or cancel via the app's cancel token instead of killing processes externally.","Keep tokio and the app updated to avoid runtime wait bugs."],"tags":["rust","process-wait","ytdlp","tokio"],"backgroundTag":"process-wait-failed","analyzedSha":"8600b91f4246848bac346874daa9e61c1fc5677a","analyzedAt":"2026-09-12T14:29:19.317Z","contentChangedAt":"2026-09-12T14:29:19.317Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}