failure to create instance type extra specs when using Postgres

Bug #1036287 reported by Dan Prince
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Dan Prince

Bug Description

Using the latest Nova Folsom code with Postresql. I'm getting the following exception when trying to run the following:

nova-manage instance_type set_key --name=m1.small --key=foo --value=bar

....

2012-08-13 16:45:54 TRACE nova.exception 'INSERT INTO instance_type_extra_specs (created_at, updated_at, deleted_at, deleted, key, value, instance_type_id) VALUES (%(created_at)s, %(updated_at)s, %(deleted_at)s, %(deleted)s, %(key)s, %(value)s, %(instance_type_id)s) RETURNING instance_type_extra_specs.id' {'deleted': 0, 'created_at': datetime.datetime(2012, 8, 13, 16, 45, 54, 926520), 'instance_type_id': 5, 'updated_at': None, 'value': u'bar', 'key': u'foo', 'deleted_at': None}
2012-08-13 16:45:54 TRACE nova.exception
(ProgrammingError) column "deleted" is of type boolean but expression is of type integer
LINE 1: ...12-08-13T16:45:54.926520'::timestamp, NULL, NULL, 0, 'foo', ...
                                                             ^
HINT: You will need to rewrite or cast the expression.
 'INSERT INTO instance_type_extra_specs (created_at, updated_at, deleted_at, deleted, key, value, instance_type_id) VALUES (%(created_at)s, %(updated_at)s, %(deleted_at)s, %(deleted)s, %(key)s, %(value)s, %(instance_type_id)s) RETURNING instance_type_extra_specs.id' {'deleted': 0, 'created_at': datetime.datetime(2012, 8, 13, 16, 45, 54, 926520), 'instance_type_id': 5, 'updated_at': None, 'value': u'bar', 'key': u'foo', 'deleted_at': None}
The above error may show that the database has not been created.

----

Changing instance_type_extra_specs_update_or_create in the DB API to use deleted: False should resolve the issue.

Dan Prince (dan-prince)
Changed in nova:
assignee: nobody → Dan Prince (dan-prince)
importance: Undecided → Medium
status: New → In Progress
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/11288

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

Reviewed: https://review.openstack.org/11288
Committed: http://github.com/openstack/nova/commit/de03b8441bf6da6437bc4df42875c3cb33103b3e
Submitter: Jenkins
Branch: master

commit de03b8441bf6da6437bc4df42875c3cb33103b3e
Author: Dan Prince <email address hidden>
Date: Mon Aug 13 12:42:56 2012 -0400

    Update extra specs calls to use deleted: False.

    Updates the instance type extra specs and volume type extra specs
    create/update functions so that 'deleted' is treated as a boolean.

    This resolves issues when trying to create/update extra specs
    on Postgres.

    Fixes LP Bug #1036287.

    Change-Id: I7f38b40122240af3254d8a817f5144ce9fafd6db

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → folsom-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: folsom-3 → 2012.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.