User new log style where Logger.exception() is used by passing an exception object as the first argument.

Bug #1529534 reported by Hua Wang on 2015-12-28
14
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Undecided
LiuNanke
Glance Client
Undecided
HouMing Wang
Magnum
Undecided
Hua Wang
OpenStack Compute (nova)
Wishlist
Unassigned
OpenStack DBaaS (Trove)
Wishlist
Trevor McCasland
python-neutronclient
Low
Unassigned
python-troveclient
Undecided
Unassigned

Bug Description

Use new log style where Logger.exception() is used by passing an exception object as the first argument[1].

[1]http://docs.openstack.org/developer/oslo.log/usage.html#no-more-implicit-conversion-to-unicode-str

Hua Wang (humble00) on 2015-12-28
Changed in magnum:
assignee: nobody → Hua Wang (humble00)
description: updated
Hua Wang (humble00) on 2015-12-28
summary: - User new log style where Logger.error() is used by passing an exception
- object as the first argument.
+ User new log style where Logger.exception() is used by passing an
+ exception object as the first argument.
Hua Wang (humble00) on 2015-12-28
description: updated

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

Changed in magnum:
status: New → In Progress
Changed in ironic:
assignee: nobody → Hou Ming Wang (houming-wang)
Changed in manila:
assignee: nobody → Hou Ming Wang (houming-wang)
Changed in sahara:
assignee: nobody → Hou Ming Wang (houming-wang)
Changed in python-keystoneclient:
assignee: nobody → Hou Ming Wang (houming-wang)
Changed in python-neutronclient:
assignee: nobody → Hou Ming Wang (houming-wang)
Changed in python-glanceclient:
assignee: nobody → Hou Ming Wang (houming-wang)
Shuquan Huang (shuquan) on 2015-12-28
Changed in python-ironicclient:
assignee: nobody → Shuquan Huang (shuquan)

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

Changed in python-ironicclient:
status: New → In Progress
Shuquan Huang (shuquan) on 2015-12-28
Changed in ironic-inspector:
assignee: nobody → Shuquan Huang (shuquan)
Changed in ironic-lib:
assignee: nobody → Shuquan Huang (shuquan)
Changed in ironic-python-agent:
assignee: nobody → Shuquan Huang (shuquan)
Changed in ceilometer:
assignee: nobody → Chaozhe Chen (chaozhe-chen)
Changed in python-ceilometerclient:
assignee: nobody → Chaozhe Chen (chaozhe-chen)
Changed in trove:
assignee: nobody → Chaozhe Chen (chaozhe-chen)
Changed in python-troveclient:
assignee: nobody → Chaozhe Chen (chaozhe-chen)

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

Changed in ironic-inspector:
status: New → In Progress
ke liang (ke-liang) on 2015-12-28
Changed in gnocchi:
assignee: nobody → ke liang (ke-liang)

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

Changed in ironic-lib:
status: New → In Progress

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

Changed in ironic:
status: New → In Progress
Changed in ironic-python-agent:
status: New → In Progress

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

Changed in manila:
status: New → In Progress
ke liang (ke-liang) on 2015-12-28
Changed in python-gnocchiclient:
assignee: nobody → ke liang (ke-liang)
Akihiro Motoki (amotoki) wrote :

The bug description is not clear.

The referred link to oslo.log documentation is just to recommended to use text_type(error) when passing an exception object directly to LOG.error/exception or other methods.

At least, the bug tile is wrong.
It is not specific to LOG.exception.

Change abandoned by Shuquan Huang (huang.shuquan@99cloud.net) on branch: master
Review: https://review.openstack.org/261900
Reason: There is no logging exception here. It's no longer affecting python-ironicclient.

Shuquan Huang (shuquan) on 2015-12-28
no longer affects: python-ironicclient

Change abandoned by Shuquan Huang (huang.shuquan@99cloud.net) on branch: master
Review: https://review.openstack.org/261915
Reason: The conversion happens automatically.

Change abandoned by Shuquan Huang (huang.shuquan@99cloud.net) on branch: master
Review: https://review.openstack.org/261918

Change abandoned by Shuquan Huang (huang.shuquan@99cloud.net) on branch: master
Review: https://review.openstack.org/261922

Shuquan Huang (shuquan) on 2015-12-29
no longer affects: ironic-python-agent
no longer affects: ironic-inspector
no longer affects: ironic-lib
LiuNanke (nanke-liu) on 2015-12-29
Changed in nova:
assignee: nobody → LiuNanke (nanke-liu)
status: New → In Progress
Changed in gnocchi:
status: New → In Progress

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

Changed in python-gnocchiclient:
status: New → In Progress
Akihiro Motoki (amotoki) wrote :

In neutronclient there are only two places to hit this bug.

Changed in python-neutronclient:
importance: Undecided → Low
status: New → Confirmed
Akihiro Motoki (amotoki) wrote :

