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 engines that refuse queries. duckduckgo raises a CAPTCHA with no suspension, so the next query asks it again. The Stack Exchange engines return too many requests. The cause is not proven. This item selects the engine set from a 3-day reliability window and a cross-egress query set. It then updates searxng-settings, the searxng-service spec and docs/CLUSTER.md.

Acceptance criteria

Requirement: Engine set from the selection

The searxng-settings ConfigMap SHALL keep only the engines that the 3-day reliability window and the cross-egress query set select, and no other.

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 each of 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

OFF_ENGINES in src/devops_cli/k8s/searxng_check.py SHALL name each engine that the selection removes from keep_only.

Scenario: Removed engine list

  • WHEN uv run pytest tests/k8s/test_searxng_check.py runs after the change
  • THEN The test passes, and its expected tuple holds each engine that the ConfigMap no longer keeps.

Existing Tool Considered

No alternatives check has run. SearXNG is the open, maintained service that runs the engines and reports unresponsive_engines. It lacks a selection of an engine set from a multi-day reliability window and a second egress address. The change builds no code, so it has no build cost. It edits the keep_only list, the spec, the docs/CLUSTER.md bullet and one tuple. It proves the result with uv run devops ci --check --only k8s and uv run devops k8s searxng-check.

Key questions

  • What is the cause of the engine refusals?: The cause is not proven. The 2026-11-08 log holds a CAPTCHA from duckduckgo with no suspension. It also holds too many requests for superuser, stackoverflow, askubuntu and arxiv, and HTTP 400 from api.stackexchange.com. The candidates are the query rate and a flag on the cluster egress address. The 3-day window and the cross-egress query set decide between them. [sources: docs/CLUSTER.md:257]
  • Which engines should keep_only keep?: Keep an engine only when the 3-day window shows no CAPTCHA, access denied or too many requests. 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. (best practice) [sources: docs/CLUSTER.md:257, openspec/specs/searxng-service/spec.md:71]
    • Chosen: Data-driven selection with a category floor. It uses the measured refusals and the cross-egress query set, and it keeps at least one engine for each category.
    • Rejected: Keep the current six engines. It keeps an engine that refuses and it ignores the reliability window.
    • Rejected: Remove every engine that refused once. It can remove the only general engine and it ignores the cross-egress query set.
    • Rejected: Add a retry loop. docs/CLUSTER.md:257 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. Add no unit test that reads the ConfigMap. (best practice) [sources: docs/CLUSTER.md:263, src/devops_cli/k8s/searxng_check.py:73, tests/k8s/test_searxng_check.py]
    • Chosen: Validator and live check. The manifest validator checks the file, and the live check names a category with no hit.
    • Rejected: Unit test over the ConfigMap. A test asserts no value of a config file, so it cannot hold the engine set.
    • Rejected: No check. The change would have no proof that the running service answers each category.
  • Must the searxng-service spec and docs/CLUSTER.md change with the ConfigMap?: Yes. openspec/specs/searxng-service/spec.md:71 names the six kept engines and the ten engines that stay off. docs/CLUSTER.md:257 states the set and its reasons. The change updates both, and the spec text then matches the ConfigMap. [sources: openspec/specs/searxng-service/spec.md:71, docs/CLUSTER.md:257]
  • Does the settings change add a retry loop?: No. docs/CLUSTER.md:257 states that the settings add no retry loop, and fix(k8s): SearXNG engines time out or return no hit #4094 forbids one. The change adds no retry key. No validator proves the absence of a retry setting, so the review checks the diff. [sources: docs/CLUSTER.md:257]
  • Must OFF_ENGINES change with the engine set?: Yes. OFF_ENGINES in src/devops_cli/k8s/searxng_check.py:73 lists the engines that must stay off. The check fails a hit of one of them. Each engine that the selection removes joins that tuple. tests/k8s/test_searxng_check.py updates its expected list. (best practice) [sources: src/devops_cli/k8s/searxng_check.py:73, tests/k8s/test_searxng_check.py, openspec/specs/k8s-searxng-check/spec.md:48]
    • Chosen: Add each removed engine to OFF_ENGINES. The live check then names an engine that a later change adds back to keep_only.
    • Rejected: Leave OFF_ENGINES unchanged. A removed engine that answers again would pass the live check with no problem.

Fit

Fits in one pull request.

Suspected block

At least 3 days of searxng_engines_reliability_total for each engine after #4201 merges, and a person's same query set from a second 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

  7. devops-cli-service commented on Nov 27, 2026

    @devops-cli-service
    ContributorAuthor

    Owner question: See Suspected block and Watched files 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

  8. devops-cli-service commented on Nov 29, 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