Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RDO tickets are now tracked in Jira https://issues.redhat.com/projects/RDO/issues/

Bug 1175472

Summary: glance commands fail with database error: Unknown column 'virtual_size' in 'field list'
Product: [Community] RDO Reporter: Richard W.M. Jones <rjones>
Component: openstack-packstackAssignee: Martin Magr <mmagr>
Status: CLOSED NOTABUG QA Contact: Ami Jeain <ajeain>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: aortega, derekh, fpercoco, yeylon
Target Milestone: ---   
Target Release: Juno   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-12-18 15:36:24 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
registry.log file none

Description Richard W.M. Jones 2014-12-17 19:28:36 UTC
Created attachment 970286 [details]
registry.log file

Description of problem:

ERROR : Error appeared during Puppet run: 192.168.122.121_provision_glance.pp
Error: Could not prefetch glance_image provider 'glance': Execution of '/usr/bin/glance --os-tenant-name services --os-username glance --os-password dfe92f3f60cf45f5 --os-region-name RegionOne --os-auth-url http://192.168.122.121:35357/v2.0/ image-list' returned 1: HTTPInternalServerError (HTTP 500)

Looking at /var/log/glance/registry.log shows that the reason for
this error is:

OperationalError: (OperationalError) (1054, "Unknown column 'virtual_size' in 'field list'") 'INSERT INTO images (created_at, updated_at, deleted_at, deleted, id, name, disk_format, container_format, size, virtual_size, status, is_public, checksum, min_disk, min_ram, owner, protected) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)' (datetime.datetime(2014, 12, 17, 19, 17, 8, 99391), datetime.datetime(2014, 12, 17, 19, 17, 8, 99417), None, 0, 'af9d53b5-3f8d-4f24-9266-0e6188104c75', 'cirros', 'qcow2', 'bare', 13200896, None, 'queued', 1, None, 0, 0, 'd204b5453655422bbac00b8090fe8f9f', 0)

(complete registry.log attached)

Version-Release number of selected component (if applicable):

openstack-packstack-2014.2-0.12.dev1370.ge46bee1.fc22.noarch
openstack-glance-2014.2.1-1.fc22.noarch

How reproducible:

At least once.

Steps to Reproduce:
1. packstack --allinone

Comment 1 Richard W.M. Jones 2014-12-17 19:32:28 UTC
There is no virtual_size column in the database:

MariaDB [(none)]> desc glance.images;
+------------------+--------------+------+-----+---------+-------+
| Field            | Type         | Null | Key | Default | Extra |
+------------------+--------------+------+-----+---------+-------+
| id               | varchar(36)  | NO   | PRI | NULL    |       |
| name             | varchar(255) | YES  |     | NULL    |       |
| size             | bigint(20)   | YES  |     | NULL    |       |
| status           | varchar(30)  | NO   |     | NULL    |       |
| is_public        | tinyint(1)   | NO   | MUL | NULL    |       |
| location         | text         | YES  |     | NULL    |       |
| created_at       | datetime     | NO   |     | NULL    |       |
| updated_at       | datetime     | YES  |     | NULL    |       |
| deleted_at       | datetime     | YES  |     | NULL    |       |
| deleted          | tinyint(1)   | NO   | MUL | NULL    |       |
| disk_format      | varchar(20)  | YES  |     | NULL    |       |
| container_format | varchar(20)  | YES  |     | NULL    |       |
| checksum         | varchar(32)  | YES  |     | NULL    |       |
| owner            | varchar(255) | YES  |     | NULL    |       |
| min_disk         | int(11)      | NO   |     | NULL    |       |
| min_ram          | int(11)      | NO   |     | NULL    |       |
| protected        | tinyint(1)   | YES  |     | NULL    |       |
+------------------+--------------+------+-----+---------+-------+
17 rows in set (0.00 sec)

Comment 2 Richard W.M. Jones 2014-12-18 14:15:33 UTC
Second install, it now works and there is a virtual_size column:

MariaDB [(none)]> desc glance.images
    -> ;
+------------------+--------------+------+-----+---------+-------+
| Field            | Type         | Null | Key | Default | Extra |
+------------------+--------------+------+-----+---------+-------+
| id               | varchar(36)  | NO   | PRI | NULL    |       |
| name             | varchar(255) | YES  |     | NULL    |       |
| size             | bigint(20)   | YES  |     | NULL    |       |
| status           | varchar(30)  | NO   |     | NULL    |       |
| is_public        | tinyint(1)   | NO   | MUL | NULL    |       |
| created_at       | datetime     | NO   |     | NULL    |       |
| updated_at       | datetime     | YES  |     | NULL    |       |
| deleted_at       | datetime     | YES  |     | NULL    |       |
| deleted          | tinyint(1)   | NO   | MUL | NULL    |       |
| disk_format      | varchar(20)  | YES  |     | NULL    |       |
| container_format | varchar(20)  | YES  |     | NULL    |       |
| checksum         | varchar(32)  | YES  | MUL | NULL    |       |
| owner            | varchar(255) | YES  | MUL | NULL    |       |
| min_disk         | int(11)      | NO   |     | NULL    |       |
| min_ram          | int(11)      | NO   |     | NULL    |       |
| protected        | tinyint(1)   | YES  |     | NULL    |       |
| virtual_size     | bigint(20)   | YES  |     | NULL    |       |
+------------------+--------------+------+-----+---------+-------+
17 rows in set (0.00 sec)

Also the 'location' column has been deleted.

I stress that the test in comment 1 was conducted yesterday
from a completely fresh Rawhide VM built yesterday, and the
test today also started from a fresh Rawhide VM.

Race condition in applying database updates?

Comment 3 Flavio Percoco 2014-12-18 15:36:24 UTC
It sounds like something went wrong with the previous packstack run. I don't think it is related to glance, probably a puppet race. I'll close this bug, if you run into it again, feel free to re-open it.