Conversation
…is unreachable When the traefik service is stopped but the node is reachable, list-routes raised a generic Exception on ConnectionRefusedError, printing a full traceback and aborting the task. This is a known, expected condition (the core UI already detects and labels it via get-status), so it doesn't need to fail here. get_route() already supports returning an empty result for this exact case via ignore_error, and the output schema already lists an empty array as a valid result. I apply the same convention to the primary router-listing call: log one line to stderr and return an empty list with a normal exit code, instead of raising.
Returning an empty list on a stopped traefik removed the only fallback signal for this condition: if the core-side get-status check that labels it explicitly ever misses a case, the UI would show fewer routes with no error at all. Keep failing here as a safety net, but stop at one clean stderr line instead of an unhandled exception and its three-level traceback.
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.
Related to NethServer/dev#8171
When traefik is stopped but the node itself is reachable, list-routes raised a generic Exception on ConnectionRefusedError, printing a full three-level traceback and aborting the task.
ns8-core PR #1317 now detects this exact condition separately via get-status and labels it in the UI ("Traefik is stopped on {node}"). I first tried making list-routes return an empty list on success instead of failing, but that removes the only fallback: if the get-status check ever misses a case, the UI would silently show fewer routes with no error at all.
Instead, this keeps the task failing (aborted, same as before) so that fallback stays in place, but replaces the unhandled exception with a single clean stderr line and a plain exit 1. No more traceback noise in the journal, no loss of signal.
Tested on a live cluster with traefik stopped on one node: one clean stderr line, task status aborted (1), no traceback.