-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Truffle Migration Failing Although Transaction Succeeds #2257
Comments
@apbendi Out of curiosity, did you get a tx failure msg immediately or were you in pending state for a long time first? Is it possible that the tx timed out after 50 blocks per your config? |
Hey @cgewecke, it did not fail immediately and was pending for some time, but it was definitely not the ~10 minutes needed for 50 blocks. I'd guess it failed within 3-4 minutes, and that the transaction itself was mined within 5-6. |
Same issue here. Sometimes it happens, sometimes - not (with absolutely no changes, just rerun the same command). Very unstable.
i've got this error quite fast, without any long wait. on the next run a minute later...
|
Also i get the same issue with other contracts deployment. Not only Migrations. So it's not specific to the contract. |
Can anyone reliably reproduce this error? This would be a great help if anyone can provide repro steps. |
@eggplantzzz this IS the problem itself! it is not reliable and that's why it is a problem :) so i guess - it's impossible to reliable reproduce it. |
Happened same bug with v5.0.30, Infura, mnemonic and node 10, migrations are not very stable right now. Will try to see if i have any logs. edit: dont have the error log, but is the same as the top |
@eggplantzzz
My latest run log:
|
repeated deployment with latest truffle 5.1.2 - same error. |
#763 appears to be related. |
I was going to suggest that we add some configurable polling logic possibly in here, but it looks like we may already have this as either a poorly documented or mostly undocumented feature (see the bullet point about According to those above docs, something like the below should work and might resolve this issue 🤞 : module.exports = {
ropsten: {
network_id: "3",
gas: 4000000,
websockets: true, // (default: false)
confirmations: 2, // (default: 0)
provider: () => {
return new HDWalletProvider(
testnet.mneumonic,
"https://ropsten.infura.io/v3/" + testnet.infura_id
);
}
}
}; Side note: I've found evidence that There is also possibly another solution that might be something we could add to Please let us know if any of the above helps resolve this! |
@CruzMolina, thanks for ideas... let's try... demo repo updated: this time failed after 21 contracts deployed - i added counter. log tail here: https://github.com/atato/eth-deployment-error/blob/master/latest.log |
Thanks for giving those suggestions a shot @Vasiliy-Bondarenko ! It looks like the possible solution will be to add some polling logic to the |
@CruzMolina well... i have tried to dig the code...
so the error comes from web3: |
Having same issues. This is slowing down us a lot. We have to try around 12 times to finally complete the migration succesfully. `% truffle migrate --reset --network goerli Compiling your contracts...
Starting migrations...
1_initial_migration.jsReplacing 'Migrations'
2_deploy.jsReplacing 'SchellingCoin'
Error: *** Deployment Failed *** "SchellingCoin" -- The contract code couldn't be stored, please check your gas limit..
Truffle v5.1.2 (core: 5.1.2) Update: changing confirmation blocks to 1 worked. Deployed in a single try. Might have got lucky. |
@hrishikeshio, which Ethereum node are you using? private node or infura or something else? |
@Vasiliy-Bondarenko private geth node for görli |
thanks, @hrishikeshio. |
We're experiencing similar behaviour on mainnet. The migration fails with
And the transaction is successful: https://etherscan.io/tx/0x5f3fa29a35623e7f8e1e3a8724acc1856d2248eb1eb9cd441d6114af8d22c0a7 Interestingly I've not experienced failure with these contracts on Rinkeby or Ropsten, only Mainnet. No joy with implementing the work around from @CruzMolina with:
Deployment is via Infura. |
Issue
I'm trying to deploy a contract to mainnet. I have deployed it to Ropsten without issue. When I attempt to deploy to mainnet with truffle, I get the following error:
However, on etherscan, it seems the transaction has succeeded:
https://etherscan.io/tx/0x2d6284efba19ce96740d471eb25fc8a2e87ae1ec3d4b6e77876ab90fae584ef9
Steps to Reproduce
mainnet-mneumonic.js
file with appropriate exports.truffle migrate --network mainnet
Expected Behavior
Truffle to recognize the deployment succeeded and update the migration contract
Actual Results
Contract deployed successfully, but Truffle reported it failed and errors out.
Environment
truffle version
): v5.0.25node --version
): 10.16.0npm --version
): 6.9.0The text was updated successfully, but these errors were encountered: