team-telnyx / telnyx-node

Node SDK for the Telnyx API
https://developers.telnyx.com/docs/api/v2/overview
MIT License
54 stars 20 forks source link

message.create results in: Error: An error occurred with our connection to Telnyx. #171

Closed TrevHeath closed 5 months ago

TrevHeath commented 6 months ago

Node: 16 Package version: 1.23.0

Looping through a list of numbers and calling messages.create results in many of the requests erroring. Is this a rate-limiting issue? If so, it is not clear.

Error: An error occurred with our connection to Telnyx.
at Constructor._Error (/var/task/node_modules/telnyx/lib/Error.js:12:17)
at Constructor (/var/task/node_modules/telnyx/lib/utils.js:160:15)
at new Constructor (/var/task/node_modules/telnyx/lib/utils.js:160:15)
at /var/task/node_modules/telnyx/lib/TelnyxResource.js:255:9
at ClientRequest.<anonymous> (/var/task/node_modules/telnyx/lib/TelnyxResource.js:455:67)
at ClientRequest.emit (node:events:513:28)
at TLSSocket.socketErrorListener (node:_http_client:494:9)
at TLSSocket.emit (node:events:513:28)
at emitErrorNT (node:internal/streams/destroy:157:8)
at emitErrorCloseNT (node:internal/streams/destroy:122:3) {
type: 'TelnyxConnectionError',
raw: {
message: 'An error occurred with our connection to Telnyx.',
responseBody: Error: connect EMFILE 172.67.26.14:443 - Local (undefined:undefined)
at internalConnect (node:net:1041:16)
at defaultTriggerAsyncIdScope (node:internal/async_hooks:464:18)
at GetAddrInfoReqWrap.emitLookup [as callback] (node:net:1187:9)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:111:8)
at GetAddrInfoReqWrap.callbackTrampoline (node:internal/async_hooks:130:17) {
errno: -24,
code: 'EMFILE',
syscall: 'connect',
address: '172.67.26.14',
port: 443
}
},
headers: undefined,
requestId: undefined,
statusCode: undefined,
responseBody: Error: connect EMFILE 172.67.26.14:443 - Local (undefined:undefined)
at internalConnect (node:net:1041:16)
at defaultTriggerAsyncIdScope (node:internal/async_hooks:464:18)
at GetAddrInfoReqWrap.emitLookup [as callback] (node:net:1187:9)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:111:8)
at GetAddrInfoReqWrap.callbackTrampoline (node:internal/async_hooks:130:17) {
errno: -24,
code: 'EMFILE',
syscall: 'connect',
address: '172.67.26.14',
port: 443
}
}
ADandyGuyInSpace commented 5 months ago

@TrevHeath Could be, do you have any way to replicate? How big is the throughput when the exception starts occurring?

You might be benifited from reaching out to support@telnyx.com and they can see your limits.