Closed RobinJayaswal closed 6 years ago
I tried running again (without reset). This time it got one step further then encountered same issue:
$ truffle migrate --network live
Using network 'live'.
Running migration: 2_deploy_contracts.js
Deploying MyContract...
... 0x...
MyContract: 0x...
Saving successful migration to network...
Error encountered, bailing. Network state unknown. Review successful transactions manually.
nonce too low
Hi @RobinJayaswal, sorry for the delay responding. This issue is being tracked at truffle 763. It's caused by Infura running a load-balancer in front of their nodes and the transactions intermittently falling out of sync as a result.
Some options:
introduce programmatic delays between deployments.
deployer.deploy(Registry)
.then(() => Registry.deployed())
.then(registry => new Promise(resolve => setTimeout(() => resolve(registry), 60000)))
.then(registry => deployer.deploy(Store, registry.address))
deploy locally using a light node.
Closing as duplicate.
Hi, I also have this issue. @cgewecke, I don't understand your solution. Are you suggesting adding that code to the migration file?
@j10sanders Yes - I'm suggesting that you create time delays between deployments. The idea is to wait for a few blocks to pass before attempting another transaction so that infura's architecture has time to sync everything up. I just sketched that code in - not sure it works / have not tried this strategy myself, sorry. If you try it could you report your findings back?
Tangentially, truffle has a bug with the latest version of the HDWalletProvider (0.0.5
) that causes it to hang at the very end of a migration. You can ctrl-c out of the command and everything will be fine - should be fixed in a patch release scheduled for tomorrow.
did HDWalletProvider get patched? npm shows 0.0.5 as the current release
@eepstein The problem is at Truffle - HDWalletProvider 0.0.5
opens interval polling using eth-block-tracker
and truffle needs to close that on command exit.
Are you seeing migrations hang with Truffle v4.1.13
? If so could you try making sure your HDWallet providers are wrapped in a function in truffle.js
as shown in the docs here?
I've just kept thing on 0.0.3 while waiting for the fixes. Things mostly work at this point.
(Thanks for the quick reply.)
Yes @eepstein 0.0.3 should be fine. The upgrade was triggered by security warnings from npm audit
about sub-dependencies we felt we had to address because module is a wallet.
@cgewecke the workaround in https://github.com/trufflesuite/truffle-migrate/issues/29#issuecomment-389649903 didn't work work for me. I still got
Saving successful migration to network...
Error encountered, bailing. Network state unknown. Review successful transactions manually.
nonce too low
I think because this is internal to deployer.deploy
so the setTimeout was not helping
For anyone else finding this issue and still stuck on it, this workaround in truffle.js worked for me: https://ethereum.stackexchange.com/questions/44349/truffle-infura-on-mainnet-nonce-too-low-error
Command+Errors:
Cannot find much about this online. Is there a way I can manually specify a higher nonce for migrate?
Info: Connecting to Infura Node, Truffle v4.1.7, Node v9.5.0