Bug 1738576 - ceph-volume prints errors to stdout with --format json
Summary: ceph-volume prints errors to stdout with --format json
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Ceph Storage
Classification: Red Hat Storage
Component: Ceph-Volume
Version: 4.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: rc
: 4.0
Assignee: Christina Meno
QA Contact: Vasishta
URL:
Whiteboard:
: 1756366 (view as bug list)
Depends On:
Blocks: 1729267 1733577 1738236
TreeView+ depends on / blocked
 
Reported: 2019-08-07 13:46 UTC by Guillaume Abrioux
Modified: 2020-01-31 12:47 UTC (History)
7 users (show)

Fixed In Version: ceph-14.2.4-81.el8cp, ceph-14.2.4-24.el7cp
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-01-31 12:46:52 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github ceph ceph pull 27675 0 None closed ceph-volume: print most logging messages to stderr 2021-02-19 09:24:12 UTC
Github ceph ceph pull 29547 0 'None' closed ceph-volume: never log to stdout, use stderr instead 2021-02-19 09:24:12 UTC
Red Hat Product Errata RHBA-2020:0312 0 None None None 2020-01-31 12:47:23 UTC

Description Guillaume Abrioux 2019-08-07 13:46:45 UTC
Description of problem:

Cloned from https://tracker.ceph.com/issues/38548

When requesting ceph-volume to print json output, messages and errors are printed to stdout.
The printed json can't be consumed given that it's seen as invalid json.

seen on ceph version 14.2.2-298-g0bdfdc6 (0bdfdc6b5433736bd11c321ecfa559f3b30f9187) nautilus (stable)

How reproducible:
100%

Steps to Reproduce:
1. ask ceph-volume to output using --format json


Actual results:
ceph-volume outputs json with extra messages in addition on stdout, which makes the json as invalid.

Expected results:
ceph-volume outputs only json data on stdout.


Typical output:

[root@osd1 /]# ceph-volume simple scan /dev/sda1 --stdout 2>/dev/null
Running command: /usr/sbin/cryptsetup status /dev/sda1
Running command: /bin/mount -v /dev/sda1 /tmp/tmp_NrdoM
stdout: mount: /dev/sda1 mounted on /tmp/tmp_NrdoM.
Running command: /bin/umount -v /tmp/tmp_NrdoM
{
"active": "ok", 
"ceph_fsid": "f3ea8c89-3b32-4abd-8aa9-07d1e6319e3b", 
"cluster_name": "ceph", 
"data": {
"path": "/dev/sda1", 
"uuid": "de0465d1-b00b-4bd6-b1da-92e8f6cf0aef" 
}, 
"fsid": "de0465d1-b00b-4bd6-b1da-92e8f6cf0aef", 
"journal": {
"path": "/dev/sdc1", 
"uuid": "b8e4707c-c28a-45fb-913f-6680a5f3b2d4" 
}, 
"journal_uuid": "b8e4707c-c28a-45fb-913f-6680a5f3b2d4", 
"keyring": "AQDSiUld6XdXGxAAksb27KOAv5/byZ9ybu8J9w==", 
"magic": "ceph osd volume v026", 
"none": "", 
"ready": "ready", 
"require_osd_release": 14, 
"type": "filestore", 
"whoami": 10
}
[root@osd1 /]#

Comment 11 Vasishta 2019-12-19 05:58:14 UTC
$ sudo ceph-volume simple scan /dev/sdb1 --stdout 2> /dev/null
{
    "active": "ok", 
    "ceph_fsid": "1c164a8d-f6c2-42c5-99a5-cc9d8504a293", 
    "cluster_name": "ceph", 
    "data": {
        "path": "/dev/sdb1", 
        "uuid": "17e6ec1b-3dc6-44b5-bc65-ffe40c46a11a"
    }, 
    "fsid": "17e6ec1b-3dc6-44b5-bc65-ffe40c46a11a", 
    "journal": {
        "path": "/dev/sdd1", 
        "uuid": "2af4d577-e052-457a-85a6-8df872885957"
    }, 
    "journal_uuid": "2af4d577-e052-457a-85a6-8df872885957", 
    "keyring": "AQBo4vldLJGgFRAAULX66Xr2cZhPr9Bs0rFh0A==", 
    "magic": "ceph osd volume v026", 
    "none": "", 
    "ready": "ready", 
    "require_osd_release": 14, 
    "type": "filestore", 
    "whoami": 21
}

$ rpm -qa|grep ceph-osd
ceph-osd-14.2.4-27.el7cp.x86_64

Moving to VERIFIED state

Regards,
Vasishta Shastry
QE, Ceph

Comment 12 Vasishta 2019-12-26 15:03:38 UTC
*** Bug 1756366 has been marked as a duplicate of this bug. ***

Comment 15 errata-xmlrpc 2020-01-31 12:46:52 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:0312


Note You need to log in before you can comment on or make changes to this bug.