0
votes

We are seeing softlayer APIs throwing certain exceptions 'intermittently'. I want to know what could cause these exceptions, and how to handle these situations. Retrying the operation is one possibility. Any other suggestions are welcome.

The APIs and exceptions are listed below -

account.getNetworkStorage() - throws: SoftLayer.exceptions.TransportError: TransportError(0): HTTPSConnectionPool(host='api.softlayer.com', port=443): Read timed out.

OR

SoftLayer.exceptions.TransportError: TransportError(0): ("Connection broken: error(104, 'Connection reset by peer')", error(104, 'Connection reset by peer'))

Why would server close its end of the connection?

storage.getReplicationStatus(id=storageid) - throws: SoftLayer.exceptions.NotWellFormed: NotWellFormed(-32700): parse error. not well formed

I call this API in a loop, and it successfully returned before failing. So why would server randomly send a malformed response? Or could the transport layer messed it up?

Thanks,

~ Urjit

1

1 Answers

0
votes

Are you using a proxy? If you are, then it would be helpfully to see if the issue is reproducible without one. It could also be an error due to the response sending a big amount of data. To solve this you could use a result limit in the next way (for python client).

Account.getNetWorkStorage(limit=5, offset=0)

For further information on result limits, see:

http://softlayer-api-python-client.readthedocs.io/en/latest/api/client/

https://sldn.softlayer.com/article/using-result-limits-softlayer-api

Finally, if the loop depends on the previous result (i.e. the source code where the TransportError’s been thrown) then an error of not well formed is possible.

SoftLayer documentation states the next for -32700. -32700 "'parse error. not well formed" Your request contained invalid XML. Various, usually the name of the API service you're requesting. Various Your API call encountered an error not represented by the errors above. Most faults belong to this category and result form an error encountered by SoftLayer while executing your method.

See the next link on XML-RPC: http://sldn.softlayer.com/article/xml-rpc