Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

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

Closed
1 task
BlockchainsFans opened this issue Sep 12, 2020 · 24 comments

Comments

@BlockchainsFans
Copy link


Issue

What the issue is, in broad strokes.

Steps to Reproduce

Please provide the shortest amount of steps to reproduce your issue.

Expected Behavior

What you expected to happen.

Actual Results

What actually happened. Please give examples and support it with screenshots, copied output or error messages.

Environment

  • Operating System:
  • Ethereum client:
  • Truffle version (truffle version):
  • node version (node --version):
  • npm version (npm --version):
@eggplantzzz
Copy link
Contributor

eggplantzzz commented Sep 16, 2020

Closing this as a duplicate of issue #3356

@umobiajulu
Copy link

I had the sam issue with BSC testnet. I solved mine by replacing 'https' in the provider url with 'wss'

testnet: {
  provider: () => new HDWalletProvider(mnemonic, `wss://data-seed-prebsc-1-s1.binance.org:8545`),
  network_id: 97,
  confirmations: 10,
  timeoutBlocks: 200,
  skipDryRun: true
},

@rafante
Copy link

rafante commented Jul 4, 2021

If it helps, I had the exact same error. I could deploy on any ethereum environment, but couldn't deploy on Polygon (neither mumbai or the mainet). When I tried with this https://rpc-mumbai.maticvigil.com/ instead of this https://rpc-mumbai.matic.today, it worked.

Hope it helped!

@amit221
Copy link

amit221 commented Jul 5, 2021

I had the sam issue with BSC testnet. I solved mine by replacing 'https' in the provider url with 'wss'

testnet: {
  provider: () => new HDWalletProvider(mnemonic, `wss://data-seed-prebsc-1-s1.binance.org:8545`),
  network_id: 97,
  confirmations: 10,
  timeoutBlocks: 200,
  skipDryRun: true
},

works like a charm

@racetrack0616
Copy link

racetrack0616 commented Aug 5, 2021

If it helps, I had the exact same error. I could deploy on any ethereum environment, but couldn't deploy on Polygon (neither mumbai or the mainet). When I tried with this https://rpc-mumbai.maticvigil.com/ instead of this https://rpc-mumbai.matic.today, it worked.

Hope it helped!

I am having the same issue in matic testnet. I tried this solution but now,

  code: -32603,
  message: 'Too Many Requests',
  data: { originalError: {} },
  stack: 'Error: Too Many Requests\n' +```

@nelsoncerqueira
Copy link

If it helps, I had the exact same error. I could deploy on any ethereum environment, but couldn't deploy on Polygon (neither mumbai or the mainet). When I tried with this https://rpc-mumbai.maticvigil.com/ instead of this https://rpc-mumbai.matic.today, it worked.
Hope it helped!

I am having the same issue in matic testnet. I tried this solution but now,

  code: -32603,
  message: 'Too Many Requests',
  data: { originalError: {} },
  stack: 'Error: Too Many Requests\n' +```

I get the same

@racetrack0616
Copy link

Nothing is actually working for me. Most of time I get TIMEDOUT issue now.

@umobiajulu
Copy link

I later found out that the major cause of this problem is unstable network. your ip changes in the middle of deploying the contract. the solution is to use a stable network or use a vpn which will stabilize your network. in my case I used proton vpn and everything worked perfectly

@racetrack0616
Copy link

Thank you for your response. I used https://rpc-mumbai.maticvigil.com URL and used proton vpn but now the issue is

image

@racetrack0616
Copy link

racetrack0616 commented Aug 9, 2021

The other issue is as in screenshot . It is so frustrating now. I can't get rid of it. :(. I am using vpn though.
image

@wpitallo
Copy link

wpitallo commented Nov 1, 2021

Please reopen this issue...

@web3dev6
Copy link

web3dev6 commented Dec 6, 2021

Try this Matic testnet url:

https://matic-mumbai.chainstacklabs.com/

Worked for me!

@Oskii
Copy link

Oskii commented Dec 6, 2021

Try this Matic testnet url:

https://matic-mumbai.chainstacklabs.com/

Worked for me!

This URL did not work for me - same issue.

@Fahad67
Copy link

Fahad67 commented Dec 28, 2021

I had same issue but resolve it by using speedy node testnet url.

https://speedy-nodes-nyc.moralis.io/*****.......*****/bsc/testnet

@xxycfhb
Copy link

xxycfhb commented Mar 1, 2022

I had the sam issue with BSC testnet. I solved mine by replacing 'https' in the provider url with 'wss'

testnet: {
  provider: () => new HDWalletProvider(mnemonic, `wss://data-seed-prebsc-1-s1.binance.org:8545`),
  network_id: 97,
  confirmations: 10,
  timeoutBlocks: 200,
  skipDryRun: true
},

works like a charm

Amazing! It worked for me.

@Wwjian-lab
Copy link

I had the sam issue with BSC testnet. I solved mine by replacing 'https' in the provider url with 'wss'

testnet: {
  provider: () => new HDWalletProvider(mnemonic, `wss://data-seed-prebsc-1-s1.binance.org:8545`),
  network_id: 97,
  confirmations: 10,
  timeoutBlocks: 200,
  skipDryRun: true
},

