Polygon PollingBlockTracker error

I am currently running a back end script that uses Web3.js and @truffle/hdwallet-provider packages to connect to an infura node on the mumbai testnet of polygon.

Once the web3 connection is established, no other requests are made. The code does not use the web3 connection (yet). Even still, when I run my script, I noticed that the method requests for my connection started to increase due to:


Between the two of them, they make up 99.9% of the requests currently (even though I have not requested anything). At some point (seems random), I get an error that causes my scrip to halt. The details of the error are below:

      throw err

Error: PollingBlockTracker - encountered an error while attempting to update latest block:
Error: getaddrinfo ENOTFOUND polygon-mumbai.infura.io
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:69:26)
    at PollingBlockTracker._performSync (~/node_modules/eth-block-tracker/src/polling.js:51:24)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
Emitted 'error' event on Web3ProviderEngine instance at:
    at safeApply (~/node_modules/safe-event-emitter/index.js:70:5)
    at PollingBlockTracker.SafeEventEmitter.emit (~/node_modules/safe-event-emitter/index.js:56:5)
    at PollingBlockTracker._performSync (~/node_modules/eth-block-tracker/src/polling.js:53:16)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)

To add a little more context. I am not trying to deploy smart contracts (as some people have complained about a similar error during deployment).

I also noticed that someone had brought up the potential issue on Trufflesuites github and one of the responses mentioned:

I am pretty sure this comes up when infura returns empty responses.


Hi @Guceri, and welcome to the Infura community!

Have you tried setting a networkCheckTimeout? According to the GitHub thread you referenced with the empty responses idea, that worked for a few of the users.