moosic client throws ProtocolError

Bug #95532 reported by Sjoerd Hemminga
8
Affects Status Importance Assigned to Milestone
moosic (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: moosic

The moosic client dies with a ProtocolError when connecting to the moosicd daemon. moosicd doesn't give any helpful output at that point, but moosic itself shows this traceback:

sjoerd@cicero:~$ moosic list
Traceback (most recent call last):
  File "/usr/bin/moosic", line 6, in <module>
    main(sys.argv)
  File "/usr/lib/python2.5/site-packages/moosic/client/cli/main.py", line 238, in main
    moosic.no_op()
  File "/usr/lib/python2.5/xmlrpclib.py", line 1147, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib/python2.5/xmlrpclib.py", line 1437, in __request
    verbose=self.__verbose
  File "/usr/lib/python2.5/xmlrpclib.py", line 1191, in request
    headers
xmlrpclib.ProtocolError: <ProtocolError for %2Fhome%2Fsjoerd%2F.moosic%2Fsocket/: 500 Internal Server Error>

I tried running over TCP/IP (same problem) and faking to be a client (by using it's message to an earlier faked server) using nc, I got the following session:

sjoerd@cicero:~$ nc localhost 9090
POST / HTTP/1.0
Host: localhost:9090
User-Agent: xmlrpclib.py/1.0.1 (by www.pythonware.com)
Content-Type: text/xml
Content-Length: 99

<?xml version='1.0'?>
<methodCall>
<methodName>no_op</methodName>
<params>
</params>
</methodCall>
HTTP/1.0 500 Internal Server Error
Server: BaseHTTP/0.3 Python/2.5
Date: Sat, 24 Mar 2007 16:04:24 GMT

I also ran both client and server in Python 2.4. This worked. So it seems the problem is with Python 2.5. It's also not a problem for a client in Python 2.5 to talk to a server in Python 2.4. A Python 2.4 client talking to a Python 2.5 client throws the same error.

Revision history for this message
Sjoerd Hemminga (sjoerd-hemminga) wrote :

Oops. Forgot some important basic information. This is Feisty Fawn. moosic package version 1.5.2-2ubuntu1 and python package version 2.5-5ubuntu10.

Revision history for this message
Forest Bond (forest-bond) wrote :

Same problem here.

I was going to try to run this using Python 2.4 to see if it makes a difference, but moosic is now python >> 2.5, so no Python 2.4 modules are installed. Not sure why this version restriction is applied.

Revision history for this message
Luxiang (luxiang) wrote :

Still don't work now. Has anyone managed to solve this problem?

Revision history for this message
Forest Bond (forest-bond) wrote :

I was hoping to do some debugging, but didn't have time to get very far. As a work around, moosic still works fine with Python 2.4, so you can force it to use that by:

 * Install Python 2.4 and the relevant python2.4-* packages
 * Editing /usr/bin/moosic and /usr/bin/moosicd such that the first line reads #!/usr/bin/python2.4 .
 * Creating two symlinks:
    - /usr/lib/python2.4/site-packages/moosic -> /usr/lib/python2.5/site-packages/moosic
    - /usr/lib/python2.4/site-packages/moosic.egg-info -> /usr/lib/python2.5/site-packages/moosic.egg-info

That should mostly do the trick, however, it's very much a work-around, and isn't recommended.

Revision history for this message
Daniel Pearson (daniel-nanoo) wrote :

I've corrected this incompatibility with Python 2.5. It turns out the internal structure of the SimpleXMLRPCServer class changed in Python 2.5, and this broke the UnixMoosicServer and TcpMoosicServer classes. This happened because I was very naughtily breaking the encapsulation of that class by overriding its constructor and compensating with code copied from SimpleXMLRPCServer's source. The Moosic classes now properly delegate to SimpleXMLRPCServer's constructor, so changes in the structure of an SimpleXMLRPCServer object should no longer futz things up. This change will be included with Moosic version 1.5.4. In the meantime, you can use the attached patch.

Revision history for this message
Forest Bond (forest-bond) wrote : Re: [Bug 95532] Re: moosic client throws ProtocolError

On Thu, Jul 12, 2007 at 12:06:32PM -0000, Daniel Pearson wrote:
> I've corrected this incompatibility with Python 2.5. It turns out the
> internal structure of the SimpleXMLRPCServer class changed in Python
> 2.5, and this broke the UnixMoosicServer and TcpMoosicServer classes.
> This happened because I was very naughtily breaking the encapsulation of
> that class by overriding its constructor and compensating with code
> copied from SimpleXMLRPCServer's source. The Moosic classes now properly
> delegate to SimpleXMLRPCServer's constructor, so changes in the
> structure of an SimpleXMLRPCServer object should no longer futz things
> up. This change will be included with Moosic version 1.5.4. In the
> meantime, you can use the attached patch.

Thanks, Daniel!

-Forest

Daniel T Chen (crimsun)
Changed in moosic:
status: New → 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.