I hope a hacking check rule to avoid similar errors again.

Change abandoned by ke liang (<email address hidden>) on branch: master
Review: https://review.openstack.org/262115

Change abandoned by ke liang (<email address hidden>) on branch: master
Review: https://review.openstack.org/262130

ke liang (ke-liang) on 2015-12-29
Changed in gnocchi:
assignee: ke liang (ke-liang) → nobody
ke liang (ke-liang) on 2015-12-29
Changed in python-gnocchiclient:
assignee: ke liang (ke-liang) → nobody
LiuNanke (nanke-liu) on 2015-12-30
Changed in cinder:
assignee: nobody → LiuNanke (nanke-liu)
status: New → In Progress
Sean McGinnis (sean-mcginnis) wrote :

This is invalid. An exception object should not be passed to log.exception. That logs whatever exception is in scope, so passing in the exception results in it being logged twice.

If passing to log.error, six.text_type is recommended.

Changed in cinder:
status: In Progress → Invalid

Change abandoned by LiuNanke (<email address hidden>) on branch: master
Review: https://review.openstack.org/262263

Changed in cinder:
status: Invalid → In Progress

Change abandoned by HouMing Wang (<email address hidden>) on branch: master
Review: https://review.openstack.org/261926

no longer affects: manila
ke liang (ke-liang) on 2015-12-31
no longer affects: python-gnocchiclient
no longer affects: gnocchi

Change abandoned by LiuNanke (<email address hidden>) on branch: master
Review: https://review.openstack.org/262263

Change abandoned by HouMing Wang (<email address hidden>) on branch: master
Review: https://review.openstack.org/261919

no longer affects: ironic

Reviewed: https://review.openstack.org/261878
Committed: https://git.openstack.org/cgit/openstack/magnum/commit/?id=b9435c4efeef9f31dab2f1012e7a7364f7054197
Submitter: Jenkins
Branch: master

commit b9435c4efeef9f31dab2f1012e7a7364f7054197
Author: Hua Wang <email address hidden>
Date: Mon Dec 28 11:35:50 2015 +0800

    Don't add exception in msg when using LOG.exception

    LOG.exception can record the exception automatically, so we should
    add exception in msg.

    Change-Id: I60694fd8d1b1c0bd62461900c6746a0cc300cf5b
    Closes-Bug: #1529534

Changed in magnum:
status: In Progress → Fix Released
Changed in python-keystoneclient:
importance: Undecided → Low

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

Changed in python-neutronclient:
assignee: HouMing Wang (houming-wang) → YanFeng Sun (ifeng9-sun)
status: Confirmed → In Progress
Amrith Kumar (amrith) wrote :

This doesn't seem to rise to the level of importance to warrant rushing into Mitaka given how many places it will change. But, that's my opinion.

Changed in trove:
importance: Undecided → Wishlist
milestone: none → next

This issue was fixed in the openstack/horizon 9.0.0.0b2 development milestone.

Change abandoned by Nanke_Liu (lnk) (<email address hidden>) on branch: master
Review: https://review.openstack.org/262110

gordon chung (chungg) on 2016-02-23
no longer affects: ceilometer
no longer affects: python-ceilometerclient
Changed in cinder:
status: In Progress → Invalid
no longer affects: sahara
Changed in nova:
status: In Progress → Confirmed
assignee: LiuNanke (nanke-liu) → nobody
Amrith Kumar (amrith) wrote :

inactive for 3 months in Trove

Changed in trove:
assignee: Chaozhe Chen (chaozhe-chen) → nobody
Changed in nova:
assignee: nobody → venkatamahesh (venkatamaheshkotha)
Changed in nova:
importance: Undecided → Wishlist
assignee: venkatamahesh (venkatamaheshkotha) → nobody
no longer affects: python-keystoneclient

The anchor on your link seems to no longer exist. Could you give us an up-to-date reference? Otherwise I'm not sure anything should be done for glance/glanceclient.

This issue was fixed in the openstack/magnum 2.0.0 release.

Change abandoned by Armando Migliaccio (<email address hidden>) on branch: master
Review: https://review.openstack.org/266815
Reason: This review is > 4 weeks without comment, and failed Jenkins the last time it was checked. We are abandoning this for now. Feel free to reactivate the review by pressing the restore button and leaving a 'recheck' comment to get fresh test results.

Akihiro Motoki (amotoki) on 2017-04-19
tags: added: low-hanging-fruit
Changed in python-neutronclient:
status: In Progress → Confirmed
Trevor McCasland (twm2016) wrote :
Changed in trove:
status: New → Fix Released
assignee: nobody → Trevor McCasland (twm2016)
Changed in python-troveclient:
assignee: Chaozhe Chen (chaozhe-chen) → nobody
Akihiro Motoki (amotoki) on 2017-11-01
Changed in python-neutronclient:
assignee: YanFeng Sun (ifeng9-sun) → nobody
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers