Original exceptions and tracebacks are lost on error

Bug #1309177 reported by Alex Meade
24
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Undecided
Yuriy Nesenenko

Bug Description

Many except blocks catch exceptions and only log partial information before raising a new exception. We should at least log the original exceptions information and traceback. Example below. In these cases, we should be logging the info with LOG.exception instead of LOG.error. Otherwise, it can be very difficult for an admin to determine the root issue.

https://github.com/openstack/cinder/blob/d943bafbb8908ba9f85be8e2a0e48a80d27ae48a/cinder/volume/flows/manager/create_volume.py#L465

464 except Exception as ex:
465 LOG.error(_("Failed to copy image %(image_id)s to " <--------------- If this were Log.exception, the exception details would be logged
466 "volume: %(volume_id)s, error: %(error)s") %
467 {'volume_id': volume_id, 'error': ex,
468 'image_id': image_id})
469 if not isinstance(ex, exception.ImageCopyFailure):
470 raise exception.ImageCopyFailure(reason=ex)
471 else:
472 raise

Changed in cinder:
assignee: nobody → Yuriy Nesenenko (ynesenenko)
Changed in cinder:
status: New → Confirmed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (master)

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

Changed in cinder:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.openstack.org/165380
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=3eadd939bb1ef1dcb27402672d06691958a585ca
Submitter: Jenkins
Branch: master

commit 3eadd939bb1ef1dcb27402672d06691958a585ca
Author: Yuriy Nesenenko <email address hidden>
Date: Wed Mar 18 13:45:48 2015 +0200

    Fix logging to catch original exceptions and tracebacks

    We should log the original exceptions information and tracebacks
    with LOG.exception instead of LOG.error. Otherwise, it can be
    difficult to determine the root issue. Also, the module
    cinder/volume/flows/manager/create_volume.py is fixed according to
    Logging guidelines http://docs.openstack.org/developer/oslo.i18n/guidelines.html

    Closes-Bug: #1309177

    Change-Id: I01d7667ddb9f7698efcf412a40f76809852cfaa1

Changed in cinder:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in cinder:
milestone: none → kilo-rc1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in cinder:
milestone: kilo-rc1 → 2015.1.0
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.