Deleting instances using postgres db fails

Bug #772477 reported by Marc
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
Ken Pepple

Bug Description

If I try delete instances while using a postgres db I get the following errors:

==> /var/log/nova/nova-compute.log <==
2011-04-28 17:46:37,688 DEBUG nova.rpc [-] received {u'_context_request_id': u'8TDHIOAAOQR460XR8HM9', u'_context_read_deleted': False, u'args': {u'instance_id': 4}, u'_context_is_admin': True, u'_context_timestamp': u'2011-04-28T15:46:37Z', u'_context_user': u'guruhut', u'method': u'terminate_instance', u'_context_project': u'guruhut', u'_context_remote_address': u'41.66.152.14'} from (pid=31905) _receive /usr/lib/pymodules/python2.6/nova/rpc.py:167
2011-04-28 17:46:37,688 DEBUG nova.rpc [-] unpacked context: {'timestamp': u'2011-04-28T15:46:37Z', 'remote_address': u'41.66.152.14', 'project': u'guruhut', 'is_admin': True, 'user': u'guruhut', 'request_id': u'8TDHIOAAOQR460XR8HM9', 'read_deleted': False} from (pid=31905) _unpack_context /usr/lib/pymodules/python2.6/nova/rpc.py:331
2011-04-28 17:46:37,689 INFO nova.compute.manager [8TDHIOAAOQR460XR8HM9 guruhut guruhut] check_instance_lock: decorating: |<function terminate_instance at 0x2ebf758>|
2011-04-28 17:46:37,689 INFO nova.compute.manager [8TDHIOAAOQR460XR8HM9 guruhut guruhut] check_instance_lock: arguments: |<nova.compute.manager.ComputeManager object at 0x2de4f90>| |<nova.context.RequestContext object at 0x4987fd0>| |4|
2011-04-28 17:46:37,689 DEBUG nova.compute.manager [8TDHIOAAOQR460XR8HM9 guruhut guruhut] instance 4: getting locked state from (pid=31905) get_lock /usr/lib/pymodules/python2.6/nova/compute/manager.py:680
2011-04-28 17:46:37,756 INFO nova.compute.manager [8TDHIOAAOQR460XR8HM9 guruhut guruhut] check_instance_lock: locked: |False|
2011-04-28 17:46:37,756 INFO nova.compute.manager [8TDHIOAAOQR460XR8HM9 guruhut guruhut] check_instance_lock: admin: |True|
2011-04-28 17:46:37,757 INFO nova.compute.manager [8TDHIOAAOQR460XR8HM9 guruhut guruhut] check_instance_lock: executing: |<function terminate_instance at 0x2ebf758>|
2011-04-28 17:46:37,820 AUDIT nova.compute.manager [8TDHIOAAOQR460XR8HM9 guruhut guruhut] Terminating instance 4
2011-04-28 17:46:37,827 DEBUG nova.compute.manager [8TDHIOAAOQR460XR8HM9 guruhut guruhut] Deallocating address 10.0.0.6 from (pid=31905) terminate_instance /usr/lib/pymodules/python2.6/nova/compute/manager.py:278
2011-04-28 17:46:37,854 DEBUG nova.virt.libvirt_conn [-] Error encountered when destroying instance '4': Instance instance-00000004 not found from (pid=31905) destroy /usr/lib/pymodules/python2.6/nova/virt/libvirt_conn.py:381
2011-04-28 17:46:37,920 INFO nova.virt.libvirt_conn [-] Attempted to unfilter instance 4 which is not filtered
2011-04-28 17:46:37,927 INFO nova.virt.libvirt_conn [-] instance instance-00000004: deleting instance files /var/lib/nova/instances/instance-00000004
2011-04-28 17:46:37,937 ERROR nova.exception [-] Uncaught exception
(nova.exception): TRACE: Traceback (most recent call last):
(nova.exception): TRACE: File "/usr/lib/pymodules/python2.6/nova/exception.py", line 120, in _wrap
(nova.exception): TRACE: return f(*args, **kw)
(nova.exception): TRACE: File "/usr/lib/pymodules/python2.6/nova/compute/manager.py", line 105, in decorated_function
(nova.exception): TRACE: function(self, context, instance_id, *args, **kwargs)
(nova.exception): TRACE: File "/usr/lib/pymodules/python2.6/nova/compute/manager.py", line 295, in terminate_instance
(nova.exception): TRACE: self.db.instance_destroy(context, instance_id)
(nova.exception): TRACE: File "/usr/lib/pymodules/python2.6/nova/db/api.py", line 406, in instance_destroy
(nova.exception): TRACE: return IMPL.instance_destroy(context, instance_id)
(nova.exception): TRACE: File "/usr/lib/pymodules/python2.6/nova/db/sqlalchemy/api.py", line 109, in wrapper
(nova.exception): TRACE: return f(*args, **kwargs)
(nova.exception): TRACE: File "/usr/lib/pymodules/python2.6/nova/db/sqlalchemy/api.py", line 808, in instance_destroy
(nova.exception): TRACE: 'updated_at': literal_column('updated_at')})
(nova.exception): TRACE: File "/usr/lib/pymodules/python2.6/sqlalchemy/orm/query.py", line 2160, in update
(nova.exception): TRACE: result = session.execute(update_stmt, params=self._params)
(nova.exception): TRACE: File "/usr/lib/pymodules/python2.6/sqlalchemy/orm/session.py", line 735, in execute
(nova.exception): TRACE: clause, params or {})
(nova.exception): TRACE: File "/usr/lib/pymodules/python2.6/sqlalchemy/engine/base.py", line 1157, in execute
(nova.exception): TRACE: params)
(nova.exception): TRACE: File "/usr/lib/pymodules/python2.6/sqlalchemy/engine/base.py", line 1237, in _execute_clauseelement
(nova.exception): TRACE: return self.__execute_context(context)
(nova.exception): TRACE: File "/usr/lib/pymodules/python2.6/sqlalchemy/engine/base.py", line 1268, in __execute_context
(nova.exception): TRACE: context.parameters[0], context=context)
(nova.exception): TRACE: File "/usr/lib/pymodules/python2.6/sqlalchemy/engine/base.py", line 1367, in _cursor_execute
(nova.exception): TRACE: context)
(nova.exception): TRACE: File "/usr/lib/pymodules/python2.6/sqlalchemy/engine/base.py", line 1360, in _cursor_execute
(nova.exception): TRACE: context)
(nova.exception): TRACE: File "/usr/lib/pymodules/python2.6/sqlalchemy/engine/default.py", line 288, in do_execute
(nova.exception): TRACE: cursor.execute(statement, parameters)
(nova.exception): TRACE: ProgrammingError: (ProgrammingError) column "deleted" is of type boolean but expression is of type integer
(nova.exception): TRACE: LINE 1: ... deleted_at='2011-04-28T15:46:37.934347', deleted=1 WHERE in...
(nova.exception): TRACE: ^
(nova.exception): TRACE: HINT: You will need to rewrite or cast the expression.
(nova.exception): TRACE: 'UPDATE instances SET updated_at=updated_at, deleted_at=%(deleted_at)s, deleted=%(deleted)s WHERE instances.id = %(id_1)s' {'deleted': 1, 'deleted_at': datetime.datetime(2011, 4, 28, 15, 46, 37, 934347), 'id_1': 4}
(nova.exception): TRACE:
2011-04-28 17:46:37,938 ERROR nova [-] Exception during message handling
(nova): TRACE: Traceback (most recent call last):
(nova): TRACE: File "/usr/lib/pymodules/python2.6/nova/rpc.py", line 188, in _receive
(nova): TRACE: rval = node_func(context=ctxt, **node_args)
(nova): TRACE: File "/usr/lib/pymodules/python2.6/nova/exception.py", line 126, in _wrap
(nova): TRACE: raise Error(str(e))
(nova): TRACE: Error: (ProgrammingError) column "deleted" is of type boolean but expression is of type integer
(nova): TRACE: LINE 1: ... deleted_at='2011-04-28T15:46:37.934347', deleted=1 WHERE in...
(nova): TRACE: ^
(nova): TRACE: HINT: You will need to rewrite or cast the expression.
(nova): TRACE: 'UPDATE instances SET updated_at=updated_at, deleted_at=%(deleted_at)s, deleted=%(deleted)s WHERE instances.id = %(id_1)s' {'deleted': 1, 'deleted_at': datetime.datetime(2011, 4, 28, 15, 46, 37, 934347), 'id_1': 4}
(nova): TRACE:

I tried changing the deleted column in the db to an integer field but that broke nova completely.

Related branches

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

marc: i changed the db queries to use True/False for postgres compatibility (we've seen this before :) ) ... can you test it out ?

Changed in nova:
status: New → In Progress
Thierry Carrez (ttx)
Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: none → diablo-1
Thierry Carrez (ttx)
Changed in nova:
milestone: diablo-1 → 2011.3
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.