wigolo icon indicating copy to clipboard operation
wigolo copied to clipboard

SEARXNG_MODE=docker is unreachable in the container image: checkPythonAvailable() gates it, so an external SearXNG cannot be used

Open seanpham99 opened this issue 1 month ago • 0 comments

Summary

SEARXNG_MODE=docker cannot work in the official container image, because checkPythonAvailable() is evaluated before searxngMode is ever read. The error message recommends setting that very variable, so the documented remedy does not resolve the failure.

A Node-only image can never satisfy the native branch, which means there is no supported way to point wigolo at an external SearXNG that already exists (a sidecar container, a shared instance across projects, a remote host). This matters for anyone who wants the meta-engine without running a Python venv inside wigolo.

Environment

  • image: ghcr.io/knockoutez/wigolo:0.2.1
  • Node only, no python3 on PATH
  • an external SearXNG is running and reachable from the container on the compose network:
    $ docker exec <wigolo> node -e "fetch('http://searxng:8080/search?q=test&format=json').then(r=>console.log(r.status))"
    200
    
  • WIGOLO_SEARCH=hybrid, WIGOLO_SEARXNG_URL=http://searxng:8080, WIGOLO_EAGER_WARMUP=1

Reproduction

$ docker exec <wigolo> node /app/dist/index.js warmup --searxng
[wigolo warmup] Checking search engine (searxng)...
[wigolo warmup] searxng failed: Python 3 not found — install Python 3 or set SEARXNG_MODE=docker
[wigolo warmup]   Search engine: no_python

Following the message's own advice changes nothing:

$ docker exec -e SEARXNG_MODE=docker -e SEARXNG_URL=http://searxng:8080 <wigolo> \
    node /app/dist/index.js warmup --searxng
[wigolo warmup] searxng failed: Python 3 not found — install Python 3 or set SEARXNG_MODE=docker
[wigolo warmup]   Search engine: no_python

At runtime the daemon reports the same state:

GET /health -> {"status":"degraded","searxng":"unavailable","browsers":"ready","cache":"active"}

and logs, once per boot:

{"level":"warn","msg":"search engine sidecar configured but not installed; using fallback engines. Set WIGOLO_SEARXNG_URL or run `wigolo warmup --searxng`","module":"server"}

Search still returns results — the other 17 engines cover it — which is why this is easy to miss. It is a silent capability reduction, not an outage.

Why it fails

In dist/searxng/bootstrap.js the readiness check is ordered so the Python probe gates everything, including the docker path:

const state = getBootstrapState(dataDir);
if (state?.status === 'ready') return 'ready'

if (!checkPythonAvailable()) {
  reporter.fail('searxng', 'Python 3 not found — install Python 3 or set SEARXNG_MODE=docker')
  return { searxng: 'no_python' }
}

searxngMode is read elsewhere (envStr('SEARXNG_MODE', 'native', …)) and the docker-specific messaging exists elsewhere in the tree, so the mode is clearly intended to be honoured — it is simply never reached in an image without Python.

Note also that a plain warmup (no --searxng) reports Search engine: skipped — using multi-engine core backend, so with WIGOLO_EAGER_WARMUP=1 and no explicit flag the sidecar is not attempted at all and the degradation goes unnoticed.

What would fix it

Any one of these:

  1. Move the mode check above checkPythonAvailable() — when SEARXNG_MODE=docker, skip the Python probe entirely. Smallest change, and it makes the existing error message truthful.
  2. Add an explicit external/preexisting mode (e.g. SEARXNG_MODE=external) that only health-checks SEARXNG_URL and never bootstraps a local sidecar. This is the shape we actually want: the SearXNG already exists and is reachable, we just want to use it.
  3. Document that WIGOLO_SEARXNG_URL is only consumed after a successful local bootstrap, so operators are not led to believe pointing it at an existing instance is sufficient.

Option 2 is the one that would let us delete a workaround: we currently run SearXNG as its own compose service and accept that wigolo silently drops to 17/18 engines, because the only other route is baking Python into a derived image of a pinned upstream release.

Happy to test a patch or provide more detail on the code path.

seanpham99 avatar Oct 04 '26 02:10 seanpham99