Skip to main content
Privacy-First AI

Searxng Troubleshooting: 5 Errors I Hit and Fixed

· · 7 min read

I set up Searxng three months ago to give my local Ollama instance a search backend without pinging Google every time it needed current information. The idea is solid: a privacy-respecting metasearch engine you host yourself, aggregating results from 70+ search engines, no tracking, no logs. In practice, Searxng has been reliable, but getting there involved a few specific, maddening errors that don’t have obvious solutions in the logs.

๐ŸŽฏ Not sure if this will run on your hardware?Use our free Local LLM Hardware Checker โ€” pick your GPU and RAM, see which models will run with real tokens/sec estimates.
Check my hardware โ†’

I’m documenting them here because the error messages are vague enough that they’ll probably be your first stop when you hit the same wall.

Error 1: YAML Configuration Parse Failure on Startup

First attempt: I pulled the official Searxng Docker image, mapped a volume for /etc/searxng, and dropped in my customized settings.yml. Launched it.

The container exited immediately with:

searxng | YAML: mapping values are not allowed here
searxng | in "settings.yml", line 42, column 18

Line 42 was my attempt to add a custom search category. I had:

categories:
  news: News
  - reddit: Reddit

See the problem? YAML is whitespace-sensitive, and I’d mixed list syntax with dictionary syntax. That hyphen shouldn’t be there. It should be:

categories:
  news: News
  reddit: Reddit

What actually fixed it: I ran the config through a YAML validator before restarting. There’s no Searxng-specific tool for this, but yamllint catches it immediately. Install it locally, run yamllint settings.yml, and it tells you exactly which line is broken and why. Sounds obvious in retrospect, but when you’re tired and the error message points to column 18, you’re reading the whole file looking for stray characters.

Error 2: Connection Timeout to Upstream Search Engines

After fixing the YAML, Searxng started. Queries ran. Then requests started timing out.

ERROR: Timeout on https://google.com/search?q=test - - Connection timeout

This one was interesting because it felt intermittent. Some searches worked fine. Others died. My first instinct was a network connectivity issue, but ping google.com worked fine from the container.