It worked for me.Thx

@OnahProsperity
Copy link

OnahProsperity commented Apr 8, 2022

I had the same issue with BSC testnet. I solved mine by replacing 'https' in the provider url with 'wss' worked a t a point but after few days it stopped working so i had to migrate using this:

truffle deploy --network testnet --reset --compile-none

testnet: {
provider: () => new HDWalletProvider(mnemonic, https://data-seed-prebsc-1-s1.binance.org:8545),
network_id: 97,
confirmations: 10,
timeoutBlocks: 200,
skipDryRun: true
},

worked for me

@barhouum7
Copy link

I've started seeing the exact same ETIMEDOUT error when deploying my Smart Contract on Goerli Testnet, and using Alchemy as my node provider.

image

And I was able to fix it by simply replacing https in my node provider URL with wss
For example:

https://eth-goerli.alchemyapi.io/v2/${process.env.ALCHEMY_API_KEY} // Url to an Ethereum Node

To >>>

wss://eth-goerli.alchemyapi.io/v2/${process.env.ALCHEMY_API_KEY} // Url to an Ethereum Node

goerli: {
      provider: function () {
        return new HDWalletProvider(
          privateKeys.split(','), // Array of account private keys
          `wss://eth-goerli.alchemyapi.io/v2/${process.env.ALCHEMY_API_KEY}`// Url to an Ethereum Node
        )
      },
      gas: 5000000,
      gasPrice: 25000000000,
      network_id: 5,
      skipDryRun: true,
      confirmations: 10,
      networkCheckTimeout: 1000000,
      websocket: true,
      timeoutBlocks: 90000
    }

@jstaszynskidev
Copy link

Try this Matic testnet url:

https://matic-mumbai.chainstacklabs.com/

Worked for me!

This URL did not work for me - same issue.

This network URL must be the same as you have in MetaMask (New RPC URL)

@lam268
Copy link

lam268 commented Sep 21, 2022

Any updates on this problem ? I still got this error sometimes when running my application on bsc testnet

@anisurrahman072
Copy link

anisurrahman072 commented Nov 3, 2022

Hey I have solved finally ✌️🎉

I didn't use truffle HD Wallet anymore as it gave me a lot of pain 😞. Finally, I used the core etherium web3.js for everything like provider instance creation, wallet selection, pay gass, everything. I used core etherium library https://github.com/ethereum/solc-js for the ABI (Application Binary Interface) & bytecode generation.

Use Etherium Solc-js as it is official library of etherium team & it has all the feature what truffle has 💪

I used Alchemy for my Polygon mumbai test-network Node communication. Wolla, that's it. Here is the code that will help you:

const web3 = new Web3(
    new Web3.providers.HttpProvider(
      "https://polygon-mumbai.g.alchemy.com/v2/<Alchemy-API-key>"
    )
  );
  // Creating a signing account from a private key
  const signer = web3.eth.accounts.privateKeyToAccount(
    <Your Account Private key that will be used as the signer>
  );
  web3.eth.accounts.wallet.add(signer);

  // deploying our contract
  const result = await new web3.eth.Contract(
    contracts["MyContract.sol"]["MyContract"].abi,
    null,
    {
      transactionBlockTimeout: 200,
      transactionConfirmationBlocks: 1000,
      transactionPollingTimeout: 1000,
      blockHeaderTimeout: 100,
    }
  )
    .deploy({
      data: contracts["MyContract.sol"]["MyContract"].evm.bytecode.object,
    })
    .send({
      gas: "5000000",
      from: <Account public address that will pay the gass>,
    });

@Raviprakash-B
Copy link

Raviprakash-B commented Feb 1, 2023

Error [ERR_UNHANDLED_ERROR]: Unhandled error. ({mpt #1
code: -32603,
message: 'ESOCKETTIMEDOUT',
data: { originalError: { code: 'ESOCKETTIMEDOUT', connect: false } },
stack: 'Error: ESOCKETTIMEDOUT\n' +
' at ClientRequest. (C:\Users\Admin\Desktop\defi-staking-app-starter\defi-staking-app-starter
\node_modules\request\request.js:816:19)\n' +
' at Object.onceWrapper (node:events:627:28)\n' +

If anyone is facing the above error to run with Matic Network
Solution: - Try to change the actual Provider URL, take out from the mentioned website https://rpc.maticvigil.com/apps/a712bb661daef11c93ef89af396c476dbed54a83

then run using
truffle migrate --network matic

This Worked for me..

@Eh1Ka6
Copy link

Eh1Ka6 commented May 31, 2023

Hey dears!
had this problem happening this morning: compiling the contract first with t
truffle compile --all and then migrating with truffle migrate --compile-none allowed me to solve this issue.

Found the answer on this forum:
https://forum.moralis.io/t/client-network-socket-disconnected-before-secure-tls-connection-was-established/9526

@musicat1020
Copy link

Run npx truffle migrate --network goerli instead of truffle migrate --network goerli
This Worked for me.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests