Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Truffle migrate process hanging #565

Closed
1 task done
leopoldjoy opened this issue Sep 12, 2017 · 2 comments
Closed
1 task done

Truffle migrate process hanging #565

leopoldjoy opened this issue Sep 12, 2017 · 2 comments

Comments

@leopoldjoy
Copy link


Issue

I'm trying to deploy a few contracts using Truffle, however when I call truffle migrate no result is returned (the process doesn't terminate), it gets stuck here:

Running migration: 1_initial_migration.js
Deploying Migrations...
... 0xd117334af701c281d57f33caead63954ec00c673e3e4adc653fe2bace0b6eea1

Steps to Reproduce

  1. Setup geth using puppeth by following this tutorial
  2. Call npm install -g truffle in an empty directory
  3. Call truffle init
  4. Call truffle compile
  5. Call truffle migrate, here is where the script will not terminate (freeze)

Expected Behavior

I expect the script to terminate after calling truffle migrate and return the address of the deployed contract.

Actual Results

In addition to the above error, when I call truffle migrate with the --verbose-rp flag I get the following output:

     > {
     >   "jsonrpc": "2.0",
     >   "id": 1,
     >   "method": "net_version",
     >   "params": []
     > }
   <   {
   <     "jsonrpc": "2.0",
   <     "id": 1,
   <     "result": "1"
   <   }
     > {
     >   "jsonrpc": "2.0",
     >   "id": 2,
     >   "method": "eth_accounts",
     >   "params": []
     > }
   <   {
   <     "jsonrpc": "2.0",
   <     "id": 2,
   <     "result": [
   <       "0xb609f2d1584a60c61ea4d245833cde5ca0f00c82"
   <     ]
   <   }
  Using network 'development'.

  Running migration: 1_initial_migration.js
     > {
     >   "jsonrpc": "2.0",
     >   "id": 3,
     >   "method": "eth_accounts",
     >   "params": []
     > }
   <   {
   <     "jsonrpc": "2.0",
   <     "id": 3,
   <     "result": [
   <       "0xb609f2d1584a60c61ea4d245833cde5ca0f00c82"
   <     ]
   <   }
     > {
     >   "jsonrpc": "2.0",
     >   "id": 4,
     >   "method": "net_version",
     >   "params": []
     > }
   <   {
   <     "jsonrpc": "2.0",
   <     "id": 4,
   <     "result": "1"
   <   }
    Deploying Migrations...
     > {
     >   "jsonrpc": "2.0",
     >   "id": 5,
     >   "method": "net_version",
     >   "params": []
     > }
   <   {
   <     "jsonrpc": "2.0",
   <     "id": 5,
   <     "result": "1"
   <   }
     > {
     >   "jsonrpc": "2.0",
     >   "id": 6,
     >   "method": "eth_sendTransaction",
     >   "params": [
     >     {
     >       "from": "0xb609f2d1584a60c61ea4d245833cde5ca0f00c82",
     >       "gas": "0xf4240",
     >       "gasPrice": "0x174876e800",
     >       "data": "0x6060604052341561000f57600080fd5b5b60008054600160a060020a03191633600160a060020a03161790555b5b6101e58061003c6000396000f300606060405263ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630900f010811461005e578063445df0ac1461007f5780638da5cb5b146100a4578063fdacd576146100d3575b600080fd5b341561006957600080fd5b61007d600160a060020a03600435166100eb565b005b341561008a57600080fd5b610092610182565b60405190815260200160405180910390f35b34156100af57600080fd5b6100b7610188565b604051600160a060020a03909116815260200160405180910390f35b34156100de57600080fd5b61007d600435610197565b005b6000805433600160a060020a039081169116141561017c5781905080600160a060020a031663fdacd5766001546040517c010000000000000000000000000000000000000000000000000000000063ffffffff84160281526004810191909152602401600060405180830381600087803b151561016757600080fd5b6102c65a03f1151561017857600080fd5b5050505b5b5b5050565b60015481565b600054600160a060020a031681565b60005433600160a060020a03908116911614156101b45760018190555b5b5b505600a165627a7a723058208ce0c069dd06b408f0fbfcaa5b8903a11618c2150ba05f03219dbc3982a7e2a70029"
     >     }
     >   ]
     > }
   <   {
   <     "jsonrpc": "2.0",
   <     "id": 6,
   <     "result": "0x96002d6db3fb2c50a1f7bc7b9fe49120925c60b88bffadebc4f754af757cc399"
   <   }
    ... 0x96002d6db3fb2c50a1f7bc7b9fe49120925c60b88bffadebc4f754af757cc399
     > {
     >   "jsonrpc": "2.0",
     >   "id": 7,
     >   "method": "eth_newBlockFilter",
     >   "params": []
     > }
   <   {
   <     "jsonrpc": "2.0",
   <     "id": 7,
   <     "result": "0xaf9eb6480baf7af0e42a8506b52a6ff1"
   <   }
     > [
     >   {
     >     "jsonrpc": "2.0",
     >     "id": 8,
     >     "method": "eth_getFilterChanges",
     >     "params": [
     >       "0xaf9eb6480baf7af0e42a8506b52a6ff1"
     >     ]
     >   }
     > ]
   <   [
   <     {
   <       "jsonrpc": "2.0",
   <       "id": 8,
   <       "result": []
   <     }
   <   ]
     > [
     >   {
     >     "jsonrpc": "2.0",
     >     "id": 9,
     >     "method": "eth_getFilterChanges",
     >     "params": [
     >       "0xaf9eb6480baf7af0e42a8506b52a6ff1"
     >     ]
     >   }
     > ]
   <   [
   <     {
   <       "jsonrpc": "2.0",
   <       "id": 9,
   <       "result": []
   <     }
   <   ]
     > [
     >   {
     >     "jsonrpc": "2.0",
     >     "id": 10,
     >     "method": "eth_getFilterChanges",
     >     "params": [
     >       "0xaf9eb6480baf7af0e42a8506b52a6ff1"
     >     ]
     >   }
     > ]
   <   [
   <     {
   <       "jsonrpc": "2.0",
   <       "id": 10,
   <       "result": []
   <     }
   <   ]

... Continues like this with the "id" field increasing indefinitely

Environment

  • Operating System: MacOS 10.12
  • Truffle version: 3.4.9
  • Ethereum client: geth 1.6.7
  • node version: 8.4.0
  • npm version: 4.6.1
@leopoldjoy leopoldjoy changed the title Truffle migrate process not terminating Truffle migrate process hanging Sep 12, 2017
@tcoulter
Copy link
Contributor

From the output you provided (thank you!) it looks like Truffle was never able to verify that the contract was mined successfully. On your geth private blockchain, are you mining by chance? If not, then transactions won't be processed correctly, and migrations won't complete successfully.

A little history tidbit: Way early on in Truffle we removed any kind of timeout from migrations because you might be deploying to a live chain -- and if there's congestion, especially early on in Ethereum's history, transactions could take hours to succeed. A timeout in this case would cause you to lose your Ether and put the migration in a unknown state. So we decided to remove the timeout, hence giving the appearance that the migration is hanging. The eth_getFilterChanges requests you're seeing are Truffle polling to see if the transaction was mined successfully.

@leopoldjoy
Copy link
Author

@tcoulter Thanks for the reply! I actually ended up switching to parity. You're right though, I think I wasn't mining which was causing the migrations to not complete.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants