02-12-2025 09:01 AM
Hi Cisco Devnet,
I'm trying to use RisPort70 selectDeviceCMExt to get the realtime registration status of our CUCM managed devices. I have been able to call this api successfully every time with <100 devices using Axios, but when I increase the number of devices to around 200 or greater, this error will intermittently begin to appear and gets more common the greater the number of items in the request:
⨯ [Error [AxiosError]: stream has been aborted] {
code: 'ERR_BAD_RESPONSE',
config: [Object],
request: [ClientRequest],
constructor: [Function],
toJSON: [Function: toJSON]
}
Here is the soap request I'm making, which works when the number of items are low and begins to fail about 60% of the time when the number of items exceeds 200:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="http://schemas.cisco.com/ast/soap">
<soap:Header/>
<soap:Body>
<tns:selectCmDeviceExt xmlns:tns="http://schemas.cisco.com/ast/soap" xmlns="http://schemas.cisco.com/ast/soap">
<tns:StateInfo/>
<tns:CmSelectionCriteria>
<tns:MaxReturnedDevices>2000</tns:MaxReturnedDevices>
<tns:DeviceClass>Phone</tns:DeviceClass>
<tns:Model>255</tns:Model>
<tns:Status>Registered</tns:Status>
<tns:NodeName/>
<tns:SelectBy>Name</tns:SelectBy>
<tns:SelectItems>
<tns:item>
<tns:Item>SEP...</tns:Item>
</tns:item>
<tns:item>
<tns:Item>AN7...</tns:Item>
</tns:item>
....
</tns:SelectItems>
<tns:Protocol>Any</tns:Protocol>
<tns:DownloadStatus>Any</tns:DownloadStatus>
</tns:CmSelectionCriteria>
</tns:selectCmDeviceExt>
</soap:Body>
</soap:Envelope>
Wondering if anyone else has ran into this issue, & if this is an API issue or Axios problem? Because of the 15 request per minute limitation of RisPort, I would ideally want to put the maximum number of items (2000) per request.
02-12-2025 09:13 AM
Here is the full error object returned by axios:
{
message: 'stream has been aborted',
name: 'AxiosError',
description: undefined,
number: undefined,
fileName: undefined,
lineNumber: undefined,
columnNumber: undefined,
stack: 'AxiosError: stream has been aborted\n' +
' at IncomingMessage.handlerStreamAborted (webpack-internal:///(rsc)/./node_modules/axios/dist/node/axios.cjs:3114:23)\n' +
' at IncomingMessage.emit (node:events:519:28)\n' +
' at IncomingMessage._destroy (node:_http_incoming:221:10)\n' +
' at _destroy (node:internal/streams/destroy:122:10)\n' +
' at IncomingMessage.destroy (node:internal/streams/destroy:84:5)\n' +
' at TLSSocket.socketCloseListener (node:_http_client:466:11)\n' +
' at TLSSocket.emit (node:events:531:35)\n' +
' at node:net:343:12\n' +
' at TCP.done (node:_tls_wrap:650:7)\n' +
' at TCP.callbackTrampoline (node:internal/async_hooks:130:17)\n' +
' at Axios.request (webpack-internal:///(rsc)/./node_modules/axios/dist/node/axios.cjs:4252:41)\n' +
' at process.processTicksAndRejections (node:internal/process/task_queues:105:5)',
config: {
transitional: {
silentJSONParsing: true,
forcedJSONParsing: true,
clarifyTimeoutError: false
},
adapter: [ 'xhr', 'http', 'fetch' ],
transformRequest: [ [Function: transformRequest] ],
transformResponse: [Function: transformResponse],
timeout: 0,
xsrfCookieName: 'XSRF-TOKEN',
xsrfHeaderName: 'X-XSRF-TOKEN',
maxContentLength: -1,
maxBodyLength: -1,
env: { FormData: [Function], Blob: [class Blob] },
validateStatus: null,
headers: Object [AxiosHeaders] {
Accept: 'text/html,application/xhtml+xml,application/xml,text/xml;q=0.9,*/*;q=0.8',
'Content-Type': 'text/xml; charset=utf-8',
'User-Agent': 'node-soap/1.1.7',
'Accept-Encoding': 'none',
'Accept-Charset': 'utf-8',
Connection: 'close',
Host: '...',
'Content-Length': '52229',
SOAPAction: '"selectCmDeviceExt"',
Authorization: 'Basic ...'
},
url: 'https://...:8443/realtimeservice2/services/RISService70',
method: 'post',
(below seems like a valid response, I have just truncated it)
data: '<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="http://schemas.cisco.com/ast/soap"><soap:Header></soap:Header><soap:Body><tns:selectCmDeviceExt xmlns:tns="http://schemas.cisco.com/ast/soap" xmlns="http://schemas.cisco.com/ast/soap">
...
<tns:item'... 42229 more characters
},
code: 'ERR_BAD_RESPONSE',
status: undefined
}
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide