trufflesuite / truffle

:warning: The Truffle Suite is being sunset. For information on ongoing support, migration options and FAQs, visit the Consensys blog. Thank you for all the support over the years.
https://consensys.io/blog/consensys-announces-the-sunset-of-truffle-and-ganache-and-new-hardhat?utm_source=github&utm_medium=referral&utm_campaign=2023_Sep_truffle-sunset-2023_announcement_
MIT License
14.02k stars 2.32k forks source link

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

Closed BlockchainsFans closed 4 years ago

BlockchainsFans commented 4 years ago

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

eggplantzzz commented 4 years ago

Closing this as a duplicate of issue #3356

umobiajulu commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

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

umobiajulu commented 3 years ago

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 commented 3 years ago

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

image

racetrack0616 commented 3 years ago

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 commented 3 years ago

Please reopen this issue...

web3dev6 commented 2 years ago

Try this Matic testnet url:

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

Worked for me!

Oskii commented 2 years ago

Try this Matic testnet url:

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

Worked for me!

This URL did not work for me - same issue.

Fahad67 commented 2 years ago

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

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

xxycfhb commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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

anisurrahman072 commented 2 years ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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