Error: connect ETIMEDOUT 54.210.4.251:443

Hi Airtable community.

Since yesterday i’m facing an issue with the app I’ve been developping. I haven’t made any modification to my code and it seems to only happen since i upgraded my computer to a faster CPU (I think it’s unrelated but still mention it just in case)

I have a method responsible for retrieving all the records from a table.

async function getTableAsArray(baseId, tableName, view, maxRecord) {

let table = []
let jsonTable = {}
jsonTable['name'] = tableName
jsonTable['records'] = {}
base = new Airtable({ apiKey: 'API-KEY' }).base(baseId);

await base(tableName).select({
    maxRecords: maxRecord,
    view: view
}).eachPage(function page(records, fetchNextPage) {
    
    // This function (`page`) will get called for each page of records.
   console.log(tableName)
   console.log(records)
    records.forEach(function (record, i) {
        if (i == 0){
            console.log('1000ms') 
        }
        
        Object.entries(record.fields).forEach(([key, value]) => {
        })
        jsonTable['records'][record.id] = record.fields
    });
    // To fetch the next page of records, call `fetchNextPage`.
    // If there are more records, `page` will get called again.
    // If there are no more records, `done` will get called.
    setTimeout(fetchNextPage,1000)
    ;
}).then(() => {
    // The promise is resolved when there are no more pages to fetch.
}).catch(err => {
    console.error(err);
    table = []
});
return jsonTable
}

Aware of the 5 queries/seconds limitation I have put a delay between every 100 records fetched.

The issue is that rather sporadically some batches will be skipped and this error will pop up :

Error: connect ETIMEDOUT 54.210.4.251:443

The error seems to not occur when the app is deployed to our AWS instance.

Here is a typical log (none of the tables here have more than 100 records :

Bases
helpers/tableManager.helper.js:322
(19) [Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record]
1000ms
helpers/tableManager.helper.js:326
Data type
helpers/tableManager.helper.js:322
(8) [Record, Record, Record, Record, Record, Record, Record, Record]
1000ms
helpers/tableManager.helper.js:326
Table
helpers/tableManager.helper.js:322
(56) [Record, Record, Record, Record, Record, ...]
1000ms
helpers/tableManager.helper.js:326
Change
helpers/tableManager.helper.js:322
(30) [Record, Record, Record, Record, Record, ...]
1000ms
helpers/tableManager.helper.js:326
Report Archive
helpers/tableManager.helper.js:322
(89) [Record, Record, Record, Record, Record, ...]
1000ms
helpers/tableManager.helper.js:326
Design
helpers/tableManager.helper.js:322
(24) [Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record]
1000ms
> helpers/tableManager.helper.js:326
> Error: connect ETIMEDOUT 54.210.4.251:443
>     at TCPConnectWrap.afterConnect [as oncomplete] (<node_internals>/net.js:1146:16)
>     at TCPConnectWrap.callbackTrampoline (internal/async_hooks.js:131:14) {errno: -4039, code: 'ETIMEDOUT', syscall: 'connect', address: '54.210.4.251', port: 443, …}
> Groups
> helpers/tableManager.helper.js:322

(100) [Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record, Record]

Bear in mind that the ETIMEDOUT is not always at the same fetch. and sometimes the codes run without error.

I can confirm :
No one else is using this airtable base or api key.

This topic was solved and automatically closed 15 days after the last reply. New replies are no longer allowed.