Getting connect ETIMEDOUT from Auth0 Management Client

I am using Auth0 Management Client from Node.js:
var ManagementClient = require(‘auth0’).ManagementClient;

I am calling Management API “Get Users by an Email Address” for about 200K email addresses using following function:
https://auth0.github.io/node-auth0/module-management.UsersManager.html#getByEmail

I have executed this process several times and each time the socket connection is being closed randomly in the middle of the process.
It happened after 36K calls, around 90K calls, and then again after 120K calls.
Only once, I was successful processing entire set of 200K emails.
I don’t think, I am reaching Management API limit, but to be sure, I also added a “sleep” for 100 ms after each call.
Our contract with Auth0, allows for 166 requests per second, so I don’t think I am even close to this limit.

This is the error thrown from Auth0 Management Client API:

SanitizedError [APIError]: connect ETIMEDOUT 54.999.99.99:443
at /home/ciam-user/CIAM_users_migration/node_modules/rest-facade/src/Client.js:387:27
at Request.callback (/home/ciam-user/CIAM_users_migration/node_modules/superagent/lib/node/index.js:905:3)
at ClientRequest. (/home/ciam-user/CIAM_users_migration/node_modules/superagent/lib/node/index.js:822:12)
at ClientRequest.emit (node:events:369:20)
at TLSSocket.socketErrorListener (node:_http_client:462:9)
at TLSSocket.emit (node:events:369:20)
at emitErrorNT (node:internal/streams/destroy:188:8)
at emitErrorCloseNT (node:internal/streams/destroy:153:3)
at processTicksAndRejections (node:internal/process/task_queues:81:21) {
statusCode: ‘ETIMEDOUT’,
requestInfo: {
method: ‘get’,
url: ‘https://main.xxx.com/api/v2/users-by-email
},
originalError: Error: connect ETIMEDOUT 54.999.99.99:443
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1137:16) {
errno: -110,
code: ‘ETIMEDOUT’,
syscall: ‘connect’,
address: ‘54.999.99.99’,
port: 443,
response: undefined
}
}

1 Like