fix(auditor): don't heal when the LAPI is unreachable #4

Merged
patrick merged 1 commits from fix/lapi-unreachable-no-heal into main 2026-10-21 20:51:27 +00:00
Owner

get_remote_lapi_truth() returned {} when 'cscli decisions list' failed, which is
indistinguishable from "no active bans". reconcile() then saw every kernel ban as extra,
reported membership_mismatch, and the heal restarted crowdsec-firewall-bouncer. A LAPI
outage would do that on every node at once, every heal interval.

Raise LapiUnavailableError instead. reconcile() propagates it, so the main loop records
it as last_error and retries in 60s without healing; post-heal verification records it
as verify_error. A genuinely empty decision list still returns {} as before.

Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com

get_remote_lapi_truth() returned {} when 'cscli decisions list' failed, which is indistinguishable from "no active bans". reconcile() then saw every kernel ban as extra, reported membership_mismatch, and the heal restarted crowdsec-firewall-bouncer. A LAPI outage would do that on every node at once, every heal interval. Raise LapiUnavailableError instead. reconcile() propagates it, so the main loop records it as last_error and retries in 60s without healing; post-heal verification records it as verify_error. A genuinely empty decision list still returns {} as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
patrick added 1 commit 2026-10-21 20:51:17 +00:00
fix(auditor): don't heal when the LAPI is unreachable
CI / Unit tests (push) Successful in 4s
CI / Unit tests (pull_request) Successful in 3s
8c8be8ec63
get_remote_lapi_truth() returned {} when 'cscli decisions list' failed, which is
indistinguishable from "no active bans". reconcile() then saw every kernel ban as extra,
reported membership_mismatch, and the heal restarted crowdsec-firewall-bouncer. A LAPI
outage would do that on every node at once, every heal interval.

Raise LapiUnavailableError instead. reconcile() propagates it, so the main loop records
it as last_error and retries in 60s without healing; post-heal verification records it
as verify_error. A genuinely empty decision list still returns {} as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
patrick merged commit 57ed6cfc1c into main 2026-10-21 20:51:27 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: patrick/threat-engine-agent#4