{"record":{"id":"83a6ab7375270aea","repo":"epi052/feroxbuster","slug":"failed-while-scanning-e","errorCode":null,"errorMessage":"Failed while scanning: {e}","messagePattern":"Failed while scanning: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/main.rs","lineNumber":587,"sourceCode":"        let result = test.connectivity(&targets).await;\n        if let Err(err) = result {\n            clean_up(handles, tasks).await?;\n            bail!(fmt_err(&err.to_string()));\n        }\n        result?\n    };\n\n    if live_targets.is_empty() {\n        clean_up(handles, tasks).await?;\n        bail!(fmt_err(\"Could not find any live targets to scan\"));\n    }\n\n    // kick off a scan against any targets determined to be responsive\n    match scan(live_targets, handles.clone()).await {\n        Ok(_) => {}\n        Err(e) => {\n            clean_up(handles, tasks).await?;\n            bail!(fmt_err(&format!(\"Failed while scanning: {e}\")));\n        }\n    }\n\n    clean_up(handles, tasks).await?;\n\n    log::trace!(\"exit: wrapped_main\");\n    Ok(())\n}\n\n/// Single cleanup function that handles all the necessary drops/finishes etc required to gracefully\n/// shutdown the program\nasync fn clean_up(handles: Arc<Handles>, tasks: Tasks) -> Result<()> {\n    log::trace!(\"enter: clean_up({handles:?}, {tasks:?})\");\n\n    let (tx, rx) = oneshot::channel::<bool>();\n    handles.send_scan_command(JoinTasks(tx))?;\n    rx.await?;\n","sourceCodeStart":569,"sourceCodeEnd":605,"githubUrl":"https://github.com/epi052/feroxbuster/blob/1f595dab5c76858d5a14fbc47dabf2563d729c62/src/main.rs#L569-L605","documentation":"wrapped_main kicks off the actual directory scan via scan(live_targets, handles). If the scan task returns an Err at any point (scanner task panicked-and-propagated, channel closed, fatal I/O error), the error is wrapped in this message after cleaning up all handler tasks.","triggerScenarios":"Any fatal error escaping the scan() future - e.g. failure coordinating scan/term/file handler channels, or an unrecoverable error during ordered scanning of the live targets.","commonSituations":"Output file handler dying mid-scan, terminal handler channel failures, or unexpected internal errors during long-running scans against flaky targets.","solutions":["Read the full log output (increase verbosity with -v/-vv) to find the inner error","Re-run the scan to rule out a transient failure","Reduce concurrency (--threads/-t) if the failure correlates with resource exhaustion","If reproducible, capture with RUST_BACKTRACE=1 and report upstream"],"exampleFix":"// before\nferoxbuster -u https://target -t 200\n// after\nRUST_BACKTRACE=1 feroxbuster -u https://target -t 50 -vv","handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"// shell\nfor i in 1 2 3; do feroxbuster -u https://target -vv && break; sleep 5; done","preventionTips":["Run with -vv logging to capture the inner error","Lower thread count to reduce resource pressure","Report reproducible failures upstream with RUST_BACKTRACE=1"],"tags":["scan","internal","cli"],"backgroundTag":"internal-invariant-violation","analyzedSha":"1f595dab5c76858d5a14fbc47dabf2563d729c62","analyzedAt":"2026-09-13T19:33:06.208Z","contentChangedAt":"2026-09-13T19:33:06.208Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}