I checked the Searxng logs more carefully and noticed the timeout was specifically on Google and Bing. The default settings.yml` has rate-limiting and request delays built in to avoid hammering search engines. I'd been running with the default 1-second delay between requests, but Google's been increasingly aggressive about blocking metadata requests from unusual sources. The actual issue: my home IP had triggered rate limiting on Google's side. The container was correctly trying to hit Google, but Google was silently dropping the connection after a few requests.

What fixed it: I disabled Google and Bing as upstream engines and leaned on DuckDuckGo, Startpage, and Qwant instead. Not a fix to the error itself, but a realistic workaround. You can't force Google to cooperate if they've decided your IP is suspicious. The alternative is rotating proxies, which adds complexity I didn't want. In the settings.yml, you disable engines under the engines: section:

- name: google
  engine: google
  disabled: true

- name: bing
  engine: bing
  disabled: true

After that, requests went through cleanly. Latency improved, too.

Error 3: Redis Connection Refused on Startup

A few weeks in, I wanted to add result caching to speed up repeated queries. The docs mention Searxng can use Redis as an optional backend. I added it to my docker-compose and set the Redis socket path in settings:

redis:
  url: redis://redis:6379/0

Container logged:

Connection refused: ('redis', 6379)

My docker-compose had the Redis service defined, and it was clearly running (I verified with docker ps), but Searxng couldn't reach it. The issue: network isolation. Searxng was in one custom network, Redis in another. Docker's inter-container DNS only works within the same network.

What fixed it: Make sure both services are on the same Docker network. In docker-compose, that's straightforward:

version: '3.8'

services:
  searxng:
    image: searxng/searxng:latest
    networks:
      - searx-net
    ports:
      - "8888:8080"

  redis:
    image: redis:7-alpine
    networks:
      - searx-net

networks:
  searx-net:
    driver: bridge

Both services on the same network means they can resolve each other's hostnames. Restart both, and the connection works. This is a Docker gotcha, not a Searxng bug, but it bites people coming from single-container setups.

Error 4: The Mysterious 502 Bad Gateway (and Why It Took Hours)

Three weeks ago, Searxng started returning 502 Bad Gateway errors on every request. The container was running. Logs showed no errors. Just nothing.

I assumed it was a memory issue. Searxng aggregates results from dozens of engines in parallel, so under load it can use more RAM than you'd expect. I checked: docker stats showed the container using 180MB of a 512MB limit. Not maxed out.

I checked the Searxng error logs directly by shelling into the container:

docker exec -it searxng bash
cat /var/log/searxng/searxng.log

Nothing. The access logs showed requests coming in and returning 502, but no traceback. This meant the web server (Uwsgi) was crashing between accepting the request and processing it, which usually points to a segfault or uncaught exception in a C extension.

I rebuilt the container fresh. Same issue. Then I checked my Searxng config and realized I'd added a custom plugin for result ranking that wasn't properly tested. It was a small Python script in a mounted volume:

result_filter: /etc/searxng/custom_rank.py

That file had a syntax error I'd missed. When Searxng tried to load it on startup, it crashed silently.

What fixed it: Validation. Don't use custom plugins unless you're sure they work. If you do, test them separately first. In this case, I removed the custom filter, restarted, and traffic flowed again. Then I fixed the Python file and re-added it once I'd tested it in isolation.

The lesson: 502 errors in containers are often silent failures in initialization. Check mounted volumes, especially custom scripts. The logs won't always help you.

Error 5: Memory Leak Under Sustained Load

This one took longest to diagnose because it wasn't an error message. It was a slow degradation. After running for a few hours under normal use, Searxng would become sluggish. After 12 hours, requests would time out. After 24 hours, the container would OOM-kill itself.

I'd allocated 512MB of RAM initially, thinking that was sufficient for a search aggregator. Turns out, when you're pulling results from 50+ sources in parallel and keeping them in memory for a few seconds while ranking, pagination, and caching, 512MB isn't quite enough. The container wasn't hitting the limit immediately, but memory fragmentation combined with Python's garbage collection behavior meant the process was slowly filling up.

This wasn't a code error. It was a resource allocation problem. The default Searxng container doesn't have explicit memory limits in many tutorials.

What fixed it: I gave it more headroom. First, I increased the Docker memory limit to 1GB:

services:
  searxng:
    image: searxng/searxng:latest
    mem_limit: 1g
    memswap_limit: 1g

Second, I enabled Uwsgi worker recycling to force process restarts every few hours, which resets memory:

uwsgi:
  max-requests: 1000
  max-requests-delta: 100

This recycles a worker process after it's handled 900โ€“1000 requests, preventing slow accumulation. After both changes, Searxng ran stable for weeks without degradation.

How to Debug Searxng Issues Without Losing Your Mind

If you're hitting errors that don't match these five, here's the systematic approach I use:

First, check whether the issue is in Searxng itself or its environment. Run a simple test query and watch the logs in real time: docker logs -f searxng. If the logs are silent, the crash is happening before logging starts (usually in initialization). If you see errors, they'll point you somewhere.

Second, validate your config before restarting. YAML syntax errors are the number-one cause of mysterious failures. Third, test in isolation. If you're adding custom code, plugins, or unusual configurations, test them separately first.

Finally, give yourself adequate resources. Searxng is lightweight compared to many services, but underfunded containers lead to slow failures that are harder to debug than explicit errors.

One more thing: the Searxng documentation and community are genuinely helpful. If you're stuck on something I haven't covered here, the GitHub issues are searchable and the maintainers actually respond. Don't spin your wheels alone.

FAQ

Can Searxng run on a Raspberry Pi?

Yes, but barely. A Pi 4 with 4GB of RAM can run Searxng, but it'll be slow under concurrent requests. Expect 2โ€“5 second response times. Pi 5 handles it better. If you're running multiple services on the same Pi, you'll likely hit resource contention.

How much RAM does Searxng need?

Minimum 256MB to start. Recommended 512MB to 1GB for stable operation under normal load. If you're hitting 50+ search engines per query and caching results, 1GB is safer.

Does Searxng work offline?

No. Searxng is a metasearch engine, meaning it aggregates results from other search engines. It needs internet connectivity to reach those upstream sources. You can configure it to use only a subset of engines, but at least some upstream connectivity is required.

How do I integrate Searxng with Ollama or Open WebUI?

Open WebUI has native Searxng support under Settings > Web Search. Point it to your Searxng instance URL (e.g., http://searxng:8080) and enable web search in your prompts. Ollama doesn't have built-in search, but you can use tools like Continue.dev or custom scripts to call Searxng's JSON API.

What's the difference between Searxng and the older Searx?

Searxng is the actively maintained fork of Searx. Searx development slowed, so the community forked it as Searxng. Use Searxng. It has more engines, better Docker support, and actual maintenance.

Explore Searxng in our AI Homelab Toolkit.

Share this article