I'm using Truffle 3.2.5 and Parity to try and migrate a project to Ropsten. I've tried changing the gas amount per the error's advice. I'm running a full Parity node on the same machine, so my truffle settings are localhost, 8545, network ID 3. All of my contracts compile, and I'm able to successfully run the exact same migration on testrpc. On Ropsten, I authorize the transaction in the Parity UI, Truffle successfully migrates 1_initial_migration.js, and then I get the following:

Error encountered, bailing. Network state unknown. Review successful transactions manually. Error: The contract code couldn't be stored, please check your gas amount.

at Object.callback (/home/user/.nvm/versions/node/v7.10.0/lib/node_modules/truffle/node_modules/web3/lib/web3/contract.js:147:46)
at /home/user/.nvm/versions/node/v7.10.0/lib/node_modules/truffle/node_modules/web3/lib/web3/method.js:142:25
at /home/user/.nvm/versions/node/v7.10.0/lib/node_modules/truffle/node_modules/web3/lib/web3/requestmanager.js:89:9
at XMLHttpRequest.request.onreadystatechange (/home/user/.nvm/versions/node/v7.10.0/lib/node_modules/truffle/node_modules/web3/lib/web3/httpprovider.js:118:13)
at XMLHttpRequestEventTarget.dispatchEvent (/home/user/.nvm/versions/node/v7.10.0/lib/node_modules/truffle/node_modules/xhr2/lib/xhr2.js:64:18)
at XMLHttpRequest._setReadyState (/home/user/.nvm/versions/node/v7.10.0/lib/node_modules/truffle/node_modules/xhr2/lib/xhr2.js:354:12)
at XMLHttpRequest._onHttpResponseEnd (/home/user/.nvm/versions/node/v7.10.0/lib/node_modules/truffle/node_modules/xhr2/lib/xhr2.js:509:12)
at IncomingMessage.<anonymous> (/home/user/.nvm/versions/node/v7.10.0/lib/node_modules/truffle/node_modules/xhr2/lib/xhr2.js:469:24)
at emitNone (events.js:91:20)
at IncomingMessage.emit (events.js:188:7)

Thanks for any help

Here's my truffle.js

module.exports = { migrations_directory: "./migrations", networks: { development: { host: "localhost", port: 8545, network_id: "*" // Match any network id }, live: { host: "localhost", port: 8545, network_id: 3, } } };

  • Can you show your truffle.js file. If you don't specify any network, truffle migrate will go to the one with network_id: "*" . So don't forget to run truffle migrate --network ropsten. More info – Greg Jeanmart Jun 24 '17 at 8:41
  • @greg added; the command I was using to migrate was truffle migrate --network live with the network Id for the live keyword set to 3. – Gary Jun 24 '17 at 21:00
  • Might be a stupid question. But does your Rospten account used to send the transaction (Create contract) has Ether? – Greg Jeanmart Jun 25 '17 at 9:37
  • There is. I tried doing the migration with a few different amounts of gas. The transaction that does go through showing the contract creation of the migration contract takes ~140k. – Gary Jun 25 '17 at 20:12
  • #Gary I am having the same issue except that I can see the transaction on Etherscan. Did you manage to solve your issue? – Robbo Oct 28 '17 at 22:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.