Bug #47905
cephadm: 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
Related issues
History
#1 Updated by Sebastian Wagner over 3 years ago
- Pull request ID set to 37712
#2 Updated by Sebastian Wagner over 3 years ago
Hm. I see the need and use case for this. How do we proceed here?
would printing a json document at the end of bootstrap help? wdyt?
#3 Updated by Sebastian Wagner over 3 years ago
- Subject changed from cephadm: logging to stderr to cephadm: cephadm bootstrap is missing structured output. (was: logging to stderr)
#4 Updated by Sebastian Wagner over 3 years ago
- Status changed from New to Need More Info
#5 Updated by Sebastian Wagner over 3 years ago
- Duplicated by Cleanup #48140: cephadm: provide dashboard URL + credentials in an friendly way added
#6 Updated by Sebastian Wagner over 2 years ago
- Related to Bug #53652: cephadm "Verifying IP <ip> port 3300" ... -> "OSError: [Errno 99] Cannot assign requested address" added
#7 Updated by Redouane Kachach Elhichou almost 2 years ago
- Status changed from Need More Info to In Progress
- Assignee set to Redouane Kachach Elhichou
#8 Updated by Redouane Kachach Elhichou almost 2 years ago
- Pull request ID changed from 37712 to 45685
#9 Updated by Redouane Kachach Elhichou almost 2 years ago
- Severity changed from 4 - irritation to 3 - minor
#10 Updated by Redouane Kachach Elhichou almost 2 years ago
- Status changed from In Progress to Fix Under Review
#11 Updated by Redouane Kachach Elhichou almost 2 years ago
- Status changed from Fix Under Review to Resolved