Detach volume fails with "Unexpected KeyError" in EC2 interface.

Bug #1280532 reported by Rui Chen
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
High
Rui Chen
Havana
Fix Released
High
Matt Riedemann
Icehouse
Fix Released
High
Matt Riedemann

Bug Description

Detach volume fails with "Unexpected KeyError" in EC2 interface when I detach a "attaching" status volume.

The volume with "attaching" status don't contain a property"instance_uuid", a KeyError will be raised at the following function.

    def _get_instance_from_volume(self, context, volume):
        if volume['instance_uuid']:
            ......

Attaching volume dict:

{
 'status': u'attaching',
 'volume_type_id': u'None',
 'display_name': None,
 'attach_time': '',
 'availability_zone': u'nova',
 'created_at': u'2014-02-13T16: 50: 53.620080',
 'attach_status': 'detached',
 'display_description': None,
 'volume_metadata': {

 },
 'snapshot_id': None,
 'mountpoint': '',
 'id': u'99d118ee-3666-4983-8825-f8c096bccbd1',
 'size': 1
}

Tags: ec2
Rui Chen (kiwik-chenrui)
Changed in nova:
assignee: nobody → Rui Chen (kiwik-chenrui)
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/73788

Changed in nova:
status: New → In Progress
Revision history for this message
Mark McLoughlin (markmc) wrote :

Hmm, this looks the same as:

http://logs.openstack.org/38/84238/1/check/check-grenade-dsvm/88847c1/logs/new/screen-n-api.txt.gz?level=TRACE

i.e. "Unexpected KeyError raised" when doing a detach volume via the EC2 API

I haven't looked in detail yet, but if you search for ""Unexpected KeyError raised"" in kibana, it looks like this is occurring a lot in the past 24 hours

tags: added: icehouse-rc-potential
Changed in nova:
importance: Undecided → High
Revision history for this message
Matt Riedemann (mriedem) wrote :

Yeah, confirmed, also hitting it here:

http://logs.openstack.org/37/84037/5/check/check-grenade-dsvm-partial-ncpu/db32161/console.html

message:"InstanceRunTest" AND message:"Unexpected KeyError raised" AND tags:"screen-n-api.txt"

http://logstash.openstack.org/#eyJzZWFyY2giOiJtZXNzYWdlOlwiSW5zdGFuY2VSdW5UZXN0XCIgQU5EIG1lc3NhZ2U6XCJVbmV4cGVjdGVkIEtleUVycm9yIHJhaXNlZFwiIEFORCB0YWdzOlwic2NyZWVuLW4tYXBpLnR4dFwiIiwiZmllbGRzIjpbXSwib2Zmc2V0IjowLCJ0aW1lZnJhbWUiOiI2MDQ4MDAiLCJncmFwaG1vZGUiOiJjb3VudCIsInRpbWUiOnsidXNlcl9pbnRlcnZhbCI6MH0sInN0YW1wIjoxMzk2MzU4NTU0NzY0fQ==

It's not a failure every time that shows up, but the failure rate is 97.6%. It's mostly the check queue right now but it's hitting on multiple patches.

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

elastic-recheck query is here: https://review.openstack.org/#/c/84449/

Thierry Carrez (ttx)
tags: added: icehouse-backport-potential
removed: icehouse-rc-potential
Revision history for this message
Matt Riedemann (mriedem) wrote :

Looks like the test was recently enabled again: https://review.openstack.org/81762

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

Reviewed: https://review.openstack.org/73788
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=fa72e49845179e29cf918e0742ef735ae868bb4c
Submitter: Jenkins
Branch: master

commit fa72e49845179e29cf918e0742ef735ae868bb4c
Author: ruichen <email address hidden>
Date: Sat Feb 15 15:32:47 2014 +0800

    Fix bug detach volume fails with "KeyError" in EC2

    Modified volume['instance_uuid'] to volume.get('instance_uuid'),
    to avoid "KeyError", when detach a volume with "attaching" status.

    Change-Id: Ic1aacab212c2a2026d18ef57ad9d77fdc6d86b47
    Closes-Bug: #1280532

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

Fix proposed to branch: milestone-proposed
Review: https://review.openstack.org/86492

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (stable/havana)

Fix proposed to branch: stable/havana
Review: https://review.openstack.org/86493

Revision history for this message
Openstack Gerrit (openstack-gerrit) wrote : Fix proposed to nova (stable/icehouse)

Fix proposed to branch: stable/icehouse
Review: https://review.openstack.org/88686

Matt Riedemann (mriedem)
tags: removed: icehouse-backport-potential
Revision history for this message
Openstack Gerrit (openstack-gerrit) wrote : Fix merged to nova (stable/icehouse)

Reviewed: https://review.openstack.org/88686
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=2728f1e9afa7d5123ab43a8f2af6fe14be3db3c7
Submitter: Jenkins
Branch: stable/icehouse

commit 2728f1e9afa7d5123ab43a8f2af6fe14be3db3c7
Author: ruichen <email address hidden>
Date: Sat Feb 15 15:32:47 2014 +0800

    Fix bug detach volume fails with "KeyError" in EC2

    Modified volume['instance_uuid'] to volume.get('instance_uuid'),
    to avoid "KeyError", when detach a volume with "attaching" status.

    Change-Id: Ic1aacab212c2a2026d18ef57ad9d77fdc6d86b47
    Closes-Bug: #1280532
    (cherry picked from commit fa72e49845179e29cf918e0742ef735ae868bb4c)

tags: added: in-stable-icehouse
Alan Pevec (apevec)
tags: removed: in-stable-icehouse
Thierry Carrez (ttx)
Changed in nova:
milestone: none → juno-1
status: Fix Committed → Fix Released
Revision history for this message
Joe Gordon (jogo) wrote :

Still seeing some of these:

message:"Unexpected KeyError raised" AND module:"nova.api.ec2"

http://logs.openstack.org/86/43986/44/check/check-tempest-dsvm-postgres-full/d3c52f4/logs/screen-n-api.txt

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (stable/havana)

Reviewed: https://review.openstack.org/86493
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=9f05659eff8a0dae1afabb3ca288a021305a8c36
Submitter: Jenkins
Branch: stable/havana

commit 9f05659eff8a0dae1afabb3ca288a021305a8c36
Author: ruichen <email address hidden>
Date: Sat Feb 15 15:32:47 2014 +0800

    Fix bug detach volume fails with "KeyError" in EC2

    Modified volume['instance_uuid'] to volume.get('instance_uuid'),
    to avoid "KeyError", when detach a volume with "attaching" status.

    Change-Id: Ic1aacab212c2a2026d18ef57ad9d77fdc6d86b47
    Closes-Bug: #1280532
    (cherry picked from commit fa72e49845179e29cf918e0742ef735ae868bb4c)

Thierry Carrez (ttx)
Changed in nova:
milestone: juno-1 → 2014.2
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.