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

Why migrate stuck here. #305

Closed
350050183 opened this issue Nov 25, 2016 · 21 comments
Closed

Why migrate stuck here. #305

350050183 opened this issue Nov 25, 2016 · 21 comments

Comments

@350050183
Copy link

  • [Y] I've asked for help in the Truffle Gitter before filing this issue.

Issue

I run the official example code: truffle migrate,and stuck there for a long long time:

#truffle migrate
Running migration: 1_initial_migration.js
Deploying Migrations...

If i delete the deploy steps in the 1_initial_migration.js and 2_deploy_contracts.js, it runs fine.
I run geth in a test private network with command like

geth --identity "CSQNodeName" --rpc --rpcport "8080" --rpccorsdomain "*" --datadir ~/.ethereum_private --port "30303" --nodiscover --rpcapi "db,eth,net,web3" --networkid 1999 --unlock "0x60249051528212bd2fd0e72933b5931836065b56" console

and has changed the truffle.js port to 8080.

Steps to Reproduce

1.geth --identity "CSQNodeName" --rpc --rpcport "8080" --rpccorsdomain "*" --datadir ~/.ethereum_private --port "30303" --nodiscover --rpcapi "db,eth,net,web3" --networkid 1999 --unlock "0x60249051528212bd2fd0e72933b5931836065b56" console
2.mkdir helloworld && cd helloworld && truffle init
3.truffle compile
4.truffle migrate

Expected Behavior

finish migrate.

Actual Results

stopped and nothing happened for a long time.

Environment

  • Operating System: os x
  • Truffle version:2.1.0
  • Ethereum client:1.4.17
  • node version:5.0.0.
  • npm version: 3.3.6
@webpolis
Copy link

webpolis commented Nov 25, 2016

Same here... it seems the initial transactions coming from the migrate script get stuck in the pending queue.

I'm using a private node, initialized like this:

geth --nodiscover --nat "any" --verbosity 4 --identity "main" --datadir $DIR/../data --networkid 20000 --rpc --rpccorsdomain "*" --ipcapi "admin,db,eth,debug,miner,net,shh,txpool,personal,web3" --rpcapi "db,eth,net,web3" $DIR/../genesis.json &> $DIR/../eth.log &

The main account has an initial balance of 20000000000000000000 and is unlocked before running truffle migrate.

My truffle settings are:

module.exports = {
  network: "main",
  build: {
    "index.html": "index.html",
    "app.js": [
      "javascripts/app.js"
    ],
    "app.css": [
      "stylesheets/app.css"
    ],
    "images/": "images/"
  },
  rpc: {
    host: "localhost",
    port: 8545
  },
  networks{
    "main": {
      network_id: 20000,
      gas: 4612388
    }
  }
};

and my genesis.json is:

{
    "nonce": "0xdeadbeefdeadbeef",
    "timestamp": "0x0",
    "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
    "extraData": "0x0",
    "gasLimit": "0x8000000",
    "difficulty": "0x400",
    "mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000",
    "coinbase": "0x3333333333333333333333333333333333333333",
    "alloc": {
        "0x17772a9b5176de991c588ea5615a184a01a89138": {
            "balance": "20000000000000000000"
        }
    }
}

@webpolis
Copy link

If I enable the verboseRpc (true) in truffle.js, I see a lot of this:

   > [
   >   {
   >     "jsonrpc": "2.0",
   >     "method": "eth_getFilterChanges",
   >     "params": [
   >       "0x83472eda6eb475906aeeb7f09e757ba9"
   >     ],
   >     "id": 79
   >   }
   > ]
 <   [
 <     {
 <       "jsonrpc": "2.0",
 <       "id": 79,
 <       "result": []
 <     }
 <   ]

And the Ethereum console doesn't show any mining activity. I thought Truffle will be in charge of "cooking" up the transactions.

@350050183
Copy link
Author

It's holiday season,haha,be paitient:)

@ETHorHIL
Copy link

Did anyone find out how to solve this?

@tcoulter
Copy link
Contributor

tcoulter commented Dec 12, 2016 via email

@tcoulter
Copy link
Contributor

Hmm, looks like I misread. Let me think.

@ETHorHIL
Copy link

The Problem in my case was that Parity was running in the background. When I kill the process it works.

@chrc
Copy link

chrc commented Feb 11, 2017

Hello,

I am the same problem. Any solution ?

@rajaboini525
Copy link

Hello,

I am also facing the same issue. Any solution ?

@tcoulter
Copy link
Contributor

This is an issue best worked out through our gitter channel, since everyone's configuration is different. Please join the channel and ask there. We have over 700 active members willing to help. Cheers! https://gitter.im/ConsenSys/truffle

@baoit09
Copy link

baoit09 commented Mar 24, 2017

For me, what I need to do to overcome this stuck is remove the DAG file. Then, every things works fine.

@sk4092
Copy link

sk4092 commented Apr 25, 2017

where can I find DAG file in windows 7.

@Almaju
Copy link

Almaju commented Apr 25, 2017

I just ran into the exact same problem and it was due to two nodes being on the port (30303). It worked like a charm after stopping one!

@parag
Copy link

parag commented Aug 7, 2017

Shutting parity if that is working in the background will help

@shohel02
Copy link

shohel02 commented Aug 29, 2017

I am facing the same issue. I am running geth testnet node against which i am running 'truffle migrate' . Both the migrate and geth node hangs after this. Tried with DAG delete, does not work. Did anyone find solution for this

@ewerton-azevedo
Copy link

I could solve that running miner.start() in another console window.

@arielgabizon
Copy link

@parag I don't understand - if I shut parity then it crashes - it needs some client to work with to deploy the contract doesn't it?

@amrikmahal
Copy link

Hi, Was having the same problem where migration was stuck.
ran miner.start() through to web3 console and the contract was migrated.

I believe the contract is not getting mined, the moment, miner.start() is fired, i could see the mining nodes picked up the contract. Not sure what is wrong here, but this workaround worked.

@y0unghe
Copy link

y0unghe commented Feb 2, 2018

miner.start solved it. that's really odd.

@moda20
Copy link

moda20 commented Mar 14, 2018

I am having this problem with quorum, and even when running miner.start() it doesn't work instantly. uses all CPU on generating DAG and then nothing happens.
help

@jasonmerecki
Copy link

Had the same problem, thanks to this thread for the hints for me to find a solution.

I was migrating a contract to a private network, local geth instance. I did these steps (I already had an address in my local network):

  1. start geth with local chaindata
  2. geth attach to local instance
  3. ran personal.unlockAccount in geth, for the account in my local network
  4. ran miner.start() in geth
  5. ran truffle migrate
  6. stopped minter.start()

I admit that I didn't research why this worked yet, I am only leaving a note to potentially help someone else. I am working through a tutorial for creating and migrating smart contracts, and for now I wanted to get the tutorial 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