leogoesger
leogoesger

Reputation: 3840

sendgrid set up with @sendgrid/mail

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);
    });

Upvotes: 1

Views: 1587

Answers (1)

NiallJG
NiallJG

Reputation: 1961

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

Upvotes: 1

Related Questions