openstack client dumps debug info on console even without specifying --debug option

Bug #1697452 reported by Arseniy Tashoyan
38
This bug affects 8 people
Affects Status Importance Assigned to Milestone
python-novaclient
Fix Released
High
Sean Dague
python-openstackclient
Invalid
Undecided
Unassigned

Bug Description

For some commands, openstack client dumps details of HTTP requests and responses on the console. It dumps such details on stderr. This debug output breaks automation scripts that expect standard JSON.
For example, the command below - see attachment for the output

openstack --insecure server list --name ivt-jenkins --format json > openstack_server.stdout.log 2>openstack_server.stderr.log

(Sorry, cannot attach stdout and stderr as separate files, this issue tracker accepts only one attachment.)
However, this command does not have such problem and reports only the requested info:

openstack --insecure network list --name ivt-net --format json

[
  {
    "Subnets": "dd115db3-fb1c-46df-97ac-ca5fd6681d3e",
    "ID": "2763410f-3618-4f50-a1ca-e14b22ae9a34",
    "Name": "ivt-net"
  }
]

Installed software:
openstacksdk (0.9.16)
os-client-config (1.27.0)
python-augeas (0.5.0)
python-cinderclient (2.2.0)
python-dateutil (1.5)
python-dmidecode (3.10.13)
python-glanceclient (2.7.0)
python-keystoneclient (3.10.0)
python-neutronclient (6.3.0)
python-novaclient (9.0.0)
python-openstackclient (3.11.0)

Revision history for this message
Arseniy Tashoyan (tashoyan-deactivatedaccount) wrote :
Revision history for this message
Dr. Jens Harbott (j-harbott) wrote :

This seems to be cause by python-novaclient==9.0.0, it disappear if I downgrade that to 8.0.0.

Strangely also volume commands seem to be affected.

Changed in python-novaclient:
status: New → Confirmed
Revision history for this message
Matt Riedemann (mriedem) wrote :

By 'volume commands' do you mean OSC volume commands? Because that would be cinderclient and point to a possible shared common library problem.

Revision history for this message
Dr. Jens Harbott (j-harbott) wrote :

"volume show" does a "server show" internally in order to display attachments.

Looking at the diff between 8.0.0 and 9.0.0 it seems that the change in I60c8a023cff92f8b6f37a4a14b6193c3efaa19a8 to novaclient/v2/client.py is the culprit, adding logger.addHandler(logging.StreamHandler()). Not sure about a proper fix, though.

Revision history for this message
Matt Riedemann (mriedem) wrote :

Jens found out this is the problem:

https://review.openstack.org/#/c/463508/5/novaclient/v2/client.py

sdague is going to do a partial revert.

Changed in python-openstackclient:
status: New → Invalid
Changed in python-novaclient:
status: Confirmed → Triaged
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-novaclient (master)

Fix proposed to branch: master
Review: https://review.openstack.org/474600

Changed in python-novaclient:
assignee: nobody → Sean Dague (sdague)
status: Triaged → In Progress
Sean Dague (sdague)
Changed in python-novaclient:
importance: Undecided → High
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-novaclient (master)

Reviewed: https://review.openstack.org/474600
Committed: https://git.openstack.org/cgit/openstack/python-novaclient/commit/?id=ddb386b2dffaf06077c2a0768c56ed5642d216dc
Submitter: Jenkins
Branch: master

commit ddb386b2dffaf06077c2a0768c56ed5642d216dc
Author: Sean Dague <email address hidden>
Date: Thu Jun 15 10:26:41 2017 -0400

    Revert "client.logger.warning wrongly used in migrations"

    This is a partial revert of the previous patch. The inline setup of
    the logger ends up causing issues when this is consumed by other
    libraries that want control over the logger.

    Closes-Bug: #1697452

    This reverts commit 9a272014167390217351dd5a60f50f518f4ae600.

    Change-Id: I1d61d4952aef1039e72a2aac629cb13a6a15d7b2

Changed in python-novaclient:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/python-novaclient 9.0.1

This issue was fixed in the openstack/python-novaclient 9.0.1 release.

Revision history for this message
Arseniy Tashoyan (tashoyan-deactivatedaccount) wrote :

I confirm: the problem does not reproduce with python-novaclient 9.0.1. Thank you for the fix.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.