Error: PollingBlockTracker - encountered an error while attempting to update latest block:

Everything was working fine then one day I upgraded my node version and HDwallet and I am struggling since then . there is no error of contract size as I tried even small contract also.

Node Version: 16.13.0
HD Wallet: 1.7.0
Truffle v5.4.21

Getting following error while deploying using infura.

Error: PollingBlockTracker - encountered an error while attempting to update latest block:
Error: getaddrinfo ENOTFOUND ropsten.infura.io
at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:71:26)
at PollingBlockTracker._performSync (/Users/apple/Documents/Sandeep_Backup/SourceCode/wakanomy/WakanomySmartContract/node_modules/eth-block-tracker/src/polling.js:51:24)
at processTicksAndRejections (node:internal/process/task_queues:96:5)

hi @sandeep.hyperledger and welcome to the Infura community !
It might be just a coincidence and you have some slow network / dns issues. I’d try these first:

  1. add these params in your truffle config

networkCheckTimeoutnetworkCheckTimeout: 10000
timeoutBlocks: 200

  1. if 1 doesn’t work test with a wss provider instead: wss://ropsten.infura.io/ws/v3/YOUR-PROJECT-ID

Thanks,
Traian

2 Likes

I also ran into this. Searched for a long time, first thought it was infura/aws but it could be a node DNS lookup problem:
See here Solving Node DNS issues and other things | by Rafael Piovesan C Machado | The Startup | Medium

Already tried these thing no respite.

what worked for me was
dig ropsten.infura.io
take first ip address of the loadbalancer set it resolves to.
hardcode it in /etc/hosts

The addresses change over time so you have to do it again.
But it seems this now also works for me (/etc/hosts entry removed):

UV_THREADPOOL_SIZE=20 truffle migrate --network=ropsten

Not working.
What HDWallet version shall I use with infura.

Thanks @traian.vila traian.vila. Point number 2 helped me to solve this error.

1 Like

Hi I also getting the same err and I have done both points but no respite

This seems to be a very painful and consistently occurring issue on the Polygon mainnet RPC and there’s no wss alternative to it. Can it be advised on how to deal with that then?

Thanks!

Funciona. Gracias - thanks