Update (1/27/2014): We've migrated our community/forum experience to our DevNet Developer community at communities.cisco.com/community/developer.  We've locked the forums here on 1/24 from future entries, but are leaving them open for review for 30 days. To ask a new question or post a new comment please proceed to communities.cisco.com/community/developer and find the corresponding space supporting the technology you're interested in or working with.

To head back to DevNet, click here

Cisco Unified Presence APIs Developer Forums

« Back to SOAP API

RE: http protocol violation if server is too busy

Combination View Flat View Tree View
Threads [ Previous | Next ]
Hi

I presume that applies to all of Cisco's Webservices but this is the one that's currently bothering me. My colleagues were in the process of upgrading the lab presence server I'm using, so the server was returning a message telling me that the server is too busy to process the request - yet my .NET stub would simply throw an exception saying the server aborted the response prematurely aborted.

Looking at the traffic in Fiddler, I noted that Fiddler tells me about a protocol violation

BitFlags: [ProtocolViolationInResponse] 0x10000
X-HTTPPROTOCOL-VIOLATION: [ProtocolViolation] Illegal chunked encoding. 'HTTP/1.1 100 Continue' is not a hexadecimal number.
X-EGRESSPORT: 49083
X-RESPONSEBODYTRANSFERLENGTH: 730
X-CLIENTPORT: 49082
UI-BACKCOLOR: LightYellow
X-CLIENTIP: 127.0.0.1
X-UTILDECODERESPONSE: HTTP Error: The chunked content is corrupt. Chunk Length was malformed. Offset: 23
X-HOSTIP: 10.145.206.121
X-PROCESSINFO: presencetester.vshost:7004


Which has me worried - no wonder processing didn't terminate.

The message is still being delivered, but there's an encoding problem leading my program astray. Here's the actual message

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:cup="urn:cisco:cup:presence:soap"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Max cpu utilization reached</faultstring><detail>
    <description xmlns="urn:cisco:cup:presence:soap">
        <code>210</code>
        <message>Max cpu utilization reached</message>
        <fix>Wait before sending another request</fix>
    </description>
</detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>

This is on CUP 9.0.1.10000-21

Other errors come down just fine from the server. I've since upgraded to 9.1.1.20000-5 but have seen the same.

Sounds like you may have uncovered a bug.  From this message coming from Fiddler:
1X-HTTPPROTOCOL-VIOLATION: [ProtocolViolation] Illegal chunked encoding. 'HTTP/1.1 100 Continue' is not a hexadecimal number.
my guess is that the HTTP header sent from CUP is in some way malformed.  Any way you can attach a full HTTP request/response?  Tips on how to reproduce the problem may be helpful as well...

I'll keep wireshark running the next time I play around with the API. As far as I can tell, it doesn't matter which method is being called - but the server needs to be very busy. I first encoutered this issue when my colleague was upgrading CUP from 9.0 to 9.1 while I was testing API calls. I suspect that the VM server we have this running is not overpowered (to put it mildly) - even though there's literally no load on the system (it's a lab system).Here's a link to the full trace https://skydrive.live.com/embed?cid=EAF6A98542EF6194&resid=EAF6A98542EF6194%21962&authkey=AJT2E49h4eR7Qz4

I seem to have been able to extract the problematic response from your trace:
 1HTTP/1.1 503 Service Temporarily Unavailable
 2Date: Tue, 02 Jul 2013 16:13:46 GMT
 3Server: Apache/2.2.4 (Unix) DBL2/2.00 IMDB/1.00
 4Retry-After: 32
 5Connection: close
 6Transfer-Encoding: chunked
 7Content-Type: text/xml
 8
 9HTTP/1.1 100 Continue
10
112b5
12<?xml version="1.0" encoding="UTF-8"?>
13<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:cup="urn:cisco:cup:presence:soap"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Max cpu utilization reached</faultstring><detail>
14    <description xmlns="urn:cisco:cup:presence:soap">
15        <code>210</code>
16        <message>Max cpu utilization reached</message>
17        <fix>Wait before sending another request</fix>
18    </description>
19</detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
200
It seems clearly malformed (assuming the above is not an artifact of Fiddler.)  If you can reproduce while capturing the CUP logs we can open a defect directly: https://supportforums.cisco.com/docs/DOC-8807.  For the best support experience of course please open a DS case.