Expected exception on volume attach leaves traceback in the logs.

Bug #1155315 reported by Vish Ishaya
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Vish Ishaya
Folsom
Fix Released
Medium
Vish Ishaya

Bug Description

Repro steps:

Attempt to attach volume to an in use device
$ nova volume-attach bar c3e6b09b-88c8-4fb3-a115-b5921eb0b6f0 /dev/vda
ERROR: The supplied device path (/dev/vda) is in use. (HTTP 400) (Request-ID: req-d2cfbc33-dbfc-4034-82f0-85b5de3e3fa7)

Exceptions are correct but we get a large traceback in the logs:

2013-03-14 13:25:24.996 DEBUG nova.api.openstack.wsgi [req-d2cfbc33-dbfc-4034-82f0-85b5de3e3fa7 demo demo] API request failed, fault raised to the top of the stack. Detailed stacktrace The supplied device path (/dev/vda) is in use.
Traceback (most recent call last):

  File "/opt/stack/nova/nova/openstack/common/rpc/amqp.py", line 430, in _process_data
    rval = self.proxy.dispatch(ctxt, version, method, **args)

  File "/opt/stack/nova/nova/openstack/common/rpc/dispatcher.py", line 133, in dispatch
    return getattr(proxyobj, method)(ctxt, **kwargs)

  File "/opt/stack/nova/nova/exception.py", line 117, in wrapped
    temp_level, payload)

  File "/usr/lib/python2.7/contextlib.py", line 24, in __exit__
    self.gen.next()

  File "/opt/stack/nova/nova/exception.py", line 94, in wrapped
    return f(self, context, *args, **kw)

  File "/opt/stack/nova/nova/compute/manager.py", line 206, in decorated_function
    pass

  File "/usr/lib/python2.7/contextlib.py", line 24, in __exit__
    self.gen.next()

  File "/opt/stack/nova/nova/compute/manager.py", line 192, in decorated_function
    return function(self, context, *args, **kwargs)

  File "/opt/stack/nova/nova/compute/manager.py", line 234, in decorated_function
    e, sys.exc_info())

  File "/usr/lib/python2.7/contextlib.py", line 24, in __exit__
    self.gen.next()

  File "/opt/stack/nova/nova/compute/manager.py", line 221, in decorated_function
    return function(self, context, *args, **kwargs)

  File "/opt/stack/nova/nova/compute/manager.py", line 2757, in reserve_block_device_name
    return do_reserve()

  File "/opt/stack/nova/nova/openstack/common/lockutils.py", line 242, in inner
    retval = f(*args, **kwargs)

  File "/opt/stack/nova/nova/compute/manager.py", line 2746, in do_reserve
    context, instance, bdms, device)

  File "/opt/stack/nova/nova/compute/utils.py", line 164, in get_device_name_for_instance
    raise exception.DevicePathInUse(path=device)

DevicePathInUse: The supplied device path (/dev/vda) is in use.

These exceptions are expected so there is no need for traceback.

Changed in nova:
importance: Undecided → Medium
milestone: none → grizzly-rc1
assignee: nobody → Vish Ishaya (vishvananda)
status: New → Triaged
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

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

Changed in nova:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (stable/folsom)

Fix proposed to branch: stable/folsom
Review: https://review.openstack.org/24476

description: updated
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/24475
Committed: http://github.com/openstack/nova/commit/d63bd8d692a9eb16caa818101cdbb3358f6b4681
Submitter: Jenkins
Branch: master

commit d63bd8d692a9eb16caa818101cdbb3358f6b4681
Author: Vishvananda Ishaya <email address hidden>
Date: Thu Mar 14 13:47:42 2013 -0700

    Don't include traceback when wrapping exceptions

    The fix in fa52cb09b2270876c9d9a03106f961be6c9db834 strips tracebacks
    from exceptions when returning them to the user, but it still spams
    the log with a long traceback. We shouldn't be including the traceback
    when we wrap the exception in the first place. Instead we just
    include the message.

    It also updates the error code to 409 for device in use since this
    is actually a conflict.

    Fix for:

      bug 1155315
      bug 1103324
      bug 1092610

    Change-Id: I95019a3022eb52e0335c455009c13fe229475d03

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (stable/folsom)

Reviewed: https://review.openstack.org/24476
Committed: http://github.com/openstack/nova/commit/524a5a3dc89331649bf89ab442d0295f45dcae3f
Submitter: Jenkins
Branch: stable/folsom

commit 524a5a3dc89331649bf89ab442d0295f45dcae3f
Author: Vishvananda Ishaya <email address hidden>
Date: Thu Mar 14 13:47:42 2013 -0700

    Don't include traceback when wrapping exceptions

    The fix in fa52cb09b2270876c9d9a03106f961be6c9db834 strips tracebacks
    from exceptions when returning them to the user, but it still spams
    the log with a long traceback. We shouldn't be including the traceback
    when we wrap the exception in the first place. Instead we just
    include the message.

    It also updates the error code to 409 for device in use since this
    is actually a conflict.

    Fix for:

      bug 1155315
      bug 1103324
      bug 1092610

    Change-Id: I95019a3022eb52e0335c455009c13fe229475d03
    (cherry picked from commit d63bd8d692a9eb16caa818101cdbb3358f6b4681)

Thierry Carrez (ttx)
Changed in nova:
milestone: grizzly-rc1 → 2013.1
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers