This error message pops up sometimes when I try to send emails with npm package sendgrid/mail. This works most of the times.
{ Error: connect ETIMEDOUT 169.45.89.179:443
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1104:14) errno: 'ETIMEDOUT', code: 'ETIMEDOUT', syscall: 'connect',
address: '169.45.89.179', port: 443 } [bugsnag] Reported an
unhandled rejection… Error: Error: connect ETIMEDOUT 169.45.89.179:443
at SendGrid.send.then.catch.e (/home/leoqiu/foodnome-api/build/src/utils/emailHelpers.js:143:11)
My node server send it out with the following code:
export const sendVerifyMail = (to: string, token: string) =>
SendGrid.send({
to,
from: { email: '..' },
subject: 'Verify you..',
dynamic_template_data: {
header: 'Verify your account',
text:
'Please use the button below to continue the process.',
c2a_link: `${serverAddress}/api/user-account/verify?token=${token}`,
c2a_button: 'Verify'
},
template_id: 'd-0f6411434fbc4896bf389e3945affd5d'
} as any)
.then(d => d)
.catch(e => {
console.log(e);
throw new Error(e);
});
I don't think this is an issue with your code or on your side of the network, unless you had general connectivity issues at the same time.
ip 169.45.89.179 resolves to sendgrid's domain so this is probably an issue on their end, to double check this you could set up a continuous ping to 8.8.8.8 or run some other network monitoring set up to make sure your connection out is stable.
If your connection is not the issue, I would just report it to them along with any logs you are prepared to share, your source ip and the time the timeout errors occur would probably be useful to them
Related
Hi am trying to execute the KSQL query using npm package ksqlDb-client package, it throws an timeout error. I have attached the code as well, please let me know any issues over there.
when am hit this GET URL below method will execute https://localhost:5000/testKsql
exports.getKSQLStream = async () => {
const options = {
authorization: {
username: "admin",
password: "pw",
ssl: {
ca: CAs,
crt: myClientCert,
key: myClientKey,
}
},
host: 'https://ixxxx.xcxx.net',
timeout: 20000
}
const client = new KsqldbClient(options);
await client.connect();
const streamRes = await client.query('list streams;');
console.log("streams",streamRes);
await client.disconnect();
}
when I hit that URL from postman am getting below response in node console.
Error on Http2 client. Error: connect ETIMEDOUT 16.2XX.X4.xxx:8088
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1159:16) {
errno: -4039,
code: 'ETIMEDOUT',
syscall: 'connect',
address: '16.2XX.X4.xxx',
port: 8088
}
I faced recently with the same issue and found that library has bug with authorization. I pushed PR in repo, but you can patch your local copy in the same way.
https://github.com/Streaminy/ksqldb-client/pull/4
I'm Working on a Dummy Project in nextjs and trying to send a reset password message to the user email using mailtrap and nodemailer but i have a problem I can't find any solution for it when I send the request this error happen
Error: connect ETIMEDOUT 18.215.44.90:2525
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1161:16) {
errno: -4039,
code: 'ESOCKET',
syscall: 'connect',
address: '18.215.44.90',
port: 2525,
command: 'CONN'
}
and Here's my code
import nodemailer from "nodemailer";
async function SendEmail(options) {
const transport = nodemailer.createTransport({
host: "smtp.mailtrap.io",
port: 2525,
auth: {
user: "b4f46aa8ab49eb",
pass: "100f5d80facf4d",
},
});
const message = {
from: `${process.env.SMTP_FROM_NAME} <${process.env.SMTP_FROM_EMAIL}>`,
to: options.email,
subject: options.subject,
text: options.message,
};
await transport.sendMail(message, (error, info) => {
if (error) {
console.log(error);
} else {
console.log("Email sent: " + info.response);
}
});
}
export default SendEmail;
try changing the port, another solution is to try it on another internet network, sometimes in some way, the ip provided by the provider has been blocked, that same error happened to me and my solution was to change the internet network.
I am trying to use aws encryption sdk in a NestJS application, the next code source shows the implementation.
import { Controller, Get } from '#nestjs/common';
import {KmsKeyringNode, encrypt} from '#aws-crypto/client-node'
#Controller('encryption')
export class EncryptionController {
// constructor() {}
#Get()
async crypt() {
const generatorKeyId = "generatior key";
const masterKeyId = "master key id";
const keyring = new KmsKeyringNode({keyIds:[masterKeyId], generatorKeyId: generatorKeyId});
const plainText = "My passwords for senstive data";
const context = {
accountId: "100",
purpose: "youtube demo",
country: "Sri Lanka"
};
const { result } = await encrypt(keyring, plainText, { encryptionContext: context });
console.log(result)
}
}
but when I execute a request to see the result of my implementation I receive the next error
Error: connect EHOSTUNREACH 169.254.169.254:80
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1128:14) {
message: 'Missing credentials in config, if using AWS_CONFIG_FILE, set AWS_SDK_LOAD_CONFIG=1',
errno: 'EHOSTUNREACH',
code: 'CredentialsError',
syscall: 'connect',
address: '169.254.169.254',
port: 80,
time: 2020-06-09T11:41:47.638Z,
originalError: {
message: 'Could not load credentials from any providers',
errno: 'EHOSTUNREACH',
code: 'CredentialsError',
syscall: 'connect',
address: '169.254.169.254',
port: 80,
time: 2020-06-09T11:41:47.638Z,
originalError: {
message: 'EC2 Metadata roleName request returned error',
errno: 'EHOSTUNREACH',
code: 'EHOSTUNREACH',
syscall: 'connect',
address: '169.254.169.254',
port: 80,
time: 2020-06-09T11:41:47.637Z,
originalError: [Object]
}
}
}
However I copy a nodejs script from this tutorial to see if it works with my aws sdk set up
and I did not receive any error, also if a execute aws kms encryption methods in the cli I hadn't any error.
I tried to export AWS_SDK_LOAD_CONFIG=1 variable how I saw in other similar errors.
Does anyone know what's going on?
I had the same problem. It cost me quite some head ache because I had this running in AWS Fargate and debugging is not that easy there.
The error means the Javascript SDK can not find the AWS credentials.
Here you can see in what order the SDK tries to load the credentials from:
https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/setting-credentials-node.html
My error was quite embarrassing, I just had a typo in my environment variables. My variable was AWS_ACCESSS_KEY_ID instead of AWS_ACCESS_KEY_ID. (Quite hard to see the difference, right?)
So probably double check the names of your environment variables (or config files)
I've created the node.js application which is connected with Facebook Graph API. The problem is that when I am using request to get the data from the URL, sometimes I am not receiving the data but this error message:
{
Error: connect ETIMEDOUT 31.13.81.9:443
at Object._errnoException (util.js:992:11)
at _exceptionWithHostPort (util.js:1014:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1186:14)
code: 'ETIMEDOUT',
errno: 'ETIMEDOUT',
syscall: 'connect',
address: '31.13.81.9',
port: 443
}
When I paste the URL to the browser I am receiving the data from API without any problem.
The request which gets the Facebook API data
request({url:`https://graph.facebook.com/v3.2/me?fields=posts%7Bcomments%7Blike_count%7D%2Cshares%2Ccreated_time%2Csource%2Clikes.summary(true)%7D%2Cfan_count&period=day&since=${selectedDateFrom}&until=${selectedDateTo}&access_token=${accessToken}`,
json: true
}, (err, response, body) => {
if (err) {
console.log(err)
} else {console.log(body);}
I wonder why the problem is happening in my application, and why in the browser everything is fine?
I'm trying to send emails from NODEJS using emailjs. I'm connecting to a Microsoft Exchange Server, this is my configuration to connect:
var server = email.server.connect({
user: "myUser",
password:"1234567",
host: "10.220.45.17",
tls: {ciphers: "SSLv3"}
});
I'm getting the following error:
buffer.js:188
throw new TypeError('First argument needs to be a number, ' +
^
TypeError: First argument needs to be a number, array or string.
If I change the host to
host: "smtp.myUser#domail.com",
I get the following error:
{ [Error: connection encountered an error]
code: 5,
previous: { [Error: getaddrinfo ENOTFOUND] code: 'ENOTFOUND', errno: 'ENOTFOUND', syscall: 'getaddrinfo' },
smtp: undefined }
What can be wrong this this configuration?
Thanks!