You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
CLI: connectivity check prints diagnostics to stdout, breaking piped output #548
Description: check_connectivity() in collectoss/application/cli/__init__.py (used by @test_connection) reports failures with print(), so they go to stdout. It prints for every failed URL even when a later URL succeeds and the command runs normally, and for network/protocol errors it also prints a full traceback. This puts stray lines at the top of a working command's stdout and breaks piping, e.g. JSON output. The "no way to get connection to the database" error also goes to stdout.
Also, the network/protocol error messages print the exception class ({httpx.NetworkError}) instead of the caught exception ({e}).
Question for maintainers: is CLI output a stable API surface, and should diagnostics go to stderr? Found while working on #547 .
How to reproduce:
Run, with the first URL unreachable and the second reachable: uv run python -c “from collectoss.application.cli import check_connectivity as c; c([‘http://10.255.255.1','http://github.com’])” 2>/dev/null
stdout gets Connectivity test Request 0 Network Error: <class 'httpx.NetworkError'> plus a traceback, even though the function returns True. In normal use this happens when any of chaoss.community, github.com or gitlab.com is slow or unreachable.
Expected behavior:
Diagnostics go to stderr (or logging), and only when the check actually fails, so collectoss <command> > out.json gives valid output. Error messages include the caught exception.
I went through the problem with check_connectivity() printing diagnostics and tracebacks to stdout, which can interfere with piped command output.
I'd like to investigate the existing CLI implementation, fix the output handling, and add regression tests to ensure diagnostics go to stderr while successful command output remains clean.
Could you please assign this issue to me, or let me know if I can proceed with a PR?
Activity
Nimisha987 commentedon Nov 24, 2026
Hi! I'd like to work on this issue.
I went through the problem with
check_connectivity()printing diagnostics and tracebacks to stdout, which can interfere with piped command output.I'd like to investigate the existing CLI implementation, fix the output handling, and add regression tests to ensure diagnostics go to stderr while successful command output remains clean.
Could you please assign this issue to me, or let me know if I can proceed with a PR?
Thanks!