{"record":{"id":"f7de22d3d5617173","repo":"epi052/feroxbuster","slug":"could-not-determine-initial-targets","errorCode":null,"errorMessage":"Could not determine initial targets: {}","messagePattern":"Could not determine initial targets: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/main.rs","lineNumber":385,"sourceCode":"\n    if config.resumed {\n        let scanned_urls = handles.ferox_scans()?;\n        let from_here = config.resume_from.clone();\n\n        // populate FeroxScans object with previously seen scans\n        scanned_urls.add_serialized_scans(&from_here, handles.clone())?;\n\n        // populate Stats object with previously known statistics\n        handles.stats.send(LoadStats(from_here))?;\n    }\n\n    // get targets from command line or stdin\n    let targets = match get_targets(handles.clone()).await {\n        Ok(t) => t,\n        Err(e) => {\n            // should only happen in the event that there was an error reading from stdin\n            clean_up(handles, tasks).await?;\n            bail!(\"Could not determine initial targets: {}\", e);\n        }\n    };\n\n    // --parallel branch\n    if config.parallel > 0 {\n        log::trace!(\"enter: parallel branch\");\n\n        PARALLEL_LIMITER.add_permits(config.parallel);\n\n        let invocation = args();\n\n        let para_regex = Regex::new(\"--stdin\").unwrap();\n\n        // remove stdin since only the original process will process targets\n        // remove quiet and silent so we can force silent later to normalize output\n        let mut original = invocation\n            .filter(|s| !para_regex.is_match(s))\n            .collect::<Vec<String>>();","sourceCodeStart":367,"sourceCodeEnd":403,"githubUrl":"https://github.com/epi052/feroxbuster/blob/1f595dab5c76858d5a14fbc47dabf2563d729c62/src/main.rs#L367-L403","documentation":"wrapped_main wraps the get_targets call; when it fails (documented as only happening when reading from stdin errors), it cleans up running tasks and bails with this message, embedding the underlying error. It means the scanner could not assemble its initial target list, so no scan can start.","triggerScenarios":"Targets supplied via stdin (e.g. from a pipe like cat urls.txt | ferox) when the stdin read fails — closed/broken pipe, invalid bytes, or an inner get_targets failure such as the dont-scan footgun checks bubbling up.","commonSituations":"Piping from a command that failed midway (breaking the pipe), piping binary/invalid data, or running ferox in an environment with no stdin attached while relying on piped input.","solutions":["Ensure the upstream command in the pipe succeeds and outputs valid URLs","Pass targets with -u/--urls instead of stdin to bypass stdin reading","Check the inner error text (shown after the colon) for the root cause","Verify stdin encoding/permissions in CI or non-interactive shells"],"exampleFix":"// before\nmaybe-failing-cmd | ferox --stdin\n// after\nmaybe-failing-cmd > urls.txt && ferox --stdin < urls.txt  # or ferox -u https://t.com","handlingStrategy":"try-catch","validationCode":"const input = require('fs').readFileSync(0, 'utf8'); if (!/^https?:\\/\\//m.test(input)) throw new Error('stdin has no valid target URLs');","typeGuard":null,"tryCatchPattern":"try { ... } catch (e) { if (String(e).startsWith('Could not determine initial targets')) { /* inspect inner cause: stdin read failure; fall back to -u targets */ } }","preventionTips":["Guarantee upstream pipe commands exit successfully","Prefer explicit -u/--urls over stdin in scripts/CI","Validate piped data is plain URL text"],"tags":["targets","stdin","startup"],"backgroundTag":"invalid-argument-value","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"}