Error connect etimedout что это

Hello,i am having this error in my production server ,the same code its working on my UAT server. its giving me [Error: connect ETIMEDOUT] { [Error: connect ETIMEDOUT] errorno: 'ETIMEDOUT',...

I fought this same error for about 2 days when using Nodejs mysql module in AWS Lambda when trying to connect to a database in a VPC. It is a very tough problem to debug because Lambda’s logging is so flaky (depending on the error you may not get log data at all).

@dougwilson had the right thought in that it is most likely is a networking issue.

@hagen is certainly right that all those factors have to be worked out first before it will even consider working. Also, if you are accessing a service that is not in the same VPC as your Lambda function you will need a route to it, probably using a VPC NAT Gateway, NOTE: a VPC Internet Gateway will not work as you might think because Lambda does not allocate a public IP address to its ENI, only a private IP address from one of the VPC subnets you select in Lambda’s «Configuration».

If you can work all that out, which is not easy! Chances are it still will not work if you are using traditional Nodejs code logic. This is due primarily, because Lambda’s have a high start-up delay and automatically passivate and reactive depending on when and how often they are accessed. This causes mysql’s data connection pools to work sometimes and fail other times. Often what you will see is that the mysql connection works fine the first invocation then fails most of the time afterwards. If you see this behavior you are half way to solving the problem as it means you have solved all of the AWS VPC networking issues and are now facing Lambda delay, passivation, reactivation issues. These issues can be fixed by modifying your Nodejs Lambda’s source code logic.

I have tried to provide a simplified example of what you need to do below:

`
const VERSION = «1»;
console.log(«asclepiusrod.net Lambda Tutorial » + VERSION + » starting up…»);
process.env[‘PATH’] = process.env[‘PATH’] + ‘:’ + process.env[‘LAMBDA_TASK_ROOT’];

//CMT You must install below packages first i.e. npm install fs, npm install await, npm install aws-sdk, npm install mysql npm install mysql2

const fs = require(‘fs’);
const Await = require(‘await’);
const AWS = require(‘aws-sdk’);
const mysql = require(‘mysql’);
//const mysql = require(‘mysql2’);

const DATABASE_HOST = process.env[‘DATABASE_HOST’];
const DATABASE_USERNAME = process.env[‘DATABASE_USERNAME’];
const DATABASE_PASSWORD_ENCRYPTED = process.env[‘DATABASE_PASSWORD’];
let DATABASE_PASSWORD;
const DATABASE_SCHEMA = process.env[‘DATABASE_SCHEMA’];
const DATABASE_POOL_LIMIT = process.env[‘DATABASE_POOL_LIMIT’];
const DATABASE_CONNECT_TIMEOUT_MILLI = process.env[‘DATABASE_CONNECT_TIMEOUT_MILLI’];
const DATABASE_TEST_TABLE = process.env[‘DATABASE_TEST_TABLE’];
const KMS_REGION = new String(process.env[‘KMS_REGION’]);

var mySqlPool;
var AWSEvent;
var AWSContext;
var AWSCallback;
var promise1;
var promise2;
var promise3;
AWS.config.update(KMS_REGION);
//AWS.config.update({region: ‘us-east-1’});

makePromise3();
makePromise2();
makePromise1();

decryptENV();

function makePromise1() {
promise1 = Await(‘DATABASE_PASSWORD’);
promise1.onkeep(function (got) {
console.info(‘[OK] Promise1 kept, creating database connection pool…’);
DATABASE_PASSWORD = got.DATABASE_PASSWORD;
createDBConnectionPool();
testDBConnection();
})
.onfail(function (err) {
console.error(‘[FATAL!] [ERROR!] Promise1 not kept!’ + err, err.stack);
promise2.fail(err);
})
.onresolve(function () {
console.info(‘[INFO] Promise1 resolved.’);
});
}
function makePromise2() {
promise2 = Await(‘isDBTestSuccessful’, ‘isAWSReady’);
promise2.onkeep(function (got) {
console.log(‘[OK] Promise2 kept, database test successful.’);
AWSContext.callbackWaitsForEmptyEventLoop = false;
get(AWSEvent, AWSContext);
})
.onfail(function (err) {
console.error(‘[FATAL!] [ERROR!] Promise2 not kept!’ + err, err.stack);
promise3.fail(err);
})
.onresolve(function () {
console.info(‘[INFO] Promise2 resolved.’);
});
}

function makePromise3() {
promise3 = Await(‘response’);
promise3.onkeep(function (got) {
console.info(‘[OK] Promise3 kept, database test successful.’);
//CMT — export.handler final success return
AWSCallback(null, JSON.stringify(got.response));
console.info(‘[OK] Lambda function completed successfully, ok to to end process once threads finish wrapping up. ADMIN_CODE: 75’);
})
.onfail(function (err) {
console.error(‘[FATAL!] [ERROR!] Promise3 not kept!’ + err, err.stack);
//CMT — export.handler final failure return
AWSCallback(err);
console.error(‘[FATAL!] Lambda function completed unsuccessfully, ok to to end process. ADMIN_CODE: 82’);
})
.onresolve(function () {
console.info(‘[INFO] Promise3 resolved.’);
//CMT — Not sure it is efficent to execute end() and may cause intermittent timesouts to requests — mySqlPool.end();
AWSContext.done();
//CMT — index.js final return
return;
});
}

function decryptENV() {
console.log(‘Decrypting enviroment variables…’);
//Put logic here to keep promise1
}

function createDBConnectionPool() {
try {
if (!mySqlPool)
{
mySqlPool = mysql.createPool({
connectTimeout: DATABASE_CONNECT_TIMEOUT_MILLI,
connectionLimit: DATABASE_POOL_LIMIT,
host: DATABASE_HOST,
user: DATABASE_USERNAME,
password: DATABASE_PASSWORD,
database: DATABASE_SCHEMA,
authSwitchHandler: ‘mysql_native_password’
});

        mySqlPool.on('connection', function (connection) {
            console.log('mySqlPool established a database connection.');
        });

        mySqlPool.on('error', function (err) {
            console.warn('mySqlPool database connection pool failed!' + err, err.stack);
            promise2.fail(err);
        });
    }
    return mySqlPool;
} catch (err)
{
    console.error("FATAL! ERROR! Cannot create connection pool!  Verify that your credentials in ENV are correct. ADMIN_CODE: 122 ", err);
    promise2.fail(err);
}

}

function testDBConnection() {
console.log(«Connecting to database…»);
try {
if (!mySqlPool)
{
createDBConnectionPool();
console.log(«mySqlPool not ready, requesting pool initialization…»);
}
mySqlPool.getConnection(function (err, con) {
if (err)
{
console.warn(«WARN! Unable to create database connection pool! Will try again later. ADMIN_CODE: 138 ; «, err);
//CMT Do not fail promise here as you might think — promise2.fail(err);
return false;
} else
{
console.log(«SUCCESS. MySql database pool online.»);
promise2.keep(‘isDBTestSuccessful’, true);
con.release();
return true;
}
});
} catch (err)
{
console.error(«[FATAL!] [ERROR!] Cannot connect to database! Verify that your credentials in ENV are correct and that database is online and you have a route. ADMIN_CODE: 151 «, err);
promise2.fail(err);
return false;
}
}

/*

  • //CNT Uncomment and comment exports.handler line to test local

function exitNow(err)
{
process.exit(1);
return err;
}

function t1(event, context, callback) {
*/

exports.handler = function (event, context, callback) {
AWSEvent = event;
AWSContext = context;
AWSCallback = callback;

makePromise3();
if (!testDBConnection())
{        
    makePromise2();
}
promise2.keep('isAWSReady', true);

}

function get(myAWSEvent, myAWSContext) {
var myResponse = null;
var header = «»;
var footer = «»;
var welcome = «

Welcome to Lambda Tutorial vR» + VERSION + «.»;
welcome += «

App Server is online.

Database server is «;
try {
mySqlPool.getConnection(function (err, con) {
if (err)
{
console.error(«FATAL! ERROR! Could not create connection pool or port not open! ADMIN_CODE: 192 ; «, err);
console.warn(«Database is OFFLINE.»);

            myResponse = header + welcome + footer;
            promise3.keep('response', myResponse);
            return;
        } else
        {
            console.log("Accessing database...");
            var sql = "SELECT * FROM " + DATABASE_TEST_TABLE + " LIMIT 1 ;";
            con.query(sql, function (err, rows, fields) {
                if (err)
                {
                    console.warn("Database is OFFLINE.");
                    console.error("[FATAL!] [ERROR!] Executing SELECT query on database. ADMIN_CODE: 207 ; ", err);
                    welcome += "offline! Please try again later. ";                        
                } else {
                    console.info("Database is ONLINE.");
                    welcome += "online. <p>Congratulation! You have fixed the problem. Lambda is working!";
                }
                myResponse = header + welcome + footer;
                promise3.keep('response', myResponse);
                con.release();
                return;
            });
        }
    });
} catch (err) {
    console.error("[FATAL!] [ERROR!] Could not create connection pool or port not open! ADMIN_CODE: 221 ; ", err);
    console.warn("Database is OFFLINE.");
    welcome += "offline! <p>Please try again later. ";
    
    myResponse = header + welcome + footer;
    promise3.keep('response', myResponse);
    return;
}

}

`

Good Luck!
Sam

I have run the collection of requests with monitor feature in Postman. So, I had run this collection on the web-site and after some time I got an error in the console log:

18:47:35Preparing run.
18:47:35Running...Hide run logs
Line Number Timestamp   Console Output
1   18:47:35    SMOKE APP GW part 2 started
2   18:47:35    Get 'auth token' A
3   18:47:35    POST http://watch.test.com/app-gw/sandbox/login
4   18:49:45    Error: connect ETIMEDOUT 10.91.4.57:80
5   18:49:45    JSONError: Unexpected token u in JSON at position 0
6   18:49:45    JSONError: Unexpected token u in JSON at position 0
7   18:49:45    Get all services A
8   18:49:45    GET http://watch.test.com/app-gw/services?Authorization=6abbd51ee77c2112cce5b59587c7251c
9   18:51:56    Failed: Status code is 200
10  18:51:56    expected { Object (id, _details, ...) } to have property 'code'
11  18:51:56    Failed: Check the name of using service
12  18:51:56    object tested must be an array, a map, an object, a set, a string, or a weakset, but undefined given
13  18:51:56    Failed: Response time is less than 2000ms
14  18:51:56    expected undefined to be a number or a date
15  18:52:35    SMOKE APP GW part 2 finished
16  18:52:35    Error: callback timed out
18:52:35Run failed.

How can I debug this issue?

I have run the collection of requests with monitor feature in Postman. So, I had run this collection on the web-site and after some time I got an error in the console log:

18:47:35Preparing run.
18:47:35Running...Hide run logs
Line Number Timestamp   Console Output
1   18:47:35    SMOKE APP GW part 2 started
2   18:47:35    Get 'auth token' A
3   18:47:35    POST http://watch.test.com/app-gw/sandbox/login
4   18:49:45    Error: connect ETIMEDOUT 10.91.4.57:80
5   18:49:45    JSONError: Unexpected token u in JSON at position 0
6   18:49:45    JSONError: Unexpected token u in JSON at position 0
7   18:49:45    Get all services A
8   18:49:45    GET http://watch.test.com/app-gw/services?Authorization=6abbd51ee77c2112cce5b59587c7251c
9   18:51:56    Failed: Status code is 200
10  18:51:56    expected { Object (id, _details, ...) } to have property 'code'
11  18:51:56    Failed: Check the name of using service
12  18:51:56    object tested must be an array, a map, an object, a set, a string, or a weakset, but undefined given
13  18:51:56    Failed: Response time is less than 2000ms
14  18:51:56    expected undefined to be a number or a date
15  18:52:35    SMOKE APP GW part 2 finished
16  18:52:35    Error: callback timed out
18:52:35Run failed.

How can I debug this issue?

[Error: connect ETIMEDOUT] #1474

Comments

Hello,i am having this error in my production server ,the same code its working on my UAT server. its giving me [Error: connect ETIMEDOUT]

The db is hosted into a remote server and the DATABASE_USER has all the permission it needed.
thanks in advance .

The text was updated successfully, but these errors were encountered:

Hi @nilasissen the error Error: connect ETIMEDOUT is from the Node.js networking code. It means that a TCP connection could not be established to your MySQL server. Usually this is a networking or firewall issue.

Hi there, I am having same issue with ETIMEDOUT as well. This code runs fine on localhost but not on production. Also, I’ve tested regular connections and pooled connection(without running a query) and those work too. Here is code:

I can connect just fine using connection.connect() or pool.getConnection() without a query. Any ideas on how to resolve?

Hi @cashFLO960 the error Error: connect ETIMEDOUT is from the Node.js networking code. It means that a TCP connection could not be established to your MySQL server. Usually this is a networking or firewall issue.

I saw that in previous responses. I am able to connect and query just fine using var connection = mysql.createConnection(). why would that work but not pool?

Hi @cashFLO960, mysql.createConnection does not actually connect to the server until you try and make a query, which is different from how the pool works. I see above you said that you said «I can connect just fine [. ] without a query». Can you actually make a query using mysql.createConnection ?

Yes. I am able to connect and query just fine using mysql.createConnection which is why I find this so confusing. I really appreciate the help here. My other solution was to just use createConnection but I was really having a hard time managing all the different connections coming from different users.

Huh, @cashFLO960, that’s the weirdest thing I’ve heard 🙂 I know you provided a little bit of code above, but can you maybe provide full code that I can use to reproduce the issue? Probably need all of the following:

  1. Version of Node.js you are using
  2. Version of this module you are using
  3. Full code that shows your working mysql.createConnection code. Please make sure this code is complete and not a snippet so I can actually run it without making assumptions.
  4. Full code that shows the pool code that does not work. Please make sure this code is complete and not a snippet so I can actually run it without making assumptions.

Absolutely. I updated most of the code to «pool» after it worked on local host. I’ll find previous version in my git repo and send it this evening.
Thank you!

  1. Node Version = 4.2.3
  2. Using mysql»: «*» in package.json
    3.

var connection = mysql.createConnection( <
host: ‘xxx’,
user: ‘xxx’,
password: ‘xxx’,
database: ‘xxx’,

app.get(‘/test1’,
//require(‘connect-ensure-login’).ensureLoggedIn(),
function (req, res) <
var testQuery = ‘select * from table1’
connection.query(testQuery, function (error, results, fields) <
console.log(results);
res.render(‘test1’, < user: req.user, results: results>);
>);
>);

var pool = mysql.createPool( <
connectionLimit: 10,
acquireTimeout: 30000, //30 secs
host: ‘xxx’,
user: ‘xxx’,
password: ‘xxx’,
database: ‘xxx’,
minConnections: 1,

app.get(‘/test’,
//require(‘connect-ensure-login’).ensureLoggedIn(),
function (req, res) <

Thank you so much for helping out with this.

@cashFLO960 which version are you actually using (i.e. is installed)?

Also, @cashFLO960 , I tried to copy and paste the both pieces of of code into files and when I run them, I get the following error:

ReferenceError: mysql is not defined

What am I missing?

@dougwilson the reason I wanted to use pools is because I can’t stay indefinitely connected to our dB and didn’t want to write a bunch of code to manage individual connections. From my understanding, pools are supposed to help with that correct? Also, our app server is on Azure and dB is on AWS, don’t know if that helps at all.

From my understanding, pools are supposed to help with that correct?

Yes. I’m not saying you cannot use pools, I just honestly have no idea why your pool code does not work and your non-pool code does. The snippets you provided show no obvious issues, so I really would like to reproduce the issue to understand.

Also, our app server is on Azure and dB is on AWS, don’t know if that helps at all.

I don’t have any experience with that setup, so have no idea.

So I assume I’m supposed to paste that at the top of the files. When I run them now, I get the following error:
Error: Cannot find module ‘express’

What version of the express module should I install? I assume that the other modules you have required I’ll ned as well, if you can provide all those versions too.

I just C/p the «require» variables. I’ve isolated this to the most simple app possible. It is literally just a basic express app (v 4.14.0) with mysql(2.11.1).

I just don’t understand why it works on local host but not production. And then why pooled does not work but the other does.

FWIW, I did just boot up the app on production and the pooled connections worked one time. On refresh, I got the same error and have not been able to reproduce.

I just don’t understand why it works on local host but not production. And then why pooled does not work but the other does.

Yes, I’m not sure, either. Unless I can reproduce the issue, you’re probably the one one who has the tools & environment access to answer that question.

It might not be related, but I got Error: connect ETIMEDOUT because the default value for the createConnection option connectTimeout (10000 or 10sec) was not enough which obviously has an easy fix.

My theory for my case is something like this:

  • . some code
  • make a query: connection.query(..) (async)
  • . do some intensive coding that «takes up» the whole node thread, not giving room for the query callback function to trigger before the timeout is past

For me, I had some code that was working synchronously and did some heavy lifting that lasted for almost a minutte. Setting the connectTimeout option to 60000 did the trick for me.

I spend a couple of days debugging this problem. Even though I found a fix, I’m still not really satisfied with my «theory», but I don’t know enough about how node works to fully understand this.

I also have this error,too.
However ,finally I found problem layed where I didn’t grant privilages for my remote db account. After granting operation , problem solved!
I hope this can help more guys!

Unless someone can provide some kind of additional insight other than what has been provided here, there isn’t much for us to act on since there hasn’t been anything to reproduce the issue, and thus debug and fix. If you can offer up a PR that fixes the issue, that is probably the best method to move this forward.

This same issue is cropping up in different forms, but is essentially:
«My Nodejs Lambda using mysql gets TIMEDOUT»
The fix is to ensure that your security groups are correctly configured — RDS instance must be in one, Lambda must be in one. Lambda must also be in the same VPC as RDS, and have the policy AWSLambdaVPCAccessExecutionRole (note, it is a policy NOT a role, as the name suggests). Once you have your Lambda and RDS in different SGs, you must allow TCP traffic into your RDS SG from the Lambda’s SG. As @dougwilson keeps saying, this is a TCP/networking issue. The explanation above is the ‘exact’ networking issue.

I fought this same error for about 2 days when using Nodejs mysql module in AWS Lambda when trying to connect to a database in a VPC. It is a very tough problem to debug because Lambda’s logging is so flaky (depending on the error you may not get log data at all).

@dougwilson had the right thought in that it is most likely is a networking issue.

@hagen is certainly right that all those factors have to be worked out first before it will even consider working. Also, if you are accessing a service that is not in the same VPC as your Lambda function you will need a route to it, probably using a VPC NAT Gateway, NOTE: a VPC Internet Gateway will not work as you might think because Lambda does not allocate a public IP address to its ENI, only a private IP address from one of the VPC subnets you select in Lambda’s «Configuration».

If you can work all that out, which is not easy! Chances are it still will not work if you are using traditional Nodejs code logic. This is due primarily, because Lambda’s have a high start-up delay and automatically passivate and reactive depending on when and how often they are accessed. This causes mysql’s data connection pools to work sometimes and fail other times. Often what you will see is that the mysql connection works fine the first invocation then fails most of the time afterwards. If you see this behavior you are half way to solving the problem as it means you have solved all of the AWS VPC networking issues and are now facing Lambda delay, passivation, reactivation issues. These issues can be fixed by modifying your Nodejs Lambda’s source code logic.

I have tried to provide a simplified example of what you need to do below:

`
const VERSION = «1»;
console.log(«asclepiusrod.net Lambda Tutorial » + VERSION + » starting up. «);
process.env[‘PATH’] = process.env[‘PATH’] + ‘:’ + process.env[‘LAMBDA_TASK_ROOT’];

//CMT You must install below packages first i.e. npm install fs, npm install await, npm install aws-sdk, npm install mysql npm install mysql2

const fs = require(‘fs’);
const Await = require(‘await’);
const AWS = require(‘aws-sdk’);
const mysql = require(‘mysql’);
//const mysql = require(‘mysql2’);

const DATABASE_HOST = process.env[‘DATABASE_HOST’];
const DATABASE_USERNAME = process.env[‘DATABASE_USERNAME’];
const DATABASE_PASSWORD_ENCRYPTED = process.env[‘DATABASE_PASSWORD’];
let DATABASE_PASSWORD;
const DATABASE_SCHEMA = process.env[‘DATABASE_SCHEMA’];
const DATABASE_POOL_LIMIT = process.env[‘DATABASE_POOL_LIMIT’];
const DATABASE_CONNECT_TIMEOUT_MILLI = process.env[‘DATABASE_CONNECT_TIMEOUT_MILLI’];
const DATABASE_TEST_TABLE = process.env[‘DATABASE_TEST_TABLE’];
const KMS_REGION = new String(process.env[‘KMS_REGION’]);

var mySqlPool;
var AWSEvent;
var AWSContext;
var AWSCallback;
var promise1;
var promise2;
var promise3;
AWS.config.update(KMS_REGION);
//AWS.config.update();

makePromise3();
makePromise2();
makePromise1();

function makePromise1() <
promise1 = Await(‘DATABASE_PASSWORD’);
promise1.onkeep(function (got) <
console.info(‘[OK] Promise1 kept, creating database connection pool. ‘);
DATABASE_PASSWORD = got.DATABASE_PASSWORD;
createDBConnectionPool();
testDBConnection();
>)
.onfail(function (err) <
console.error(‘[FATAL!] [ERROR!] Promise1 not kept!’ + err, err.stack);
promise2.fail(err);
>)
.onresolve(function () <
console.info(‘[INFO] Promise1 resolved.’);
>);
>
function makePromise2() <
promise2 = Await(‘isDBTestSuccessful’, ‘isAWSReady’);
promise2.onkeep(function (got) <
console.log(‘[OK] Promise2 kept, database test successful.’);
AWSContext.callbackWaitsForEmptyEventLoop = false;
get(AWSEvent, AWSContext);
>)
.onfail(function (err) <
console.error(‘[FATAL!] [ERROR!] Promise2 not kept!’ + err, err.stack);
promise3.fail(err);
>)
.onresolve(function () <
console.info(‘[INFO] Promise2 resolved.’);
>);
>

function makePromise3() <
promise3 = Await(‘response’);
promise3.onkeep(function (got) <
console.info(‘[OK] Promise3 kept, database test successful.’);
//CMT — export.handler final success return
AWSCallback(null, JSON.stringify(got.response));
console.info(‘[OK] Lambda function completed successfully, ok to to end process once threads finish wrapping up. ADMIN_CODE: 75’);
>)
.onfail(function (err) <
console.error(‘[FATAL!] [ERROR!] Promise3 not kept!’ + err, err.stack);
//CMT — export.handler final failure return
AWSCallback(err);
console.error(‘[FATAL!] Lambda function completed unsuccessfully, ok to to end process. ADMIN_CODE: 82’);
>)
.onresolve(function () <
console.info(‘[INFO] Promise3 resolved.’);
//CMT — Not sure it is efficent to execute end() and may cause intermittent timesouts to requests — mySqlPool.end();
AWSContext.done();
//CMT — index.js final return
return;
>);
>

function decryptENV() <
console.log(‘Decrypting enviroment variables. ‘);
//Put logic here to keep promise1
>

function createDBConnectionPool() <
try <
if (!mySqlPool)
<
mySqlPool = mysql.createPool( <
connectTimeout: DATABASE_CONNECT_TIMEOUT_MILLI,
connectionLimit: DATABASE_POOL_LIMIT,
host: DATABASE_HOST,
user: DATABASE_USERNAME,
password: DATABASE_PASSWORD,
database: DATABASE_SCHEMA,
authSwitchHandler: ‘mysql_native_password’
>);

function testDBConnection() <
console.log(«Connecting to database. «);
try <
if (!mySqlPool)
<
createDBConnectionPool();
console.log(«mySqlPool not ready, requesting pool initialization. «);
>
mySqlPool.getConnection(function (err, con) <
if (err)
<
console.warn(«WARN! Unable to create database connection pool! Will try again later. ADMIN_CODE: 138 ; «, err);
//CMT Do not fail promise here as you might think — promise2.fail(err);
return false;
> else
<
console.log(«SUCCESS. MySql database pool online.»);
promise2.keep(‘isDBTestSuccessful’, true);
con.release();
return true;
>
>);
> catch (err)
<
console.error(«[FATAL!] [ERROR!] Cannot connect to database! Verify that your credentials in ENV are correct and that database is online and you have a route. ADMIN_CODE: 151 «, err);
promise2.fail(err);
return false;
>
>

  • //CNT Uncomment and comment exports.handler line to test local

function exitNow(err)
<
process.exit(1);
return err;
>

function t1(event, context, callback) <
*/

exports.handler = function (event, context, callback) <
AWSEvent = event;
AWSContext = context;
AWSCallback = callback;

function get(myAWSEvent, myAWSContext) <
var myResponse = null;
var header = «»;
var footer = «»;
var welcome = «

Welcome to Lambda Tutorial vR» + VERSION + «.»;
welcome += «

App Server is online.

Database server is «;
try <
mySqlPool.getConnection(function (err, con) <
if (err)
<
console.error(«FATAL! ERROR! Could not create connection pool or port not open! ADMIN_CODE: 192 ; «, err);
console.warn(«Database is OFFLINE.»);

Please try again later. «; myResponse = header + welcome + footer; promise3.keep(‘response’, myResponse); return; >»>

Источник

Does anyone know what could cause this error after running pipeline, and how to fix that?

Error: connect ETIMEDOUT xxx.xxx.xx:12345
  at TCPConnectWrap.afterConnect [as oncomplete] (net.js:12345:12) {
  errno: -110,
  code: 'ETIMEDOUT',
  syscall: 'connect',
  address: 'xxx.xxx.xx',
  port: 12345
}
ERROR running force:source:deploy:  Metadata API request failed: connect ETIMEDOUT:  xxx.xxx.xx:12345

Interesting thing is that it didn’t work last night (I had an error I mentioned) but today it works fine, there is no any error/issue.

asked Aug 5, 2021 at 11:10

mhdev's user avatar

mhdevmhdev

1091 gold badge2 silver badges9 bronze badges

2

This is a Temporary issue when the Salesforce API is timed out. ETIMEDOUT comes from the Node.js engine and the error implies

ETIMEDOUT (Operation timed out): A connect or send request failed because the connected party did not properly respond after a period of time. Usually encountered by HTTP or net. Often a sign that a socket.end() was not properly called.

Since this is a network issue there is not a lot you can do and wait for the network to be up. If you are not able to resolve it, then make sure your network connections are fine.

answered Aug 5, 2021 at 12:01

Mohith Shrivastava's user avatar

Понравилась статья? Поделить с друзьями:
  • Error connect etimedout postman
  • Error connect ehostunreach
  • Error connect econnrefused postman
  • Error connect econnrefused mongodb
  • Error connect econnrefused 3306