Unclear error when images directory wasn't upgraded

Bug #735641 reported by Chuck Short
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
Ken Pepple

Bug Description

When you haven't upgraded your images directory (storing images by hash instead of by the traditional ami-* name), you get the following unclear error:

011-03-15 14:20:55,301 AUDIT nova.api [T7XYOZ4KLXT09R-4TRHT chuck cloud] Authenticated Request For chuck:cloud)
2011-03-15 14:20:55,301 DEBUG nova.api [-] action: RunInstances from (pid=13443) __call__ /home/ubuntu/work/nova/nova/api/ec2/__init__.py:213
2011-03-15 14:20:55,301 DEBUG nova.api [-] arg: ImageId val: ami-tiny from (pid=13443) __call__ /home/ubuntu/work/nova/nova/api/ec2/__init__.py:215
2011-03-15 14:20:55,301 DEBUG nova.api [-] arg: MaxCount val: 1 from (pid=13443) __call__ /home/ubuntu/work/nova/nova/api/ec2/__init__.py:215
2011-03-15 14:20:55,301 DEBUG nova.api [-] arg: MinCount val: 1 from (pid=13443) __call__ /home/ubuntu/work/nova/nova/api/ec2/__init__.py:215
2011-03-15 14:20:55,301 DEBUG nova.api [-] arg: InstanceType val: m1.small from (pid=13443) __call__ /home/ubuntu/work/nova/nova/api/ec2/__init__.py:215
2011-03-15 14:20:55,307 ERROR nova.api [T7XYOZ4KLXT09R-4TRHT chuck cloud] Unexpected error raised: invalid literal for int() with base 16: 'ari-tty'
(nova.api): TRACE: Traceback (most recent call last):
(nova.api): TRACE: File "/home/ubuntu/work/nova/nova/api/ec2/__init__.py", line 318, in __call__
(nova.api): TRACE: result = api_request.invoke(context)
(nova.api): TRACE: File "/home/ubuntu/work/nova/nova/api/ec2/apirequest.py", line 150, in invoke
(nova.api): TRACE: result = method(context, **args)
(nova.api): TRACE: File "/home/ubuntu/work/nova/nova/api/ec2/cloud.py", line 799, in run_instances
(nova.api): TRACE: image_id=self._get_image(context, kwargs['image_id'])['id'],
(nova.api): TRACE: File "/home/ubuntu/work/nova/nova/api/ec2/cloud.py", line 868, in _get_image
(nova.api): TRACE: return self.image_service.show_by_name(context, ec2_id)
(nova.api): TRACE: File "/home/ubuntu/work/nova/nova/image/s3.py", line 102, in show_by_name
(nova.api): TRACE: image = self.service.show_by_name(context, name)
(nova.api): TRACE: File "/home/ubuntu/work/nova/nova/image/local.py", line 77, in show_by_name
(nova.api): TRACE: images = self.detail(context)
(nova.api): TRACE: File "/home/ubuntu/work/nova/nova/image/local.py", line 58, in detail
(nova.api): TRACE: for image_id in self._ids():
(nova.api): TRACE: File "/home/ubuntu/work/nova/nova/image/local.py", line 50, in _ids
(nova.api): TRACE: return [int(i, 16) for i in os.listdir(self._path)]
(nova.api): TRACE: ValueError: invalid literal for int() with base 16: 'ari-tty'
(nova.api): TRACE:

Related branches

Revision history for this message
Ken Pepple (ken-pepple) wrote :

This isn't an error with nova/trunk, you haven't upgraded your images directory.

Somewhere around revno 775, we started storing images by hash instead of by the traditional ami-* name.

delete your images from /var/lib/nova/images and re-publish them.

Revision history for this message
Ken Pepple (ken-pepple) wrote :

ttx --

can we capture this issue for the Cactus release notes ?

we'll either need to document a work around (like deleting all the images and re-uploading them) or put this into the upgrade script.

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

@ken: sure, please add a note to http://wiki.openstack.org/ReleaseNotes/Cactus

We could use a clearer error to avoid duplicates of this, rewrapping bug to that effect

summary: - Latest trunk fails.
+ Unclear error when images directory wasn't upgraded
description: updated
Changed in nova:
importance: Undecided → Low
status: New → Confirmed
Revision history for this message
Ken Pepple (ken-pepple) wrote :

Agree with ttx. let's wrap this error and just log if we see any invalid image.

I will take it.

Changed in nova:
assignee: nobody → Ken Pepple (ken-pepple)
Revision history for this message
Ken Pepple (ken-pepple) wrote :

logged fix in release notes and proposed fix branch for merge

Thierry Carrez (ttx)
Changed in nova:
status: Confirmed → In Progress
Changed in nova:
status: In Progress → 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.