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

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.