Repository navigation
Fix SearXNG updater, guard against empty upstream lists - #14
Merged
Merged
Conversation
searx.space stopped populating the .generator field -- it is now null for all
89 instances it tracks. The SearXNG filter did:
select(.value.generator | . != null) |
select(.value.generator | contains("searxng"))
which therefore matched nothing, so every nightly run wrote an empty instance
list and the service has been dead in both services.json and
services-full.json. searx.space only tracks SearXNG these days, so .version
being present is the check that actually matters; dropping the generator
predicate recovers 39 instances, all of which pass the existing quality gates
(uptime >= 99, A/A+ TLS and HTTP grades, non-privacy ASN).
The bigger problem is that this went unnoticed for weeks: apply_update wrote
whatever it was handed, so a source that changes schema or goes down silently
takes a whole service offline. It now refuses to replace a non-empty instance
list with an empty one, keeping the previous entries and emitting a
::warning:: instead. Stale entries are harmless -- the runtime health check
prunes dead instances anyway -- whereas an empty list is a full outage.
Verified against live searx.space data and the current services-full.json:
searxng 0 -> 39, all 39 survive tools/un-cloudflare.sh, other services
byte-identical, no leftover temp files. Guard tested for normal updates,
empty-list rejection, already-empty services (no false warning), and no-op
runs.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017RU5GnqJo2CsjM4zoPX5jv
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Found while validating instance health after #11.
The bug
searxnghas 0 instances in bothservices.jsonandservices-full.json, so every SearXNG redirect has been falling through to the fallback.searx.spaceis alive and serving 723 KB of data, but it stopped populating the.generatorfield — it is nownullfor all 89 instances it tracks. Our filter did:which matches nothing, so every nightly run wrote an empty list. Bisecting the filter against live data:
searx.spaceonly tracks SearXNG these days, so.versionbeing present is the check that actually matters. Dropping the generator predicate recovers 39 instances, all of which still pass the existing quality gates (uptime ≥ 99, A/A+ TLS and HTTP grades, non-privacy ASN, no.i2p).The bigger problem
This went unnoticed for weeks because
apply_updatewrote whatever it was handed. Any upstream source that changes schema or goes down silently takes a whole service offline — andtent's source (forgejo.sny.sh) is already unreachable, so this would have happened again.apply_updatenow refuses to replace a non-empty instance list with an empty one: it keeps the previous entries and emits a::warning::annotation. Stale entries are harmless — the runtime health check prunes dead instances on every sweep — whereas an empty list is a full service outage.Deliberately narrow: it only triggers on empty-vs-non-empty, so genuine shrinkage (10 → 2) still applies normally.
Validation
Ran the real
apply_updateand the real SearXNG block in a container against livesearx.spacedata and the currentservices-full.json:tools/un-cloudflare.shGuard cases:
After merge I'll dispatch the workflow and confirm searxng lands in the committed JSON.
Not included
tent(source gone) andwhoogle(0 of 5 alive — 2 NXDOMAIN, 1 timeout, 1 non-200) are dead and are candidates for retirement, but that's a product call rather than a bug fix, so I left them alone.🤖 Generated with Claude Code
https://claude.ai/code/session_017RU5GnqJo2CsjM4zoPX5jv