debugging xmlrpc servers

Discussion in 'Python' started by alan dot ezust at gmail dot com, Jan 23, 2005.

  1. Problems with XMLRPC

    I have an xmlrpc server with a method called results() which returns an
    XML
    message.

    I've been able to use this function without problems when I had only
    one client talking to one server. I have recently introduced a P2P
    aspect to this process and now I have servers calling each other's
    methods all the time.

    I am running into some bugs which I am unable to debug.

    I am using http://rpdb.digitalpeers.com/Download.htm

    As per the instructions, I called rpdb.set_trace() right before calling
    server.serve_forever().

    Then I ran the server, and ran the client. At a certain point, the
    client
    asks the server for the results(), and instead of getting a proper
    result, I
    get this exception:

    /usr/lib/python2.3/xmlrpclib.py in close(self=<xmlrpclib.Unmarshaller
    instance>)
    743 raise ResponseError()
    744 if self._type == "fault":
    745 raise Fault(**self._stack[0])
    746 return tuple(self._stack)
    747
    global Fault = <class xmlrpclib.Fault>, self = <xmlrpclib.Unmarshaller
    instance>, self._stack = [{'faultCode': 1, 'faultString':
    'exceptions.ValueError:too many values to unpack'}]

    Fault:
    args = ()
    faultCode = 1
    faultString = 'exceptions.ValueError:too many values to unpack'

    I thought that my rpdb problems were related to the fact that I was
    multiply-inheriting from SocketServer.ThreadingMixIn (which I believe
    starts
    a new thread for each incoming request), so I changed this:
    class QueryServer(SocketServer.ThreadingMixIn,
    SimpleXMLRPCServer.SimpleXMLRPCServer):
    to this:
    class QueryServer(SimpleXMLRPCServer.SimpleXMLRPCServer):

    I am still unable to set a breakpoint in the results() method. I'd
    really
    like to trace through it so I can figure out why I am getting this
    weird
    exception. Any ideas?
    alan dot ezust at gmail dot com, Jan 23, 2005
    #1
    1. Advertising

  2. I have difficulties understanding your probelem - is your own method giving
    you trouble (and the 'exceptions.ValueError:too many values to unpack')
    error or is it the remote debugger? Or do you simply not understand the
    error message itself.

    The error itself is raised in cases like this:

    a,b,c = (1,2,3,4)

    Now to see where that sort of statement fails, it would help if you'd give
    us the actual code for your result-method.


    --
    Regards,

    Diez B. Roggisch
    Diez B. Roggisch, Jan 23, 2005
    #2
    1. Advertising

  3. Understandable - i had difficulties understanding my problem too!

    I don't really understand why I got that error message before - I
    believe it was due to the fact that some other exception was being
    raised inside results().

    Anyway, the solution was to call rpdb.set_trace() inside the actual
    method which was being called by xmlrpc, and setting the breakpoint to
    be the statement following that line (rather than the function itself).
    cheers --alan
    alan dot ezust at gmail dot com, Jan 23, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Johann Blake
    Replies:
    1
    Views:
    1,187
    Hermit Dave
    Jan 5, 2004
  2. Etienne Posthumus
    Replies:
    1
    Views:
    1,094
    Roger Binns
    Apr 1, 2004
  3. ted holden

    Python xmlrpc servers?

    ted holden, Dec 1, 2004, in forum: Python
    Replies:
    9
    Views:
    789
    ted holden
    Dec 1, 2004
  4. jacob navia

    Debugging C vs debugging C++

    jacob navia, Oct 26, 2006, in forum: C Programming
    Replies:
    11
    Views:
    575
    Ian Collins
    Oct 27, 2006
  5. Alex Young

    Testing XMLRPC::Servers

    Alex Young, May 17, 2007, in forum: Ruby
    Replies:
    2
    Views:
    139
    Alex Young
    May 17, 2007
Loading...

Share This Page