Skip to content

fix(k8s): Choose the SearXNG engine set by reliability #5595

Open

Description

@devops-cli-service

Split from #4201.

Problem

The duckduckgo engine of SearXNG raises SearxEngineCaptchaException with suspended_time=0. SearXNG does not suspend the engine, so the next query asks it again. The 3-hour log of 2026-11-08 also holds Too many request (suspended_time=180) for superuser, stackoverflow, askubuntu and arxiv, and HTTP 400 from api.stackexchange.com for the three Stack Exchange engines. The cause is not proven: it is the query rate, or a flag on the cluster egress address.

Why this part is deferred

The engine set cannot change until the cause is known. #4201 adds the measure only: the OpenMetrics endpoint of SearXNG and the alert on an engine's reliability. This part waits on at least 3 days of searxng_engines_reliability_total for each engine, and on a person's same query set from another egress address.

Acceptance criteria

  • The issue holds the reliability of each engine over at least 3 days, and the refusals by class: CAPTCHA, access denied and too many requests.
  • The issue names the cause: the query rate or the cluster egress address.
  • A test over the searxng-settings ConfigMap holds the engine set that the measure chooses, and the test fails before the change.
  • A devops k8s searxng-check run gets at least one hit for the general category.
  • The settings add no retry loop (fix(k8s): SearXNG engines time out or return no hit #4094).

Proposed design

Problem statement

SearXNG keeps nine keyless engines. duckduckgo raises CAPTCHA with no suspension. The Stack Exchange engines return too many requests. The cause is not proven. This issue selects the engine set from a 3-day reliability window and a cross-egress test. It then updates searxng-settings and verifies the live service.

Acceptance criteria

Requirement: Engine set from the selection window

The searxng-settings ConfigMap SHALL keep only the engines that the 3-day reliability window and the cross-egress test select.

Scenario: Kubernetes manifest validation

  • WHEN uv run devops ci --check --only k8s runs after the ConfigMap change
  • THEN The command exits 0 and reports no validation error for searxng-settings.

Requirement: Live category hits

The running SearXNG service MUST return at least one hit for the general, it and science categories.

Scenario: Live engine set check

  • WHEN uv run devops k8s searxng-check runs after the ConfigMap change
  • THEN The command exits 0 and its report shows at least one hit for general, it and science.

Requirement: Removed engines stay off

The OFF_ENGINES tuple SHALL name each engine that the selection removes.

Scenario: Removed engine list

  • WHEN uv run pytest tests/commands/k8s/test_k8s_searxng_check.py runs after the change
  • THEN The test passes and asserts that each removed engine is in OFF_ENGINES.

Requirement: No retry loop

The searxng-settings ConfigMap MUST add no retry loop or retry setting.

Scenario: Manifest validation

  • WHEN uv run devops ci --check --only k8s runs after the ConfigMap change
  • THEN The command exits 0 and reports no retry setting for searxng-settings.

Existing Tool Considered

No alternatives check has run. SearXNG is the open, maintained service that serves the engines and reports unresponsive_engines. It does not choose an engine set from a multi-day reliability window. This item keeps keep_only in searxng-settings and uses the OpenMetrics measure from #4201.

Key questions

  • What is the cause of the engine refusals?: The cause is not proven. The 2026-11-08 log holds CAPTCHA from duckduckgo with suspended_time=0. It also holds too many requests for superuser, stackoverflow, askubuntu and arxiv. It also holds HTTP 400 from api.stackexchange.com for the three Stack Exchange engines. The candidates are the query rate and a flag on the cluster egress address. [sources: docs/CLUSTER.md:243, docs/CLUSTER.md:249]
  • Which engines should keep_only keep?: Keep an engine only when it shows no CAPTCHA, access denied or too many requests in the 3-day window. The engine must also answer its category from the cluster egress address and from a second egress address. Keep at least one engine for general, it and science. If no general engine qualifies, keep the current set and return the item to New with the evidence. Do not ship a set with no general engine. (best practice) [sources: docs/CLUSTER.md:243, k8s/devops/searxng/configmap.yaml:35, openspec/specs/searxng-service/spec.md:69]
    • Chosen: Data-driven selection with a category floor. It uses the measured refusals and the cross-egress test. It keeps at least one engine for each category.
    • Rejected: Keep the current nine engines. It leaves the refusing engines in place and does not use the reliability window.
    • Rejected: Remove every engine that refused once. It can remove the only general engine and ignores the cross-egress test.
    • Rejected: Add a retry loop. docs/CLUSTER.md:243 and fix(k8s): SearXNG engines time out or return no hit #4094 forbid a retry loop.
  • How should the engine set be verified?: Use uv run devops ci --check --only k8s for the manifest. Use uv run devops k8s searxng-check for the live service. Do not add a unit test that reads the ConfigMap. (best practice) [sources: docs/CLUSTER.md:248, tests/commands/k8s/test_k8s_searxng_check.py:52, src/devops_cli/k8s/searxng_check.py:70]
    • Chosen: Validator and live check. The manifest validator checks the file. The live check holds the running service.
    • Rejected: Unit test over the ConfigMap. A test asserts no value of a config file, and the repository rule forbids it.
    • Rejected: No check. The live check already fails a category with no hit and an engine that must stay off.
  • Must the searxng-service spec change with the ConfigMap?: Yes. The spec names the nine engines. The change must update openspec/specs/searxng-service/spec.md to the selected set. Then the spec and the ConfigMap agree. [sources: openspec/specs/searxng-service/spec.md:69, k8s/devops/searxng/configmap.yaml:35]
  • What proves that the settings add no retry loop?: The settings keep no retry key and no retry loop. The change adds none. The manifest validator uv run devops ci --check --only k8s must exit 0. No validator proves the absence of a retry setting, so the design adds none. (best practice) [sources: docs/CLUSTER.md:243]

Fit

Fits in one pull request.

Suspected block

At least 3 days of searxng_engines_reliability_total per engine after #4201, and a person's same query set from another egress address.

Dependencies

#4201

Activity

  1. added
    source/agent
    type/bug
    scope/k8s
    status/new
    value/medium
    effort/medium
    on Nov 14, 2026
  2. devops-cli-service commented on Nov 14, 2026

    @devops-cli-service
    ContributorAuthor
  3. changed the title [-]fix(k8s): Choose the SearXNG engine set from the engine reliability measure[/-] [+]fix(k8s): Choose the SearXNG engine set by reliability[/+] on Nov 14, 2026
  4. devops-cli-service commented on Nov 14, 2026

    @devops-cli-service
    ContributorAuthor

    The job shortened the title of this item. The summary had 65 characters, and the limit is 60. The type and the scope stay.

    • Before: fix(k8s): Choose the SearXNG engine set from the engine reliability measure
    • After: fix(k8s): Choose the SearXNG engine set by reliability
    • Source of the summary: the background model
  5. devops-cli-service commented on Nov 18, 2026

    @devops-cli-service
    ContributorAuthor

    Refine cannot set this item to Ready at 86358b6 while the items below stay open. The next refine round looks at the item again when they close, or when a person replies in a comment or edits the body.

  6. devops-cli-service commented on Nov 22, 2026

    @devops-cli-service
    ContributorAuthor

    Owner question: See Suspected block in the section Proposed design of the body.

    Options

    1. Decide the question: The job refines the item with your answer.
    2. Leave it to the job: The job records the best-practice answer and goes on.

    Recommendation: Decide the question: only a person can answer it.

    Evidence

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/agentstatus/newtype/bugvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions