Getting `ENETUNREACH` and `ETIMEDOUT` errors when calling canister via agent-js

Tried with agent-js 0.19.3 and 0.20.2
Node.js v20.10.0
canister id: oknww-riaaa-aaaam-qaf6a-cai
API host: https://icp-api.io

Sometimes the request works fine, but most of the time I get these errors:

node:internal/deps/undici/undici:11730
    Error.captureStackTrace(err, this);
          ^

TypeError: fetch failed
    at Object.fetch (node:internal/deps/undici/undici:11730:11)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async HttpAgent._requestAndRetry (/home/zen/ic/mops/cli/node_modules/@dfinity/agent/lib/cjs/agent/http/index.js:265:26)
    at async HttpAgent.query (/home/zen/ic/mops/cli/node_modules/@dfinity/agent/lib/cjs/agent/http/index.js:312:26)
    at async caller (/home/zen/ic/mops/cli/node_modules/@dfinity/agent/lib/cjs/actor.js:181:28)
    at async search (file:///home/zen/ic/mops/cli/dist/commands/search.js:6:34)
    at async Command.<anonymous> (file:///home/zen/ic/mops/cli/dist/cli.js:165:5) {
  cause: AggregateError
      at internalConnectMultiple (node:net:1114:18)
      at internalConnectMultiple (node:net:1177:5)
      at Timeout.internalConnectMultipleTimeout (node:net:1687:3)
      at listOnTimeout (node:internal/timers:575:11)
      at process.processTimers (node:internal/timers:514:7) {
    code: 'ETIMEDOUT',
    [errors]: [
      Error: connect ETIMEDOUT 193.118.63.170:443
          at createConnectionError (node:net:1634:14)
          at Timeout.internalConnectMultipleTimeout (node:net:1685:38)
          at listOnTimeout (node:internal/timers:575:11)
          at process.processTimers (node:internal/timers:514:7) {
        errno: -110,
        code: 'ETIMEDOUT',
        syscall: 'connect',
        address: '193.118.63.170',
        port: 443
      },
      Error: connect ENETUNREACH 2a0b:21c0:b002:2:5000:afff:fee6:a836:443 - Local (:::0)
          at internalConnectMultiple (node:net:1176:40)
          at Timeout.internalConnectMultipleTimeout (node:net:1687:3)
          at listOnTimeout (node:internal/timers:575:11)
          at process.processTimers (node:internal/timers:514:7) {
        errno: -101,
        code: 'ENETUNREACH',
        syscall: 'connect',
        address: '2a0b:21c0:b002:2:5000:afff:fee6:a836',
        port: 443
      }
    ]
  }
}

Node.js v20.10.0

sometimes I get this error

Caught exception while attempting to make request:
  TypeError: fetch failed
  Retrying request.
Caught exception while attempting to make request:
  TypeError: fetch failed
  Retrying request.
Caught exception while attempting to make request:
  TypeError: fetch failed
  Retrying request.
Caught exception while attempting to make request:
  TypeError: fetch failed
  Retrying request.
Caught exception while attempting to make request:
  TypeError: fetch failed
  Retrying request.
Caught exception while attempting to make request:
  TypeError: fetch failed
  Retrying request.
node:internal/deps/undici/undici:11730
    Error.captureStackTrace(err, this);
          ^

TypeError: fetch failed
    at Object.fetch (node:internal/deps/undici/undici:11730:11)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at runNextTicks (node:internal/process/task_queues:64:3)
    at listOnTimeout (node:internal/timers:540:9)
    at process.processTimers (node:internal/timers:514:7)
    at async HttpAgent._requestAndRetry (/home/zen/ic/mops/cli/node_modules/@dfinity/agent/lib/cjs/agent/http/index.js:357:24)
    at async HttpAgent._requestAndRetry (/home/zen/ic/mops/cli/node_modules/@dfinity/agent/lib/cjs/agent/http/index.js:364:24)
    at async HttpAgent._requestAndRetry (/home/zen/ic/mops/cli/node_modules/@dfinity/agent/lib/cjs/agent/http/index.js:364:24)
    at async HttpAgent._requestAndRetry (/home/zen/ic/mops/cli/node_modules/@dfinity/agent/lib/cjs/agent/http/index.js:364:24)
    at async makeQuery (/home/zen/ic/mops/cli/node_modules/@dfinity/agent/lib/cjs/agent/http/index.js:416:30) {
  cause: AggregateError
      at internalConnectMultiple (node:net:1114:18)
      at internalConnectMultiple (node:net:1177:5)
      at Timeout.internalConnectMultipleTimeout (node:net:1687:3)
      at listOnTimeout (node:internal/timers:575:11)
      at process.processTimers (node:internal/timers:514:7) {
    code: 'ETIMEDOUT',
    [errors]: [
      Error: connect ETIMEDOUT 193.118.63.169:443
          at createConnectionError (node:net:1634:14)
          at Timeout.internalConnectMultipleTimeout (node:net:1685:38)
          at listOnTimeout (node:internal/timers:575:11)
          at process.processTimers (node:internal/timers:514:7) {
        errno: -110,
        code: 'ETIMEDOUT',
        syscall: 'connect',
        address: '193.118.63.169',
        port: 443
      },
      Error: connect ENETUNREACH 2a0b:21c0:b002:2:5000:edff:fe0d:98de:443 - Local (:::0)
          at internalConnectMultiple (node:net:1176:40)
          at Timeout.internalConnectMultipleTimeout (node:net:1687:3)
          at listOnTimeout (node:internal/timers:575:11)
          at process.processTimers (node:internal/timers:514:7) {
        errno: -101,
        code: 'ENETUNREACH',
        syscall: 'connect',
        address: '2a0b:21c0:b002:2:5000:edff:fe0d:98de',
        port: 443
      }
    ]
  }
}

Node.js v20.10.0

How to reproduce:

npx ic-mops search mo

Looks like it is not a node.js related issue - now I cannot open sites hosted on IC.

https://dashboard.internetcomputer.org

We’re investigating high load on the boundary nodes

2 Likes

Is there an ongoing DDOS attack on the IC and all canisters are not reachable ?

1 Like