{"record":{"id":"12d3b432144c3b9d","repo":"searxng/searxng","slug":"missing-required-config-base-url","errorCode":null,"errorMessage":"missing required config `base_url`","messagePattern":"missing required config `base_url`","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"searx/engines/annas_archive.py","lineNumber":106,"sourceCode":"aa_ext: str = \"\"\n\"\"\"Filter Anna's results by a file ending.  Common filters for example are\n``pdf`` and ``epub``.\n\n.. note::\n\n   Anna's Archive is a beta release: Filter results by file extension does not\n   really work on Anna's Archive.\n\n\"\"\"\n\n\ndef setup(_engine_settings: dict[str, t.Any]) -> bool:\n    \"\"\"Check of engine's settings.\"\"\"\n\n    traits: EngineTraits = EngineTraits(**ENGINE_TRAITS[\"annas archive\"])\n\n    if not base_url:\n        raise ValueError(\"missing required config `base_url`\")\n\n    if aa_content and aa_content not in traits.custom[\"content\"]:\n        raise ValueError(f\"invalid setting content: {aa_content}\")\n\n    if aa_sort and aa_sort not in traits.custom[\"sort\"]:\n        raise ValueError(f\"invalid setting sort: {aa_sort}\")\n\n    if aa_ext and aa_ext not in traits.custom[\"ext\"]:\n        raise ValueError(f\"invalid setting ext: {aa_ext}\")\n\n    return True\n\n\ndef _get_base_url_choice() -> str:\n    if isinstance(base_url, list):\n        return random.choice(base_url)\n\n    return base_url","sourceCodeStart":88,"sourceCodeEnd":124,"githubUrl":"https://github.com/searxng/searxng/blob/9fea41204fdfa7a5cfa15b0ebd12904c520478ce/searx/engines/annas_archive.py#L88-L124","documentation":"Anna's Archive engine's setup() hook requires a `base_url` setting because the site has no stable official domain (domains rotate due to takedowns). Without it the engine cannot build request URLs, so it raises at setup time and the engine is not usable.","triggerScenarios":"Enabling the annas_archive engine in settings.yml without a `base_url` key. setup(engine_settings) runs during engine initialization (once, at startup or when the engine is first activated) and returns bool on success.","commonSituations":"New searxng installs where the engine is enabled but base_url was never configured; copying example configs that omit it; the known instance list (searx/data/ahmia etc. style) not providing a fallback here — this engine mandates explicit configuration.","solutions":["Add `base_url: https://annas-archive.org` (or a currently working mirror) to the annas_archive engine block in settings.yml","Verify the URL responds before committing it to config","Alternatively disable the engine (`disabled: true` → remove/omit) if you don't want to maintain a domain"],"exampleFix":"# before (settings.yml)\n- name: annas archive\n  engine: annas_archive\n  shortcut: aa\n\n# after\n- name: annas archive\n  engine: annas_archive\n  shortcut: aa\n  base_url: https://annas-archive.org\n","handlingStrategy":"validation","validationCode":"entry = next(e for e in settings['engines'] if e.get('engine') == 'annas_archive')\nif not entry.get('base_url'):\n    entry['base_url'] = 'https://annas-archive.org'  # or disable the engine","typeGuard":"def annas_engine_ready(entry: dict) -> bool:\n    return isinstance(entry.get('base_url'), str) and entry['base_url'].startswith('http')","tryCatchPattern":"try:\n    annas_archive.setup(entry)\nexcept ValueError as e:\n    if 'missing required config `base_url`' in str(e):\n        log.warning('annas_archive disabled until base_url is configured')\n    else:\n        raise","preventionTips":["Set base_url whenever enabling annas_archive; it has no hardcoded domain","Periodically verify the mirror URL still resolves (domains rotate)","Prefer disabling the engine if you can't maintain the URL"],"tags":["searxng","annas-archive","base-url","missing-config"],"backgroundTag":"missing-required-config","analyzedSha":"9fea41204fdfa7a5cfa15b0ebd12904c520478ce","analyzedAt":"2026-08-27T06:40:00.395Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}