Randomly finding Error: PollingBlockTracker

Hello!

First, congrats for the product. Super helpful and well built. I’ve been using it for a while and i am super happy.

However, I am now stuck in what looks to be a simple error but cannot find its origin / cause.

Each time I try to deploy contracts to rinkeby network or run truffle test --network rinkeby I get the following error:

Error: PollingBlockTracker - encountered an error while attempting to update latest block:
Error: getaddrinfo ENOTFOUND rinkeby.infura.io
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:64:26)
    at PollingBlockTracker._performSync (/Users/-/Projects/DeFi/hegic/hegic-hedge-contracts-v888/node_modules/eth-block-tracker/src/polling.js:51:24)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)

also:

Error [ERR_UNHANDLED_ERROR]: Unhandled error. ({
code: -32603,
message: ‘getaddrinfo ENOTFOUND rinkeby.infura.io’,
data: {
originalError: {
errno: ‘ENOTFOUND’,
code: ‘ENOTFOUND’,
syscall: ‘getaddrinfo’,
hostname: ‘rinkeby.infura.io
}
},
stack: ‘Error: getaddrinfo ENOTFOUND rinkebyinfuraio\n’ +
’ at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:64:26)’
})

This happens randomly, sometimes it finishes migrating, sometimes it starts testing but when there are several contracts to be tested and a lot of tx’s to be sent, it just throw the PollingBlockTracker error and stops (making me loose my valuable Rinkeby’s ETH)

Any idea of where can this come from?

Thanks in advance!!

Hi @jmonteer - welcome to the Infura community!

For your first question, check this thread out - it looks like you need to create a .env file to fix that.

For the second error, can you send over the code you’re using to get this error message? That will help us debug a bit easier.

Thanks!

Hey Leiya, I am not sure about the link you sent. It looks like another error.

Also, both errors occur in the same line of code (dns.js:64:26), so I would say they are the same but print out different depending on exact error stack.

I am pretty frustated with this. Using last versions of truffle, truffle/hdwallet-provider, … but even with older versions it is happening. I have no clue of origin…

Thanks!

Can you send over your code so we can try to help you identify the origin? Without seeing that, it’s a little bit more of a shot in the dark for us :slight_smile:

Yes. Whose github user should I invite to the private repo?

You can invite me for now - leiyakenney

There you go! Thank you so much!

Thanks! I’ll take a look and will let you know if I see anything that may be causing the error. Stay tuned!

Hey I get the same error randomly no matter what code I run. I would usually just run the command again and it would work. Now I am testing a contract with a few transactions though that takes a while and it always gives me the "Error: PollingBlockTracker - encountered an error while attempting to update latest block:’’ error.

Hi @greenejacob0 - welcome to the Infura community! If you’re using Truffle, this thread may help you out closer to the bottom; it has some good ideas of small tweaks you can make to try to fix the issue.

If none of the posted solutions from that link work, can you please provide me with the rest of the error message (after the “latest block:”)? That may help us troubleshoot more effectively.