Skip to content

fix(k8s): SearXNG engines time out or return no hit #4094

Closed

Description

@dan-petty

Problem

A live run on 2026-11-07 against the pinned image (searxng/searxng:2026.10.23-629368e40) in namespace devops showed three engine faults and two log lines.

  • GET /search?q=<query>&format=json&categories=general,it,science returned 58 hits, but unresponsive_engines held [duckduckgo, timeout]. The engine had outgoing.request_timeout: 5.0 (k8s/devops/searxng/configmap.yaml).
  • An earlier container run found that the engine pypi returned no hit. The engine reads HTML from https://pypi.org/search/ (searx/engines/pypi.py at the pinned commit) and takes the entries with the XPath a[@class="package-snippet"]. On 2026-11-07 one request to that URL from the dev container returned HTTP 200 with 3,038 bytes, the title "Client Challenge", and no package-snippet element. A scraping engine that gets a challenge page never answers, whatever the timeout.
  • The same earlier run found that duckduckgo and github rate-limited one address after about 30 queries. SearXNG then suspends the engine for a time, and the engine is silent for the rest of that time.
  • The pod log has the ERROR "X-Forwarded-For nor X-Real-IP header is set!" and the WARNING "missing config file: /etc/searxng/limiter.toml".

The two log lines are harmless, by the source of the pinned commit:

  • The ERROR comes from searx/botdetection/trusted_proxies.py (log_error_only_once). The proxy middleware logs it once, when a request has neither header. The roadmap Service sends none, and server.limiter: false means that no code uses the client address.
  • The WARNING comes from Config.from_toml in searx/botdetection/config.py. limiter.initialize in searx/limiter.py calls get_cfg() even when the limiter is off ("the botdetection must be activated"), and a missing file leaves the defaults of the schema in force.

So pypi is a fault, the duckduckgo timeout and the two rate limits are probable faults that need a measure, and the two log lines are noise.

Expected

Read the settings in k8s/devops/searxng/configmap.yaml and the SearXNG documents at the pinned tag, then:

  1. Remove the engine pypi from keep_only, and from the list in k8s/README.md ("The engines"). Keep only engines that answer. A package search is not lost: the other engines and the web chain cover it.
  2. Measure the duckduckgo timeout with 20 queries at request_timeout 5.0 and at a higher value. Set the value that removes the timeout, or set a timeout on that engine only, and write the numbers in the proposal. If duckduckgo still times out, the proposal says so, and the ConfigMap keeps it only if it answers in most queries.
  3. For the rate limits of duckduckgo and github, read the documents of SearXNG on engine suspension and decide with evidence: keep the engine and accept the suspension, or remove it. Do not add a retry loop.
  4. Say in a comment of the ConfigMap that the two log lines are harmless, with the file and the reason, so that a reader does not chase them. Do not mount a limiter.toml to hide them.
  5. The web search chain stays as it is: searxng, then duckduckgo, then firecrawl (web_search in src/devops_cli/ai/web_search.py). A reply with no hit and with unresponsive_engines already makes the provider raise and pass the search on.
  6. Do not change the cluster. The change is the ConfigMap file, its test and its document.

Acceptance criteria

  • uv run pytest tests/invariants/test_k8s_searxng.py::test_the_settings_keep_no_engine_that_never_answers fails on the current code: the test reads the list in tests/fixtures/searxng/engines_that_never_answer.txt (new, with the reason and the date for each engine, first line pypi) and finds pypi in keep_only.
  • uv run pytest tests/invariants/test_k8s_searxng.py::test_the_readme_lists_the_engines_that_the_settings_keep is a guard. It compares the list in k8s/README.md with keep_only. It passes before the change, and it fails if the settings change and the README does not.
  • uv run pytest tests/ai/test_web_search_searxng.py -k unresponsive passes before and after: a reply with no hit and with unresponsive engines passes the search on to the next provider.

Existing tool considered

SearXNG already has what is needed: use_default_settings.engines.keep_only, outgoing.request_timeout, a timeout for each engine, and the suspension of a failed engine. No new tool is needed. A different meta-search service was not considered, because #3924 put SearXNG in the stack.

Cost

  • Build: about 40k tokens (the file edits, the measure of 40 queries, two tests, two paragraphs) and about 1.5 hours, with most of the time in the measure.
  • Keep: low. One fixture file with a reason for each dropped engine.
  • Fix: an engine that never answers slows every search by its timeout and lowers the hit count. Today the cost is one dead engine in ten and a 5-second wait on a timeout.

Related

Activity

  1. added
    source/agent
    type/bug
    scope/k8s
    status/new
    value/medium
    effort/medium
    on Nov 7, 2026
  2. dan-petty commented on Nov 7, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.

    • Type: type/bug. The fix prefix of the title gives the type.
    • Scope: scope/k8s. The (k8s) scope of the title gives the scope.
    • Priority: P2-Medium. Engines are broken but the fallback chain still returns results, so the impact is degraded, not total.
    • Value: Medium. Removes a dead engine and fixes timeouts so search answers are more reliable.
    • Effort: Medium. Requires timeout measurement, engine removal, ConfigMap edit, a new test, and a README update.
    • Related: feat(k8s): run SearXNG in namespace devops #3924, which asks for a different change. Both target the SearXNG ConfigMap in k8s/devops/searxng/, but 3924 creates it and this item fixes engine entries in it.
  3. added
    priority/p2-medium
    owner/agent
    status/in-progress
    status/in-review
    and removed
    status/new
    status/in-progress
    on Nov 7, 2026
  4. removed
    status/in-review
    owner/agent
    on Nov 8, 2026
  5. devops-cli-service commented on Nov 8, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-08 04:10 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/mediumpriority/p2-mediumscope/k8ssource/agenttype/bugvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions