Actions
Bug #47905
closedcephadm: cephadm bootstrap is missing structured output. (was: logging to stderr)
Status:
Resolved
Priority:
Normal
Assignee:
Category:
cephadm (binary)
Target version:
% Done:
0%
Source:
Tags:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):
Description
cephadm CLI is currently using stderr for logging instead of stdout for info/debug statements.
$ sudo cephadm bootstrap --mon-ip 192.168.100.99 This is a development version of cephadm. For information regarding the latest stable release: https://docs.ceph.com/docs/octopus/cephadm/install Verifying podman|docker is present... Verifying lvm2 is present... Verifying time synchronization is in place... Unit chronyd.service is enabled and running Repeating the final host check... podman|docker (/bin/podman) is present systemctl is present lvcreate is present Unit chronyd.service is enabled and running Host looks OK Cluster fsid: d4f6aab8-123b-11eb-a761-fa163e1e0188 Verifying IP 192.168.100.99 port 3300 ... Cannot bind to IP 192.168.100.99 port 3300: [Errno 99] Cannot assign requested address Verifying IP 192.168.100.99 port 6789 ... Cannot bind to IP 192.168.100.99 port 6789: [Errno 99] Cannot assign requested address ERROR: Failed to infer CIDR network for mon ip 192.168.100.99; pass --skip-mon-network to configure it later
When trying to redirect stderr then we have no logs anymore.
$ sudo cephadm bootstrap --mon-ip 192.168.100.99 2>/dev/null $
Instead we should have info/debug statements on stdout and failures on stderr.
Something like:
$ sudo cephadm bootstrap --mon-ip 192.168.100.99 2>/dev/null This is a development version of cephadm. For information regarding the latest stable release: https://docs.ceph.com/docs/octopus/cephadm/install Verifying podman|docker is present... Verifying lvm2 is present... Verifying time synchronization is in place... Unit chronyd.service is enabled and running Repeating the final host check... podman|docker (/bin/podman) is present systemctl is present lvcreate is present Unit chronyd.service is enabled and running Host looks OK Cluster fsid: 044268b6-123c-11eb-b572-fa163e1e0188 Verifying IP 192.168.100.99 port 3300 ... Cannot bind to IP 192.168.100.99 port 3300: [Errno 99] Cannot assign requested address Verifying IP 192.168.100.99 port 6789 ... Cannot bind to IP 192.168.100.99 port 6789: [Errno 99] Cannot assign requested address
$ sudo cephadm bootstrap --mon-ip 192.168.100.99 1>/dev/null ERROR: Failed to infer CIDR network for mon ip 192.168.100.99; pass --skip-mon-network to configure it later
This is coming from the logging streamhandler that uses sys.stderr by default. [1]
[1] https://docs.python.org/3/library/logging.handlers.html#logging.StreamHandler
Actions