{"record":{"id":"9179321fa8378c4c","repo":"tonhowtf/omniget","slug":"nao-foi-possivel-iniciar-o-aria2c","errorCode":null,"errorMessage":"nao foi possivel iniciar o aria2c: {}","messagePattern":"nao foi possivel iniciar o aria2c: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/tools/aria2.rs","lineNumber":106,"sourceCode":"    ]);\n    if !opts.file_name.trim().is_empty() {\n        cmd.args([\"--out\", opts.file_name.trim()]);\n    }\n    if !opts.sha256.trim().is_empty() {\n        cmd.arg(format!(\"--checksum=sha-256={}\", opts.sha256.trim()));\n    }\n    for h in &opts.headers {\n        if !h.trim().is_empty() {\n            cmd.arg(format!(\"--header={}\", h.trim()));\n        }\n    }\n    cmd.arg(&opts.url)\n        .stdin(std::process::Stdio::null())\n        .stdout(std::process::Stdio::piped())\n        .stderr(std::process::Stdio::piped());\n    let mut child = cmd\n        .spawn()\n        .map_err(|e| anyhow!(\"nao foi possivel iniciar o aria2c: {}\", e))?;\n    let stdout = child.stdout.take();\n    let id = format!(\"aria2:{}\", opts.url);\n    let p2 = progress.clone();\n    let id2 = id.clone();\n    let task = tokio::spawn(async move {\n        let mut last = String::new();\n        if let Some(o) = stdout {\n            let mut lines = BufReader::new(o).lines();\n            while let Ok(Some(line)) = lines.next_line().await {\n                if let Some((pct, speed)) = parse_progress(&line) {\n                    super::report(&p2, &id2, \"progress\", pct, Some(100), Some(speed));\n                } else if !line.trim().is_empty() {\n                    last = line;\n                }\n            }\n        }\n        last\n    });","sourceCodeStart":88,"sourceCodeEnd":124,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/tools/aria2.rs#L88-L124","documentation":"aria2::download builds a tokio::process::Command for the external aria2c binary and calls spawn(). If the OS cannot start the process, the error is wrapped with this Portuguese message including the underlying io::Error. It means the downloader never even launched; no network or aria2c-side issue is involved.","triggerScenarios":"Calling aria2::download when the aria2c executable is not installed, is not on PATH, or cannot be executed (bad permissions, missing working directory, exec format error on wrong-architecture binary).","commonSituations":"Deploying to a fresh container/CI image without aria2 installed; user PATH missing /usr/local/bin where aria2c lives; bundling a binary built for another OS/architecture; SELinux or antivirus blocking exec.","solutions":["Install aria2 (apt install aria2 / brew install aria2) and verify with `aria2c --version` in the same environment the app runs in.","Check the absolute path used to build the Command; pass an explicit path to the binary if it is not on the runtime PATH.","Check execute permissions and architecture of the aria2c binary.","Fall back to the library's non-aria2 download path if aria2c is unavailable."],"exampleFix":"// before\nlet mut child = cmd.spawn().map_err(|e| anyhow!(\"nao foi possivel iniciar o aria2c: {}\", e))?;\n// after\nlet bin = which::which(\"aria2c\").map_err(|_| anyhow!(\"aria2c nao encontrado no PATH; instale o pacote aria2\"))?;\nlet mut cmd = Command::new(bin);\nlet mut child = cmd.spawn().map_err(|e| anyhow!(\"nao foi possivel iniciar o aria2c: {}\", e))?;","handlingStrategy":"try-catch","validationCode":"// shell: command -v aria2c || echo 'aria2c nao instalado'\n// rust: which::which(\"aria2c\").is_ok()","typeGuard":null,"tryCatchPattern":"match aria2::download(opts).await {\n    Err(e) if e.to_string().contains(\"nao foi possivel iniciar o aria2c\") => {\n        eprintln!(\"aria2c ausente: instale o pacote aria2 ou informe o caminho do binario\");\n    }\n    other => other?,\n}","preventionTips":["Install aria2 in every deploy image (Dockerfile/CI) and verify at startup with `aria2c --version`.","Add a startup health check that resolves the aria2c binary path before offering downloads.","Prefer bundling/shipping a known aria2c binary and invoking it by absolute path."],"tags":["process-spawn","external-binary","aria2","rust"],"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"}