{"record":{"id":"9480342e891a541b","repo":"epi052/feroxbuster","slug":"could-not-print-banner","errorCode":null,"errorMessage":"Could not print banner","messagePattern":"Could not print banner","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/main.rs","lineNumber":548,"sourceCode":"    // wait until the parallel branch has been handled before sending the UpdateTargets command\n    // this ensures that only the targets being scanned are sent to the Stats object\n    //\n    // if sent before the parallel branch is handled, the Stats object will have duplicate\n    // targets\n    handles.stats.send(UpdateTargets(targets.clone()))?;\n\n    if matches!(config.output_level, OutputLevel::Default) {\n        // only print banner if output level is default (no banner on --quiet|--silent)\n        let std_stderr = stderr(); // std::io::stderr\n\n        let mut banner = Banner::new(&targets, &config);\n\n        // only interested in the side-effect that sets banner.update_status\n        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","sourceCodeStart":530,"sourceCodeEnd":566,"githubUrl":"https://github.com/epi052/feroxbuster/blob/1f595dab5c76858d5a14fbc47dabf2563d729c62/src/main.rs#L530-L566","documentation":"Before scanning, wrapped_main asks the banner system to check for updates and print the banner to stderr; if banner.print_to returns an error, it cleans up and bails with fmt_err(\"Could not print banner\"). The update-check failure is deliberately ignored (let _), but an actual failure rendering/printing the banner aborts the run.","triggerScenarios":"banner.print_to fails while writing the banner to the provided stderr handle — e.g. the terminal/stderr writer errors (closed descriptor, unsupported terminal state) or banner rendering fails on the given config.","commonSituations":"Running in restricted environments (CI, docker with closed stdout/stderr), weird TERM settings or non-TTY sinks, or output redirection to a file/pipe that is closed (broken pipe).","solutions":["Ensure stderr is open and writable (check redirections like 2>/dev/null or closed fds)","Run in a normal terminal or fix TERM/locale environment variables","Update ferox — newer releases handle odd terminal states more gracefully","If it persists, capture stderr to a file to see the underlying writer error and report it"],"exampleFix":"// before\nferox -u https://t.com 2>&1-   # closed stderr\n// after\nferox -u https://t.com 2>ferox.log","handlingStrategy":"try-catch","validationCode":"if (!process.stderr.writable) throw new Error('stderr must be open and writable');","typeGuard":null,"tryCatchPattern":"try { ... } catch (e) { if (String(e).includes('Could not print banner')) { /* check stderr redirection/terminal state; run with stderr redirected to a file */ } }","preventionTips":["Avoid closing or weirdly redirecting stderr when launching scans","Run in environments with a writable stderr (fix CI/docker fds)","Keep ferox updated for terminal-handling fixes"],"tags":["banner","stderr","terminal","startup"],"backgroundTag":"broken-pipe","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"}