Qpid error while creating an instance

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

Bug Description

I hit an error while doing some testing. The error is Qpid saying that it doesn't know how to encode an object of a particular type. I will submit a patch to fix this.

2012-02-16 11:12:19,837 ERROR nova.rpc.common [-] Exception during message handling
(nova.rpc.common): TRACE: Traceback (most recent call last):
(nova.rpc.common): TRACE: File "/home/rbryant/src/nova/nova/rpc/amqp.py", line 249, in _process_data
(nova.rpc.common): TRACE: rval = node_func(context=ctxt, **node_args)
(nova.rpc.common): TRACE: File "/home/rbryant/src/nova/nova/network/manager.py", line 239, in wrapped
(nova.rpc.common): TRACE: return func(self, context, *args, **kwargs)
(nova.rpc.common): TRACE: File "/home/rbryant/src/nova/nova/network/manager.py", line 294, in allocate_for_instance
(nova.rpc.common): TRACE: **kwargs)
(nova.rpc.common): TRACE: File "/home/rbryant/src/nova/nova/network/manager.py", line 239, in wrapped
(nova.rpc.common): TRACE: return func(self, context, *args, **kwargs)
(nova.rpc.common): TRACE: File "/home/rbryant/src/nova/nova/network/manager.py", line 871, in allocate_for_instance
(nova.rpc.common): TRACE: requested_networks=requested_networks)
(nova.rpc.common): TRACE: File "/home/rbryant/src/nova/nova/network/manager.py", line 200, in _allocate_fixed_ips
(nova.rpc.common): TRACE: 'args': {'network_ref': network}})
(nova.rpc.common): TRACE: File "/home/rbryant/src/nova/nova/rpc/__init__.py", line 69, in call
(nova.rpc.common): TRACE: return _get_impl().call(context, topic, msg, timeout)
(nova.rpc.common): TRACE: File "/home/rbryant/src/nova/nova/rpc/impl_qpid.py", line 500, in call
(nova.rpc.common): TRACE: return rpc_amqp.call(context, topic, msg, timeout, Connection.pool)
(nova.rpc.common): TRACE: File "/home/rbryant/src/nova/nova/rpc/amqp.py", line 332, in call
(nova.rpc.common): TRACE: rv = multicall(context, topic, msg, timeout, connection_pool)
(nova.rpc.common): TRACE: File "/home/rbryant/src/nova/nova/rpc/amqp.py", line 326, in multicall
(nova.rpc.common): TRACE: conn.topic_send(topic, msg)
(nova.rpc.common): TRACE: File "/home/rbryant/src/nova/nova/rpc/impl_qpid.py", line 443, in topic_send
(nova.rpc.common): TRACE: self.publisher_send(TopicPublisher, topic, msg)
(nova.rpc.common): TRACE: File "/home/rbryant/src/nova/nova/rpc/impl_qpid.py", line 420, in publisher_send
(nova.rpc.common): TRACE: return self.ensure(_connect_error, _publisher_send)
(nova.rpc.common): TRACE: File "/home/rbryant/src/nova/nova/rpc/impl_qpid.py", line 341, in ensure
(nova.rpc.common): TRACE: return method(*args, **kwargs)
(nova.rpc.common): TRACE: File "/home/rbryant/src/nova/nova/rpc/impl_qpid.py", line 418, in _publisher_send
(nova.rpc.common): TRACE: publisher.send(msg)
(nova.rpc.common): TRACE: File "/home/rbryant/src/nova/nova/rpc/impl_qpid.py", line 233, in send
(nova.rpc.common): TRACE: self.sender.send(msg)
(nova.rpc.common): TRACE: File "<string>", line 6, in send
(nova.rpc.common): TRACE: File "/usr/lib/python2.7/site-packages/qpid/messaging/endpoints.py", line 862, in send
(nova.rpc.common): TRACE: self.sync()
(nova.rpc.common): TRACE: File "<string>", line 6, in sync
(nova.rpc.common): TRACE: File "/usr/lib/python2.7/site-packages/qpid/messaging/endpoints.py", line 873, in sync
(nova.rpc.common): TRACE: if not self._ewait(lambda: self.acked >= mno, timeout=timeout):
(nova.rpc.common): TRACE: File "/usr/lib/python2.7/site-packages/qpid/messaging/endpoints.py", line 787, in _ewait
(nova.rpc.common): TRACE: result = self.session._ewait(lambda: self.error or predicate(), timeout)
(nova.rpc.common): TRACE: File "/usr/lib/python2.7/site-packages/qpid/messaging/endpoints.py", line 554, in _ewait
(nova.rpc.common): TRACE: result = self.connection._ewait(lambda: self.error or predicate(), timeout)
(nova.rpc.common): TRACE: File "/usr/lib/python2.7/site-packages/qpid/messaging/endpoints.py", line 197, in _ewait
(nova.rpc.common): TRACE: self.check_error()
(nova.rpc.common): TRACE: File "/usr/lib/python2.7/site-packages/qpid/messaging/endpoints.py", line 190, in check_error
(nova.rpc.common): TRACE: raise self.error
(nova.rpc.common): TRACE: InternalError: Traceback (most recent call last):
(nova.rpc.common): TRACE: File "/usr/lib/python2.7/site-packages/qpid/messaging/driver.py", line 507, in dispatch
(nova.rpc.common): TRACE: self.engine.dispatch()
(nova.rpc.common): TRACE: File "/usr/lib/python2.7/site-packages/qpid/messaging/driver.py", line 811, in dispatch
(nova.rpc.common): TRACE: self.process(ssn)
(nova.rpc.common): TRACE: File "/usr/lib/python2.7/site-packages/qpid/messaging/driver.py", line 1046, in process
(nova.rpc.common): TRACE: self.send(snd, msg)
(nova.rpc.common): TRACE: File "/usr/lib/python2.7/site-packages/qpid/messaging/driver.py", line 1257, in send
(nova.rpc.common): TRACE: body = enc(msg.content)
(nova.rpc.common): TRACE: File "/usr/lib/python2.7/site-packages/qpid/messaging/message.py", line 28, in encode
(nova.rpc.common): TRACE: sc.write_primitive(type, x)
(nova.rpc.common): TRACE: File "/usr/lib/python2.7/site-packages/qpid/codec010.py", line 73, in write_primitive
(nova.rpc.common): TRACE: getattr(self, "write_%s" % type.NAME)(v)
(nova.rpc.common): TRACE: File "/usr/lib/python2.7/site-packages/qpid/codec010.py", line 257, in write_map
(nova.rpc.common): TRACE: sc.write(string.joinfields(map(self._write_map_elem, m.keys(), m.values()), ""))
(nova.rpc.common): TRACE: File "/usr/lib/python2.7/site-packages/qpid/codec010.py", line 250, in _write_map_elem
(nova.rpc.common): TRACE: sc.write_primitive(type, v)
(nova.rpc.common): TRACE: File "/usr/lib/python2.7/site-packages/qpid/codec010.py", line 73, in write_primitive
(nova.rpc.common): TRACE: getattr(self, "write_%s" % type.NAME)(v)
(nova.rpc.common): TRACE: File "/usr/lib/python2.7/site-packages/qpid/codec010.py", line 257, in write_map
(nova.rpc.common): TRACE: sc.write(string.joinfields(map(self._write_map_elem, m.keys(), m.values()), ""))
(nova.rpc.common): TRACE: File "/usr/lib/python2.7/site-packages/qpid/codec010.py", line 246, in _write_map_elem
(nova.rpc.common): TRACE: type = self.encoding(v)
(nova.rpc.common): TRACE: File "/usr/lib/python2.7/site-packages/qpid/codec010.py", line 59, in encoding
(nova.rpc.common): TRACE: raise CodecException("no encoding for %r" % obj)
(nova.rpc.common): TRACE: CodecException: no encoding for <nova.db.sqlalchemy.models.Network object at 0x670b5d0>
(nova.rpc.common): TRACE:
(nova.rpc.common): TRACE:

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/4246

Changed in nova:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.openstack.org/4258

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

Reviewed: https://review.openstack.org/4246
Committed: http://github.com/openstack/nova/commit/068f31c6cd3eff68f08ee597f7296e4f6e47388f
Submitter: Jenkins
Branch: master

commit 068f31c6cd3eff68f08ee597f7296e4f6e47388f
Author: Russell Bryant <email address hidden>
Date: Thu Feb 16 14:39:10 2012 -0500

    Don't send a SQLAlchemy model over rpc.

    Fix bug 933584.

    I noticed this when Qpid blew up because it didn't know how to serialize
    a SQLAlchemy model. Fix it by making it only consist of primitive types
    before sending it.

    Change-Id: I63eb4bbabdb75fa7b277428bbd1aa2c2e1383383

Changed in nova:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

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

commit c8c9a87b240b562d334c6875a1dd7614d4ae58d5
Author: Russell Bryant <email address hidden>
Date: Thu Feb 16 15:52:16 2012 -0500

    Add RPC serialization checking, fix exposed problems.

    Related to bug 933584.

    In this bug, I hit a case where some code tried to send a SQLAlchemy
    model over rpc, which failed since it couldn't be serialized by Qpid.
    This patch adds a simple serialization check to the fake RPC driver
    using json. It also fixes problems that were exposed by adding this
    check.

    If json can't serialize a message sent through the fake RPC
    driver, it will raise TypeError, causing unit tests to fail. 18 unit
    tests failed with the check in place, but it was due to only 2 places
    in the compute API.

    Change-Id: I63f3077c0fa35097d4f5d2c485f4e48eede2c751

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