Error message encoding issue when using qpid

Bug #1242734 reported by Feilong Wang
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Glance
Fix Released
High
Feilong Wang
Havana
Fix Released
High
Flavio Percoco

Bug Description

When I was trying to create a new image to recreate the storage full exception, I got 500 error code instead of 413. And I see below trace in log. Seems we need to call jsonutils.to_primitive to make the message can be encoded.

2013-10-15 05:18:18.623 2430 ERROR glance.api.v1.upload_utils [b256bf1b-81e4-41b1-b89a-0a6bcb58b5ab 396ce5f3575a43abb636c489a959bf16 29db386367fa4c4e9ffb3c369a46ee90] Image storage media is full: There is not enough disk space on the image storage media.
2013-10-15 05:18:18.691 2430 ERROR glance.notifier.notify_qpid [b256bf1b-81e4-41b1-b89a-0a6bcb58b5ab 396ce5f3575a43abb636c489a959bf16 29db386367fa4c4e9ffb3c369a46ee90] Notification error. Priority: error Message: {'event_type': 'image.upload', 'timestamp': '2013-10-15 10:18:18.662667', 'message_id': 'b74ec17a-06ac-45b8-84c3-37a55af8dfe1', 'priority': 'ERROR', 'publisher_id': 'yangj228', 'payload': u'Image storage media is full: There is not enough disk space on the image storage media.'}
2013-10-15 05:18:18.691 2430 TRACE glance.notifier.notify_qpid Traceback (most recent call last):
2013-10-15 05:18:18.691 2430 TRACE glance.notifier.notify_qpid File "/usr/lib/python2.6/site-packages/glance/notifier/notify_qpid.py", line 134, in _send
2013-10-15 05:18:18.691 2430 TRACE glance.notifier.notify_qpid sender.send(qpid_msg)
2013-10-15 05:18:18.691 2430 TRACE glance.notifier.notify_qpid File "<string>", line 6, in send
2013-10-15 05:18:18.691 2430 TRACE glance.notifier.notify_qpid File "/usr/lib/python2.6/site-packages/qpid/messaging/endpoints.py", line 879, in send
2013-10-15 05:18:18.691 2430 TRACE glance.notifier.notify_qpid self.sync(timeout=timeout)
2013-10-15 05:18:18.691 2430 TRACE glance.notifier.notify_qpid File "<string>", line 6, in sync
2013-10-15 05:18:18.691 2430 TRACE glance.notifier.notify_qpid File "/usr/lib/python2.6/site-packages/qpid/messaging/endpoints.py", line 890, in sync
2013-10-15 05:18:18.691 2430 TRACE glance.notifier.notify_qpid if not self._ewait(lambda: self.acked >= mno, timeout=timeout):
2013-10-15 05:18:18.691 2430 TRACE glance.notifier.notify_qpid File "/usr/lib/python2.6/site-packages/qpid/messaging/endpoints.py", line 804, in _ewait
2013-10-15 05:18:18.691 2430 TRACE glance.notifier.notify_qpid result = self.session._ewait(lambda: self.error or predicate(), timeout)
2013-10-15 05:18:18.691 2430 TRACE glance.notifier.notify_qpid File "/usr/lib/python2.6/site-packages/qpid/messaging/endpoints.py", line 571, in _ewait
2013-10-15 05:18:18.691 2430 TRACE glance.notifier.notify_qpid result = self.connection._ewait(lambda: self.error or predicate(), timeout)
2013-10-15 05:18:18.691 2430 TRACE glance.notifier.notify_qpid File "/usr/lib/python2.6/site-packages/qpid/messaging/endpoints.py", line 214, in _ewait
2013-10-15 05:18:18.691 2430 TRACE glance.notifier.notify_qpid self.check_error()
2013-10-15 05:18:18.691 2430 TRACE glance.notifier.notify_qpid File "/usr/lib/python2.6/site-packages/qpid/messaging/endpoints.py", line 207, in check_error
2013-10-15 05:18:18.691 2430 TRACE glance.notifier.notify_qpid raise self.error
2013-10-15 05:18:18.691 2430 TRACE glance.notifier.notify_qpid InternalError: Traceback (most recent call last):
2013-10-15 05:18:18.691 2430 TRACE glance.notifier.notify_qpid File "/usr/lib/python2.6/site-packages/qpid/messaging/driver.py", line 497, in dispatch
2013-10-15 05:18:18.691 2430 TRACE glance.notifier.notify_qpid self.engine.dispatch()
2013-10-15 05:18:18.691 2430 TRACE glance.notifier.notify_qpid File "/usr/lib/python2.6/site-packages/qpid/messaging/driver.py", line 802, in dispatch
2013-10-15 05:18:18.691 2430 TRACE glance.notifier.notify_qpid self.process(ssn)
2013-10-15 05:18:18.691 2430 TRACE glance.notifier.notify_qpid File "/usr/lib/python2.6/site-packages/qpid/messaging/driver.py", line 1037, in process
2013-10-15 05:18:18.691 2430 TRACE glance.notifier.notify_qpid self.send(snd, msg)
2013-10-15 05:18:18.691 2430 TRACE glance.notifier.notify_qpid File "/usr/lib/python2.6/site-packages/qpid/messaging/driver.py", line 1248, in send
2013-10-15 05:18:18.691 2430 TRACE glance.notifier.notify_qpid body = enc(msg.content)
2013-10-15 05:18:18.691 2430 TRACE glance.notifier.notify_qpid File "/usr/lib/python2.6/site-packages/qpid/messaging/message.py", line 28, in encode
2013-10-15 05:18:18.691 2430 TRACE glance.notifier.notify_qpid sc.write_primitive(type, x)
2013-10-15 05:18:18.691 2430 TRACE glance.notifier.notify_qpid File "/usr/lib/python2.6/site-packages/qpid/codec010.py", line 73, in write_primitive
2013-10-15 05:18:18.691 2430 TRACE glance.notifier.notify_qpid getattr(self, "write_%s" % type.NAME)(v)
2013-10-15 05:18:18.691 2430 TRACE glance.notifier.notify_qpid File "/usr/lib/python2.6/site-packages/qpid/codec010.py", line 257, in write_map
2013-10-15 05:18:18.691 2430 TRACE glance.notifier.notify_qpid sc.write(string.joinfields(map(self._write_map_elem, m.keys(), m.values()), ""))
2013-10-15 05:18:18.691 2430 TRACE glance.notifier.notify_qpid File "/usr/lib/python2.6/site-packages/qpid/codec010.py", line 246, in _write_map_elem
2013-10-15 05:18:18.691 2430 TRACE glance.notifier.notify_qpid type = self.encoding(v)
2013-10-15 05:18:18.691 2430 TRACE glance.notifier.notify_qpid File "/usr/lib/python2.6/site-packages/qpid/codec010.py", line 59, in encoding
2013-10-15 05:18:18.691 2430 TRACE glance.notifier.notify_qpid raise CodecException("no encoding for %r" % obj)
2013-10-15 05:18:18.691 2430 TRACE glance.notifier.notify_qpid CodecException: no encoding for u'Image storage media is full: There is not enough disk space on the image storage media.'
2013-10-15 05:18:18.691 2430 TRACE glance.notifier.notify_qpid
2013-10-15 05:18:18.691 2430 TRACE glance.notifier.notify_qpid

Feilong Wang (flwang)
Changed in glance:
assignee: nobody → Fei Long Wang (flwang)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to glance (master)

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to glance (stable/havana)

Fix proposed to branch: stable/havana
Review: https://review.openstack.org/55855

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

Reviewed: https://review.openstack.org/52952
Committed: http://github.com/openstack/glance/commit/94b9e66360387d24548f165cc4c7ee67f5160a0c
Submitter: Jenkins
Branch: master

commit 94b9e66360387d24548f165cc4c7ee67f5160a0c
Author: Fei Long Wang <email address hidden>
Date: Mon Oct 21 23:19:32 2013 +0800

    Fixes error message encoding issue when using qpid

    Making the message only consist of primitive types
    before sending it by qpid.

    Fixes bug 1242734

    Change-Id: I3ff7a19af9a7671f955345ada6acfba8bf573c70

Changed in glance:
status: In Progress → Fix Committed
Changed in glance:
importance: Undecided → High
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to glance (stable/havana)

Reviewed: https://review.openstack.org/55855
Committed: http://github.com/openstack/glance/commit/870844d1c4fdd387d2c60b6ced8603117ab75c78
Submitter: Jenkins
Branch: stable/havana

commit 870844d1c4fdd387d2c60b6ced8603117ab75c78
Author: Fei Long Wang <email address hidden>
Date: Mon Oct 21 23:19:32 2013 +0800

    Fixes error message encoding issue when using qpid

    Making the message only consist of primitive types
    before sending it by qpid.

    Fixes bug 1242734

    Change-Id: I3ff7a19af9a7671f955345ada6acfba8bf573c70
    (cherry picked from commit 94b9e66360387d24548f165cc4c7ee67f5160a0c)

Feilong Wang (flwang)
Changed in glance:
milestone: none → icehouse-1
Thierry Carrez (ttx)
Changed in glance:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in glance:
milestone: icehouse-1 → 2014.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.