cinderclient stacktrace when 404 from cinder get_snapshot

Bug #1169777 reported by Christopher Yeoh
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
Christopher Yeoh

Bug Description

During a the tempest test tempest.tests.boto.test_ec2_volumes.EC2VolumesTest.test_create_volume_from_snapshot the cleanup code does a snapshot update request until it fails. The behavior is correct, but causes a stacktrace from cinderclient

2013-04-17 08:58:47 INFO [requests.packages.urllib3.connectionpool] Starting new HTTP connection (1): 192.168.1.18
2013-04-17 08:58:47 DEBUG [requests.packages.urllib3.connectionpool] "GET /v1/fe2faa887f5848449a8e02c4000ffff0/snapshots/69b0651c-34f4-4fdf-8135-1c125aeeeab9 HTTP/1.1" 404 78
2013-04-17 08:58:47 ERROR [nova.api.ec2] Unexpected error raised: The resource could not be found. (HTTP 404) (Request-ID: req-6d441c5b-e271-4130-8853-3530b21927e3)
Traceback (most recent call last):
  File "/srv/compile/openstack/nova/nova/api/ec2/__init__.py", line 481, in __call__
    result = api_request.invoke(context)
  File "/srv/compile/openstack/nova/nova/api/ec2/apirequest.py", line 79, in invoke
    result = method(context, **args)
  File "/srv/compile/openstack/nova/nova/api/ec2/cloud.py", line 350, in describe_snapshots
    snapshot_id=internal_id)
  File "/srv/compile/openstack/nova/nova/volume/cinder.py", line 283, in get_snapshot
    item = cinderclient(context).volume_snapshots.get(snapshot_id)
  File "/usr/local/lib/python2.7/dist-packages/cinderclient/v1/volume_snapshots.py", line 84, in get
    return self._get("/snapshots/%s" % snapshot_id, "snapshot")
  File "/usr/local/lib/python2.7/dist-packages/cinderclient/base.py", line 141, in _get
    resp, body = self.api.client.get(url)
  File "/usr/local/lib/python2.7/dist-packages/cinderclient/client.py", line 189, in get
    return self._cs_request(url, 'GET', **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/cinderclient/client.py", line 157, in _cs_request
    **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/cinderclient/client.py", line 140, in request
    raise exceptions.from_response(resp, body)
NotFound: The resource could not be found. (HTTP 404) (Request-ID: req-6d441c5b-e271-4130-8853-3530b21927e3)
2013-04-17 08:58:47 ERROR [nova.api.ec2] Environment: {"CONTENT_TYPE": "application/x-www-form-urlencoded; charset=UTF-8", "SCRIPT_NAME": "/services/Cloud", "REQUEST_METHOD": "POST", "HTTP_HOST": "192.168.1.18:8773", "PATH_INFO": "/", "SERVER_PROTOCOL": "HTTP/1.0", "HTTP_USER_AGENT": "Boto/2.8.0 (linux2)", "RAW_PATH_INFO": "/services/Cloud/", "REMOTE_ADDR": "192.168.1.18", "wsgi.url_scheme": "http", "SERVER_NAME": "192.168.1.18", "SERVER_PORT": "8773", "GATEWAY_INTERFACE": "CGI/1.1", "HTTP_ACCEPT_ENCODING": "identity"}

We should catch the exception so the traceback does not occur, but otherwise preserve the current API behavior

Changed in nova:
assignee: nobody → Christopher Yeoh (cyeoh-0)
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/27027

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

Reviewed: https://review.openstack.org/27027
Committed: http://github.com/openstack/nova/commit/673f3118b6b558f8c23a669ad6aae1cf8df6632e
Submitter: Jenkins
Branch: master

commit 673f3118b6b558f8c23a669ad6aae1cf8df6632e
Author: Chris Yeoh <email address hidden>
Date: Wed Apr 17 10:02:33 2013 +0930

    Translate cinder NotFound exception

    When we attempt to get information about a snapshot
    which doesn't exist we get a cinder NotFound exception.
    However, this is not caught and causes a stacktrace in the logs.
    This occurs on every tempest run in the test
    EC2VolumesTest.test_create_volume_from_snapshot.

    The fix is to translate the exception to SnapshotNotFound
    which is handled correctly further up the call chain.

    Fixes bug 1169777

    Part of blueprint no-stacktraces-in-logs

    Change-Id: If893b5083b93894e671c978bd23bd89d3d017531

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → havana-1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: havana-1 → 2013.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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