Migrations exceeded the block limit with a gas value you set

0 votes

Please help me solve this error while migrating truffle:

1_initial_migration.js
======================
   Deploying 'Migrations'
   ----------------------
Error:  *** Deployment Failed ***
"Migrations" exceeded the block limit (with a gas value you set).
   * Block limit:  2582365
   * Gas sent:     20000000
   * Try:
      + Sending less gas.
      + Setting a higher network block limit if you are on a
        private network or test client (like ganache).
    at /usr/local/lib/node_modules/truffle/build/webpack:/packages/truffle-deployer/src/deployment.js:364:1
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
Truffle v5.0.2 (core: 5.0.2)
Jan 17, 2019 in Blockchain by slayer
• 29,370 points
6,033 views
I am also getting this error.

1 answer to this question.

–1 vote

In the error you have posted, in this part:

 * Block limit:  2582365
 * Gas sent:     20000000

you can see that gas is more than block limit. To solve this, you have to reduce the gas in truffle.js file.

answered Jan 17, 2019 by Omkar
• 69,220 points
How to go about this?

Like I mentioned in the answer,open your truffle.js file with a text editor and decrease the gas value.

Block Limit is changing on every migration. that's why I can't fix the gas accordingly.
Did you try setting gas to a lower value? Until and unless gas is less than block limit, I think it should be fine.

Related Questions In Blockchain

0 votes
1 answer

In a Blockchain, how difficult is it to modify the third to last block?

Technically, it's not difficult at all, all ...READ MORE

answered Apr 20, 2018 in Blockchain by Christine
• 15,790 points
1,029 views
0 votes
1 answer

Is it that new bitcoins gets created with the every block mined??

Bitcoin mining means validation of a block ...READ MORE

answered Apr 21, 2018 in Blockchain by Perry
• 17,100 points
803 views
0 votes
1 answer

What if Gas required in my program exceeds the limit of 3000000?

Going through your code, I noticed that  you ...READ MORE

answered May 29, 2018 in Blockchain by Perry
• 17,100 points
808 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Intrinsic gas too low and exceeds block limit

If you are talking about the public ...READ MORE

answered Aug 29, 2018 in Blockchain by digger
• 26,740 points
3,011 views
0 votes
1 answer

Truffle tests not running after truffle init

This was a bug. They've fixed it. ...READ MORE

answered Sep 11, 2018 in Blockchain by Christine
• 15,790 points
1,927 views
0 votes
1 answer

Hyperledger Sawtooth vs Quorum in concurrency and speed Ask

Summary: Both should provide similar reliability of ...READ MORE

answered Sep 26, 2018 in IoT (Internet of Things) by Upasana
• 8,620 points
1,455 views
0 votes
1 answer

Solidity geth: Error encountered during contract execution [Bad instruction]

recipes is a dynamic storage array. You need ...READ MORE

answered Oct 15, 2018 in Blockchain by Omkar
• 69,220 points
1,468 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP