Project

General

Profile

Bug #47905

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

Added by Dimitri Savineau 3 months ago. Updated 2 months ago.

Status:
Need More Info
Priority:
Normal
Assignee:
-
Category:
cephadm (binary)
Target version:
% Done:

0%

Source:
Tags:
Backport:
Regression:
No
Severity:
4 - irritation
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature:

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

Duplicated by Orchestrator - Cleanup #48140: cephadm: provide dashboard URL + credentials in an friendly way Duplicate

History

#1 Updated by Sebastian Wagner 2 months ago

  • Pull request ID set to 37712

#2 Updated by Sebastian Wagner 2 months 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 2 months 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 2 months ago

  • Status changed from New to Need More Info

#5 Updated by Sebastian Wagner 2 months ago

  • Duplicated by Cleanup #48140: cephadm: provide dashboard URL + credentials in an friendly way added

Also available in: Atom PDF