{"record":{"id":"874da0913f3e32a9","repo":"epi052/feroxbuster","slug":"couldn-t-start-file-handler","errorCode":null,"errorMessage":"Couldn't start {} file handler","messagePattern":"Couldn't start (.+?) file handler","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/main.rs","lineNumber":562,"sourceCode":"        let _ = banner.check_for_updates(UPDATE_URL, handles.clone()).await;\n\n        if banner.print_to(std_stderr, config.clone()).is_err() {\n            clean_up(handles, tasks).await?;\n            bail!(fmt_err(\"Could not print banner\"));\n        }\n    }\n\n    {\n        let send_to_file = !config.output.is_empty();\n\n        // The TermOutHandler spawns a FileOutHandler, so errors in the FileOutHandler never bubble\n        // up due to the TermOutHandler never awaiting the result of FileOutHandler::start (that's\n        // done later here in main). sync checks that the tx/rx connection to the file handler works\n        if send_to_file && handles.output.sync(send_to_file).await.is_err() {\n            // output file specified and file handler could not initialize\n            clean_up(handles, tasks).await?;\n            let msg = format!(\"Couldn't start {} file handler\", config.output);\n            bail!(fmt_err(&msg));\n        }\n    }\n\n    // discard non-responsive targets\n    let live_targets = {\n        let test = heuristics::HeuristicTests::new(handles.clone());\n        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    }","sourceCodeStart":544,"sourceCodeEnd":580,"githubUrl":"https://github.com/epi052/feroxbuster/blob/1f595dab5c76858d5a14fbc47dabf2563d729c62/src/main.rs#L544-L580","documentation":"FeroxScan's main entry point spawns a dedicated file-output handler task that writes scan results to the file specified via -o/--output. Before scanning begins, wrapped_main sends a sync message to that handler to verify the tx/rx channel works. If the sync fails, the file handler never started, so the tool aborts with this message naming the configured output path.","triggerScenarios":"Running feroxbuster with an output file (-o/--output FILE) while FileOutHandler::start fails to initialize or its channel is unresponsive when output.sync() is awaited in wrapped_main.","commonSituations":"The output path points to a non-existent or unwritable directory, the file exists but the process lacks write permission, the path is a directory, or disk/resource constraints prevent spawning the handler task.","solutions":["Verify the directory of the -o path exists and is writable by the feroxbuster process","Remove any conflicting file/directory at the output path or choose a new path","Re-run with absolute output path to rule out CWD differences","If the path is fine, check system resource limits (fd limits, spawn failures) and report upstream"],"exampleFix":"// before\nferoxbuster -u https://target -o /root/scan-results/out.json\n// after\nmkdir -p /root/scan-results && chmod u+w /root/scan-results\nferoxbuster -u https://target -o /root/scan-results/out.json","handlingStrategy":"validation","validationCode":"let p = std::path::Path::new(out_path);\nif let Some(dir) = p.parent() {\n    anyhow::ensure!(dir.exists(), \"output dir {} does not exist\", dir.display());\n}\nanyhow::ensure!(!p.is_dir(), \"output path {} is a directory\", out_path);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always create the output directory before launching","Use absolute paths for -o","Check write permissions on the output path"],"tags":["file-output","initialization","cli"],"backgroundTag":"file-open-failed","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"}