Repository navigation
fix: /vitals and /services report unavailable data instead of failing - #15
Merged
Merged
Conversation
…ry as success SystemGate runs unprivileged (no CAP_NET_ADMIN / restricted /proc access) so psutil.net_connections raises AccessDenied -> endpoint returns 200 with results: [], which a caller cannot distinguish from a host with zero listening services Found by the GLM relay (systemgate__systemgate__main.py_p0__bugs__0), confirmed by 3 votes and Corti. Regression test to add: Monkeypatch psutil.net_connections to raise psutil.AccessDenied and assert /services returns 200 with status "unavailable" and errors containing "service_enumeration_unavailable" rather than an empty results list with no error marker. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SYSTEMGATE_DISK_PATH set to a nonexistent or unmountable path (or the mount disappearing at runtime) -> psutil.disk_usage raises OSError, which unlike the temperatures probe is uncaught -> /vitals returns a 500 instead of degraded telemetry Found by the GLM relay (systemgate__systemgate__main.py_p0__bugs__1), confirmed by 3 votes and Corti. Regression test to add: Set SYSTEMGATE_DISK_PATH to a nonexistent path and assert /vitals returns 200 with a degraded/unavailable disk entry instead of a 500. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
8fdf01d caught the disk_usage OSError but /vitals still called disk._asdict() on None, so it returned 500 anyway. Report "disk": null instead and test it with an unreadable SYSTEMGATE_DISK_PATH. Also drop a dead assignment in /services and assert the new unavailable status in the denied-listing test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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 by the GLM bug relay, confirmed by votes, reviewed by Claude.
/vitalsreturned 500 whenSYSTEMGATE_DISK_PATHis invalid; it now returnsdisk: null(nothing in Pi, ToolGate or the dashboard readsdisk)./servicesswallowedpsutil.AccessDeniedand reported an empty inventory as success; it now returnsstatus: "unavailable"witherrors: ["service_enumeration_unavailable"].Local: 72 passed, 8 skipped; file-size check ok.
🤖 Generated with Claude Code