Skip to content

fix: read a missing pgrep or ip as VPN down - #73

Merged
catinspace-au merged 1 commit into
mainfrom
fix/vpn-check-missing-tool
Oct 11, 2026
Merged

catinspace-au merged 1 commit into
mainfrom
fix/vpn-check-missing-tool

Conversation

@catinspace-au

Copy link
Copy Markdown
Contributor

Both open Renovate PRs (#71 ruff, #72 watchtower) fail one unit test, and neither bump is the cause. Renovate PRs route to arc-native-4cpu (org var GH_RUNNER_RENOVATE), which has no pgrep or ip. Human PRs run on ubuntu-latest, which has both, so main never saw it.

The defect is real though. _check_openvpn and _check_wireguard let FileNotFoundError escape, and update_metrics calls both on every /metrics scrape. scalo's observability server turns that into a 500 for the whole scrape, which is exactly what test_wireguard_mode_scrapes_without_a_running_interface says must not happen.

  • both checks now return False when their binary is missing
  • liveness does not change: scalo's HealthManager already reads an exception in a live check as False
  • new parametrised test covers both checks with subprocess.run raising FileNotFoundError
  • reproduced locally with PATH stripped to the venv: fails on main with No such file or directory: 'pgrep', passes with this change

Done when this merges and #71/#72 go green on a rebase.

_check_openvpn and _check_wireguard let FileNotFoundError escape when the host lacks pgrep or iproute2. The /metrics scrape calls both, so the whole scrape failed instead of reporting zero peers. Renovate PRs run on arc-native-4cpu, which has neither binary, and failed test_wireguard_mode_scrapes_without_a_running_interface on that.

Both checks now return False when their tool is missing. Liveness is unchanged: an exception and False both fail the probe.
@catinspace-au
catinspace-au requested a review from a team as a code owner October 11, 2026 22:18
@catinspace-au
catinspace-au merged commit f8973ff into main Oct 11, 2026
13 checks passed
@catinspace-au
catinspace-au deleted the fix/vpn-check-missing-tool branch October 11, 2026 22:26
@github-actions

Copy link
Copy Markdown
Contributor

Released in v2.1.19 -- https://github.com/hyperi-io/culvert/releases/tag/v2.1.19

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant