stanford-oval/storm · critical · RuntimeError
You must supply searxng_api_url
Error message
You must supply searxng_api_url
What it means
SearxNGRM.__init__ requires the URL of a SearXNG instance because, unlike hosted search APIs, SearXNG is self-hosted and there is no default endpoint. Without searxng_api_url the retriever has nothing to send queries to.
Source
Thrown at knowledge_storm/rm.py:664
self,
searxng_api_url,
searxng_api_key=None,
k=3,
is_valid_source: Callable = None,
):
"""Initialize the SearXNG search retriever.
Please set up SearXNG according to https://docs.searxng.org/index.html.
Args:
searxng_api_url (str): The URL of the SearXNG API. Consult SearXNG documentation for details.
searxng_api_key (str, optional): The API key for the SearXNG API. Defaults to None. Consult SearXNG documentation for details.
k (int, optional): The number of top passages to retrieve. Defaults to 3.
is_valid_source (Callable, optional): A function that takes a URL and returns a boolean indicating if the
source is valid. Defaults to None.
"""
super().__init__(k=k)
if not searxng_api_url:
raise RuntimeError("You must supply searxng_api_url")
self.searxng_api_url = searxng_api_url
self.searxng_api_key = searxng_api_key
self.usage = 0
if is_valid_source:
self.is_valid_source = is_valid_source
else:
self.is_valid_source = lambda x: True
def get_usage_and_reset(self):
usage = self.usage
self.usage = 0
return {"SearXNG": usage}
def forward(
self, query_or_queries: Union[str, List[str]], exclude_urls: List[str] = []
):
"""Search with SearxNG for self.k top passages for query or queriesView on GitHub (pinned to fb951af774)
Solutions
- Run or identify a SearXNG instance and pass its URL: SearxNGRM(searxng_api_url='http://localhost:8080')
- If self-hosting, deploy with docker: docker run -d -p 8080:8080 searxng/searxng
- Confirm the instance has the JSON format enabled (search.formats includes json) if using API-key auth
Example fix
# before rm = SearxNGRM(k=3) # after rm = SearxNGRM(searxng_api_url='http://localhost:8080', k=3)
Defensive patterns
Strategy: validation
Validate before calling
SEARXNG_URL = os.environ.get("SEARXNG_URL")
assert SEARXNG_URL, "SearxNG instance URL required (self-hosted, e.g. http://localhost:8080)"
import requests
assert requests.get(f"{SEARXNG_URL}/healthz", timeout=5).ok, "SearxNG instance unreachable" Try / catch
try:
rm = SearxNGRM(searxng_api_url=SEARXNG_URL, k=3)
except RuntimeError as e:
raise SystemExit(f'Config error: {e}') from e Prevention
- Document that SearxNG is self-hosted; provision it in docker-compose alongside the app
- Add a startup connectivity check against the instance
- Keep the instance URL in config, not hardcoded
When it happens
Trigger: Instantiating SearxNGRM() (or passing searxng_api_url=None/'') without specifying the instance URL, e.g. assuming a public default like searx.be exists.
Common situations: Developer forgets SearxNG must be self-hosted, passes only an API key, uses an env var the class does not read, or the URL string is empty due to a config loading bug.
Understand the failure class
Background: Missing required parameter errors: what 'X is required' and 'the required X param is missing' mean, and how to fix them — this error's family across 27 libraries.
Related errors
- Please provide a url for the Qdrant server.
- You must supply brave_search_api_key or set environment vari
- Please provide a url for the Qdrant server.
- No valid OpenAI API provider is provided. Cannot use default
- Please provide an embedding model.
AI-assisted analysis of stanford-oval/storm@fb951af774 (2026-08-28).
Data as JSON: /api/errors/c81f08b121db63f5.
Report an issue: GitHub.