Why would an XML-RPC API endpoint randomly throw a ProtocolError -1?

1k Views Asked by At

We have built an extensive middleware system around Magento's XML-RPC API. We've wrapped the endpoint with Python and are doing a lot of multicalls.

At a seemingly random interval, the API responds with

ProtocolError for www.mydomain.com/api/xmlrpc/: -1

Is this Apache's funny way of saying "503 Service Unavailable" and if so, why might that be?

What's the ideal way of handling this exception? A retry on exception seems like it'd make the problem worse.

The web server is Ubuntu 10.04.1 PHP 5.3.2-1ubuntu4.5 with Suhosin-Patch & Zend Engine v2.3.0 The API is being called with Python's xmlrpclib.

1

There are 1 best solutions below

0
On

In general you should ALWAYS try/catch errors with XMLRPC/SOAP (to Magento) as you cannot guarantee the internet connection between A and B is working.

I think your error may be Python's way of saying '50x blah' or '404 blah' IF you have not fully looked at the error object:

http://docs.python.org/library/xmlrpclib.html#protocolerror-objects