Ticket #18 (closed Defect: Fixed)

Opened 12 months ago

Last modified 12 months ago

OpenXcap exception: TypeError in twisted.web2.stream.IByteStream

Reported by: gregorio Owned by: ruud
Priority: Minor Milestone:
Component: XCAP protocol Version:
Severity: Non-critical Keywords: TypeError IByteStream
Cc:

Description

Hi all. I already posted this in openSer mailing list but nobody could help me.

I get an exception in openXcap when I send a GET to retrieve the resources file.

I explain the process I followed:


<----Receive 404, because there is not file.


Body;

<?xml version='1.0' encoding='UTF-8'?>

<resource-lists xmlns='urn:ietf:params:xml:ns:resource-lists' xmlns:cp='urn:ietf:params:xml:ns:copycontrol'>

<list></list>

</resource-lists>

<----Receive 200 OK. So openXcap likes my document.


<---- Receive 500 “An error occurred rendering the requested page. More information is available in the server log”. So the same document that was accepted in the PUT throws an exception.

The server log says:

Oct 30 15:01:55 localhost openxcap[2791]: [-] Exception rendering:

Oct 30 15:01:55 localhost openxcap[2791]: [-] Traceback (most recent call last):

Oct 30 15:01:55 localhost openxcap[2791]: [-] File "/usr/lib/python2.4/site-packages/twisted/internet/posixbase.py", line 228, in mainLoop

Oct 30 15:01:55 localhost openxcap[2791]: [-] self.runUntilCurrent()

Oct 30 15:01:55 localhost openxcap[2791]: [-] File "/usr/lib/python2.4/site-packages/twisted/internet/base.py", line 533, in runUntilCurrent

Oct 30 15:01:55 localhost openxcap[2791]: [-] f(*a, **kw)

Oct 30 15:01:55 localhost openxcap[2791]: [-] File "/usr/lib/python2.4/site-packages/twisted/internet/defer.py", line 239, in callback

Oct 30 15:01:55 localhost openxcap[2791]: [-] self._startRunCallbacks(result)

Oct 30 15:01:55 localhost openxcap[2791]: [-] File "/usr/lib/python2.4/site-packages/twisted/internet/defer.py", line 304, in _startRunCallbacks

Oct 30 15:01:55 localhost openxcap[2791]: [-] self._runCallbacks()

Oct 30 15:01:55 localhost openxcap[2791]: [-] --- <exception caught here> ---

Oct 30 15:01:55 localhost openxcap[2791]: [-] File "/usr/lib/python2.4/site-packages/twisted/internet/defer.py", line 317, in _runCallbacks

Oct 30 15:01:55 localhost openxcap[2791]: [-] self.result = callback(self.result, *args, **kw)

Oct 30 15:01:55 localhost openxcap[2791]: [-] File "/usr/lib/python2.4/site-packages/xcap/resource.py", line 51, in sendResponse

Oct 30 15:01:55 localhost openxcap[2791]: [-] response = http.Response(response.code, stream=response.data)

Oct 30 15:01:55 localhost openxcap[2791]: [-] File "/usr/lib/python2.4/site-packages/twisted/web2/http.py", line 109, in init

Oct 30 15:01:55 localhost openxcap[2791]: [-] self.stream = IByteStream(stream)

Oct 30 15:01:55 localhost openxcap[2791]: [-] exceptions.TypeError: ('Could not adapt', array('c', "<?xml version='1.0' encoding='UTF-8'?><resource-lists xmlns='urn:ietf:params:xml:ns:resource-lists' xmlns:cp='urn:ietf:params:xml:ns:copycontrol'><list></list></resource-lists>"), <InterfaceClass twisted.web2.stream.IByteStream>)

Anyone know what is wrong?

Thanks and best regards.

Gregorio

Change History

  Changed 12 months ago by ruud

  • owner changed from Mircea Amarascu to ruud
  • status changed from new to assigned

Hi Gregorio,

Could you please tell me what version of the python MySQLdb module you are using?

  Changed 12 months ago by gregorio

Hi.

I think the version is MySQL-python-1.2.1. I did "rpm -qa|grep python", is it right?

Regards.

follow-up: ↓ 4   Changed 12 months ago by ruud

  • status changed from assigned to closed
  • resolution changed from To be investigated to Fixed

Please upgrade to version 1.2.2 of MySQL-python. From the 1.2.2 changelog:

"BLOB columns are now returned as Python strings instead of byte arrays."

in reply to: ↑ 3   Changed 12 months ago by diego

  • priority changed from Minor to Major
  • status changed from closed to reopened
  • resolution Fixed deleted

Hi,

I have the same error as Gregorio, and when I try to upgrade to version 1.2.2 of MySQL-python, it requires Python 2.5. I have Python 2.4 installed (as appears in the openXCAP requirements), so I tried to install the rpm (1.2.2) without dependencies, but it seems not to work. Is it possible to copy into the CentOS only the libraries needed for the current problem?

Regards

  Changed 12 months ago by ruud

  • priority changed from Major to Minor
  • status changed from reopened to closed
  • resolution set to Fixed
  • severity changed from Critical to Non-critical

Python 2.5 does not seem to be a requirement for MySQL-python 1.2.2. Indeed we have tested it with Python 2.4 and MySQL-python 1.2.2 on debian, which is the distribution we recommend for OpenXCAP.

If this does not work in your distribution you may have to install it manually for Python 2.4.

Note: See TracTickets for help on using tickets.