uninformative error when invalid instance id is entered

Bug #732902 reported by Cam Macdonell
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
Unassigned

Bug Description

I accidentally ran

euca-terminate-instances i-i

instead of i-1. The error is an uninformative "unknown error". Only after a few minutes did I notice my typo

The problem is in api/ec2/cloud.py at line 78, wrapping a try/except as follows will provide a more intuitive message

def ec2_id_to_id(ec2_id):
    """Convert an ec2 ID (i-[base 16 number]) to an instance id (int)"""
    try:
        id = int(ec2_id.split('-')[-1], 16)
    except ValueError:
        raise exception.ApiError(_('invalid instance id: %s') % ec2_id)
    return id

Cam Macdonell (cam-cs)
description: updated
description: updated
Thierry Carrez (ttx)
Changed in nova:
importance: Undecided → Low
status: New → Confirmed
Revision history for this message
John Tran (jtran) wrote :

This may have been fixed in another bug ticket? I am not able to reproduce the problem.

$ euca-terminate-instances i-1
InstanceNotFound: Instance i-00000001 not found

Revision history for this message
John Tran (jtran) wrote :

I've made a unit test for terminate_instances and linked the branch, in case it helps.

Revision history for this message
Cam Macdonell (cam-cs) wrote : Re: [Bug 732902] Re: uninformative error when invalid instance id is entered

I saw the bug was fixed in Cactus. So this bug would only apply to Bexar.

Cam

On 2011-03-30 2:22 PM, "John Tran" <email address hidden> wrote:

I've made a unit test for terminate_instances and linked the branch, in
case it helps.

** Branch linked: lp:~jtran/nova/lp732902

--
You received this bug notification because you are a direct subscriber
of the bug.
https://bugs...

Revision history for this message
Thierry Carrez (ttx) wrote :

Marking as already fixed in Cactus.

Changed in nova:
status: Confirmed → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → 2011.2
status: Fix Committed → Fix Released
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.