{"record":{"id":"7255b0e2f70cb2e4","repo":"epi052/feroxbuster","slug":"could-not-get-underlying-wordlist","errorCode":null,"errorMessage":"Could not get underlying wordlist","messagePattern":"Could not get underlying wordlist","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/event_handlers/scans.rs","lineNumber":326,"sourceCode":"        }\n\n        log::trace!(\"exit: update_all_bar_lengths\");\n        Ok(())\n    }\n\n    /// Helper to easily get the (locked) underlying wordlist\n    pub fn get_wordlist(&self, offset: usize) -> Result<Arc<Vec<String>>> {\n        if let Ok(guard) = self.wordlist.lock().as_ref() {\n            if let Some(list) = guard.as_ref() {\n                return if offset > 0 {\n                    Ok(Arc::new(list[offset..].to_vec()))\n                } else {\n                    Ok(list.clone())\n                };\n            }\n        }\n\n        bail!(\"Could not get underlying wordlist\")\n    }\n\n    /// wrapper around scanning a url to stay DRY\n    async fn ordered_scan_url(&mut self, targets: Vec<String>, order: ScanOrder) -> Result<()> {\n        log::trace!(\"enter: ordered_scan_url({targets:?}, {order:?})\");\n        let should_test_deny = !self.handles.config.url_denylist.is_empty()\n            || !self.handles.config.regex_denylist.is_empty();\n\n        for target in targets {\n            if self.data.contains(&target) && matches!(order, ScanOrder::Latest) {\n                // FeroxScans knows about this url and scan isn't an Initial scan\n                // initial scans are skipped because when resuming from a .state file, the scans\n                // will already be populated in FeroxScans, so we need to not skip kicking off\n                // their scans\n                continue;\n            }\n\n            let scan = if let Some(ferox_scan) = self.data.get_scan_by_url(&target) {","sourceCodeStart":308,"sourceCodeEnd":344,"githubUrl":"https://github.com/epi052/feroxbuster/blob/1f595dab5c76858d5a14fbc47dabf2563d729c62/src/event_handlers/scans.rs#L308-L344","documentation":"get_wordlist bails when the cached wordlist behind the internal lock cannot be retrieved. Both update_all_bar_lengths and ordered_scan_url depend on it; without the wordlist, progress bars and scan ordering cannot be computed.","triggerScenarios":"Calling get_wordlist when the wordlist slot is None (wordlist not loaded) or its lock guard cannot be acquired — e.g. after the wordlist task failed to load the file or a panic poisoned the lock.","commonSituations":"The configured wordlist file failed to load earlier (bad path, permission) so the cache was never populated; accessing wordlist during shutdown; tests instantiating the scanner container without loading a wordlist.","solutions":["Verify the wordlist file loaded successfully at startup (fix path/permissions reported by earlier errors)","Call get_wordlist only after wordlist initialization completes","Recover from a poisoned lock by identifying and fixing the earlier panicking task","In tests, load a wordlist (or a small test list) before invoking scan setup"],"exampleFix":"// before\nlet wordlist = scan_container.get_wordlist().await?; // wordlist never loaded\n// after\nscan_container.initialize_wordlist(\"/usr/share/wordlists/common.txt\").await?;\nlet wordlist = scan_container.get_wordlist().await?;","handlingStrategy":"try-catch","validationCode":"if !Path::new(&config.wordlist).exists() {\n    return Err(format!(\"wordlist not found: {}\", config.wordlist));\n}","typeGuard":null,"tryCatchPattern":"match scan_container.get_wordlist().await {\n    Ok(list) => list,\n    Err(e) if e.to_string().contains(\"Could not get underlying wordlist\") => {\n        log::error!(\"wordlist not loaded; check earlier load errors\");\n        return Err(e);\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Fix any wordlist load errors reported at startup before scanning","Load the wordlist before building progress bars or ordering scans","Use a small explicit wordlist in tests to guarantee population","Watch for panics in scan tasks that could poison the wordlist lock"],"tags":["wordlist","internal-state","concurrency"],"backgroundTag":"resource-not-found","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"}