I hope you’re all doing well. I’m encountering the ‘connect ETIMEDOUT 18.210.243.26:443’ error, which seems to occur randomly during API calls. I’ve been trying to troubleshoot this on my own, but so far, I haven’t been able to pinpoint the exact cause. I am using the latest Asana API Node.js SDK.
Apologies for the late reply. Thanks @Phil_Seeman for pinging us.
Is this issue still happening for you? If so, do you mind sharing with us the full error that you received? I was not able to reproduce this issue.
My initial thought is this issue could be coming from one of:
Asana API
node-asana client library
I tried to test #2 by changing up the timeout settings for the client but got a different error from your ETIMEDOUT
This was what I tried:
const Asana = require('asana');
let defaultClient = Asana.ApiClient.instance;
let oauth2 = defaultClient.authentications['oauth2'];
defaultClient.timeout = 500; // Change timeout to 500 mili-seconds
oauth2.accessToken = "<ASANA_PERSONAL_ACCESS_TOKEN>";
let apiInstance = new Asana.StoriesApi();
let body = new Asana.TaskGidStoriesBody.constructFromObject({data: {text: "test"}});
let task_gid = "<TASK_GID>";
let opts = {};
apiInstance.createStoryForTask(body, task_gid, opts, (error, data, response) => {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + JSON.stringify(data, null, 2));
}
});
Result:
Error: Timeout of 500ms exceeded
at RequestBase._timeoutError (/<MY_PATH>/node_modules/superagent/lib/request-base.js:731:13)
at Timeout.<anonymous> (/<MY_PATH>/node_modules/superagent/lib/request-base.js:746:12)
at listOnTimeout (node:internal/timers:564:17)
at process.processTimers (node:internal/timers:507:7) {
timeout: 500,
code: 'ECONNABORTED',
errno: 'ETIME',
response: undefined
}
This leads me to think it could be #1 (an API timeout). If you get an error similar to the above than it might be an issue with our client library timing out the request.