Project

General

Profile

Actions

Bug #47905

closed

cephadm: cephadm bootstrap is missing structured output. (was: logging to stderr)

Added by Dimitri Savineau over 3 years ago. Updated about 2 years ago.

Status:
Resolved
Priority:
Normal
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 2 (0 open2 closed)

Related to Orchestrator - Bug #53652: cephadm "Verifying IP <ip> port 3300" ... -> "OSError: [Errno 99] Cannot assign requested address"Closed

Actions
Has duplicate Orchestrator - Cleanup #48140: cephadm: provide dashboard URL + credentials in an friendly wayDuplicate

Actions
Actions

Also available in: Atom PDF