trufflesuite / truffle-migrate

On-chain migrations management
17 stars 17 forks source link

Command doesn't return and stuck at `Saving artifacts...` when using hdwallet provider. #14

Open Janaka-Steph opened 7 years ago

Janaka-Steph commented 7 years ago

Hello,

I have a minor issue with truffle migrate. It deploys my contracts fine to any network but the console will be stuck at the end on Saving artifacts... and doesn't return.

Thank you

jbogacz commented 6 years ago

@eolszewski Thanks dude! I stacked for a while but your suggestion solved my issue. I didn't upgrade truffle (still using 4.1.8) but only wrapped HDWallet provider an it works fine now.

JoyCood commented 6 years ago

@cgewecke I still have the troubles with truffle migrate, my environment is:

truffle version:

$ truffle version Truffle v4.1.13 (core: 4.1.13) Solidity v0.4.24 (solc-js)

truffle.js:

module.exports = {
    // See <http://truffleframework.com/docs/advanced/configuration>
    // to customize your Truffle configuration!
    solc: {
      optimizer: {
        enabled: true,
        runs: 200
      }
    },
    networks: {
        development: {
        host: '127.0.0.1',
        port: 8545,
        network_id: "2018",
        gas: 4700000,
        gasPrice: 99999999,
        from: "0x14CD5c014C56cd8464f871b0955Aa3B23EB78B5a"
      }
    }
};
JoyCood commented 6 years ago

I solve the truffle migrate stuck problem by delete the transactions.rlp file in the geth client data directory , inspect there exists any failure transactions in the geth client console with eth.pendingTransactions command, if any, try below way:

  1. stop the geth client
  2. delete the transactions.rlp file in the geth client data directory
  3. start the geth again
  4. resend the transaction with truffle migrate command
stevenleeg commented 6 years ago

I'm running into the same issue while using HDWalletProvider connected to a local Ganache instance. Adding the --verbose-rpc flag reveals that it's getting stuck in an infinite loop here:


   >   {                                                                                    
   >     "jsonrpc": "2.0",
   >     "id": 38,
   >     "method": "eth_getFilterChanges",
   >     "params": [
   >       "0x2"
   >     ]
   >   }
   > ]
 <   [
 <     {
 <       "id": 38,
 <       "jsonrpc": "2.0",
 <       "result": []
 <     }
 <   ]``` 
cgewecke commented 6 years ago

@stevenleeg What truffle version are you using? Have you checked your config to make sure that the Wallet provider is correctly wrapped in a function as shown in the docs here?

stevenleeg commented 6 years ago

@cgewecke

$ truffle version
Truffle v4.1.13 (core: 4.1.13)
Solidity v0.4.24 (solc-js)

I've managed to figure out the hanging issue, but I'm unfortunately now running into the issue first reported by @mspublic:

$ truffle migrate --reset
Using network 'development'.

Running migration: 1_initial_migration.js
  Replacing Migrations...
  ... 0x1800c21325bf4506724dade7d410ab5200f936450d7a8f9f61d8c6aafe244c38
  Migrations: 0x911a6996b07c151c4b376d3cfff225e646021b0a
Saving successful migration to network...
  ... 0xc6c94a6684f5aad21eddfc8de2014ca1e8644e26244c4768a5acb21d7a94fb82
Saving artifacts...
Running migration: 2_deploy_contracts.js
Saving successful migration to network...
1535028464 1536755964
  Replacing MyCoin...
  ... 0xec49ea466951b00d3ac5086d3385629f98ebbce7168240d254b44bd87a543fcb
  ... 0x96bd514fcf8badaa06ec6a8e1ae8057c4610c6b9ec3301bac96dea9b0afb659b
Saving artifacts...
node[67981]: ../src/timer_wrap.cc:130:static void node::(anonymous namespace)::TimerWrap::Stop(const FunctionCallbackInfo<v8::Value> &): Assertion `HandleWrap::IsAlive(wrap)' failed.
 1: node::Abort() [/usr/local/bin/node]
 2: node::Assert(char const* const (*) [4]) [/usr/local/bin/node]
 3: node::(anonymous namespace)::TimerWrap::SetImmediateCallback(v8::FunctionCallbackInfo<v8::Value> const&) [/usr/local/bin/node]
 4: v8::internal::FunctionCallbackArguments::Call(void (*)(v8::FunctionCallbackInfo<v8::Value> const&)) [/usr/local/bin/node]
 5: v8::internal::MaybeHandle<v8::internal::Object> v8::internal::(anonymous namespace)::HandleApiCallHelper<false>(v8::internal::Isolate*, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::FunctionTemplateInfo>, v8::internal::Handle<v8::internal::Object>, v8::internal::BuiltinArguments) [/usr/local/bin/node]
 6: v8::internal::Builtin_Impl_HandleApiCall(v8::internal::BuiltinArguments, v8::internal::Isolate*) [/usr/local/bin/node]
 7: 0x240f902842fd
 8: 0x240f9033d196
fish: 'truffle migrate --reset' terminated by signal SIGABRT (Abort)

Any ideas as to what the issue could be here? I've jotted down my full config here, as I think seeing the deploy script, truffle.js, and responses in one place would be helpful.

cgewecke commented 6 years ago

@stevenleeg. The node::etc crash seems to be related to some versions of Node 10. Honestly don't know what's going on there. You shouldn't see that if you're using latest stable though (8.11.4).

And there's another issue with the way your migrations script is written that very similar to truffle 1195. Could you try wrapping the logic in the 2_deploy_contracts.js scripts in the deployer.then block and see if that helps?

amity203 commented 6 years ago

i am also facing similar issue with truffle migrate, it is not deploying contract, but saving artifacts. below is the result of migrate command on windows 10 with verbose:

$ truffle migrate -reset --verbose-rpc Compiling .\contracts\Migrations.sol... Writing artifacts to .\build\contracts

{ "jsonrpc": "2.0", "id": 1, "method": "net_version", "params": [] } < { < "id": 1, < "jsonrpc": "2.0", < "result": "5777" < } { "jsonrpc": "2.0", "id": 2, "method": "eth_accounts", "params": [] } < { < "id": 2, < "jsonrpc": "2.0", < "result": [ < "0xf98852bef6a3742de8f6c7f01695741603381070", < "0xf139e4a1748c2cc935cdf7e4d44f2a67e3ffd951", < "0x9aac644abc61547169fc8f4f34a0cb2257186754", < "0xe232bef7c1b46b545749203533c3ddc1eaca7127", < "0xbacae29c98de0ed2caa4eb6d27104829e24f553e", < "0xf98141cf6c6900056409a2a54e1fa1db10cc6d24", < "0x25d99fe28b962a2744016364a8866fd48e2340ee", < "0x9b11fc7b89d6df66bf4f34e58bff2de962c542bc", < "0x2231f3d6c4d6d81380c7540d209e8f4c1ba1d7ac", < "0x79038094badbf481a4359bddd6d27e4ccd947c2e" < ] < } Using network 'development'.

Network up to date.

jamesjara commented 5 years ago

Using the latest version of "truffle-hdwallet-provider": "^1.0.2", solved my issue stucked on the get last block call

ngotiendatdinosys commented 5 years ago

same issue:

screen shot 2019-01-24 at 11 37 00 pm