Report this

What is the reason for this report?

Why SendGrid and mailchimp are responding with Timeout on DigitalOcean droplet?

Posted on May 4, 2021

I have an express server running on a docker container, and using nginx for reverse proxy and https.

Dockerfile

FROM node:alpine as BUILD_IMAGE

WORKDIR /usr/src/app

COPY package.json yarn.lock ./

RUN yarn install --frozen-lockfile

COPY . .

EXPOSE 5000

CMD ["yarn", "start"]

docker-compose.yml

api_server:
    container_name: api-server
    restart: always
    build: ./server-api/
    ports:
      - '5000:5000'
    depends_on:
      - postgres
      - redis
      - url_server
      - og_server

I am using nodemailer sendgrid to send emails and also using mailchimp but both are not working.

This is the logs:

mailchimp err Error: Timeout of 120000ms exceeded
    at RequestBase._timeoutError (/**/**/app/node_modules/superagent/lib/request-base.js:613:13)
    at Timeout.<anonymous> (/**/**/app/node_modules/superagent/lib/request-base.js:628:12)
    at listOnTimeout (node:internal/timers:556:17)
    at processTimers (node:internal/timers:499:7) {
  timeout: 120000,
  code: 'ECONNABORTED',
  errno: 'ETIME',
  response: undefined
}

Fail to send email {
  err: Error: connect ETIMEDOUT 3.64.200.27:443
      at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1139:16)
      at TCPConnectWrap.callbackTrampoline (node:internal/async_hooks:131:14) {
    errno: -110,
    code: 'ETIMEDOUT',
    syscall: 'connect',
    address: '3.64.200.27',
    port: 443
  }
}

This is my ufw status:

To                         Action      From
--                         ------      ----
22/tcp                     LIMIT       Anywhere
2375/tcp                   ALLOW       Anywhere
2376/tcp                   ALLOW       Anywhere
Nginx Full                 ALLOW       Anywhere
465                        ALLOW       Anywhere
25                         ALLOW       Anywhere
587                        ALLOW       Anywhere
22/tcp (v6)                LIMIT       Anywhere (v6)
2375/tcp (v6)              ALLOW       Anywhere (v6)
2376/tcp (v6)              ALLOW       Anywhere (v6)
Nginx Full (v6)            ALLOW       Anywhere (v6)
465 (v6)                   ALLOW       Anywhere (v6)
25 (v6)                    ALLOW       Anywhere (v6)
587 (v6)                   ALLOW       Anywhere (v6)

I tried to run the container on my local machine (windows 10) and everything works fine email was sent and mailchimp works too, but on DO droplet it didn’t work.

Any ideas? thanks.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Start building today

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.