# Why am I getting &quot;transaction out of gas&quot; errors?



##### Post Metadata
- Posted at: almost 7 years ago
- Net upvotes: 2


## Comments
### Comment 1

A common error message that Kaleido users have encountered when trying to execute smart contract transactions is “out-of-gas.” This document describes some of the known causes and potential fixes.

Here are some definitions of terms related to gas. The referenced eth APIs are part of the Web3.js library.

gas: unit of measurement for the computational work of running transactions or smart contracts in the Ethereum network
gasLimit: maximum amount of gas that can be spent on all transactions within a single block. This is not configurable by Kaleido users.
Listed as gasLimit in output of eth.getBlock(&quot;&lt;block_hash&gt;&quot;)
The miner of a new block can set the gas limit within +/- 0.1 % of the parent block’s gas limit
gas provided: maximum amount of gas you’re willing to spend on a particular transaction

Listed as gas in output of eth.getTransaction(&quot;&lt;transaction_hash&gt;&quot;)
gasPrice: the amount of Ether you’re willing to pay for every unit of gas, measured in Gwei (1 ETH = 1M Gwei)

Listed as gasPrice in output of eth.getTransaction(&quot;&lt;transaction_hash&gt;&quot;)
Common Symptoms, Causes and Solutions
“Gas provided” for transaction is not high enough to cover the gas needed to execute the transaction.
Likely error message: intrinsic gas too low.
Fix: Supply a higher gas amount, or use a client like the Kaleido REST API Gateway that automatically estimates gas for your transactions (importantly also adding a 20% contingency on top before submission)
The from account does not have enough Ether to execute transaction.
Likely error message: insufficient funds for gas * price + value
Note: This will only occur if the gasPrice for the transaction is set to some value other than the default 0.
Fix: Use a debugger like Remix to debug your infinite loop
Infinite loop or other unbounded processing error in smart contract code
Likely error message TX ran out of gas before completion
Fix: Use a debugger like Remix to debug your infinite loop
Contract is not compiled for the correct EVM version
Likely error message gas required exceeds allowance or always failing transaction
Fix: Compile with --evm-version byzantium
Note: If you need more recent opcodes, please contact us to confirm the hard fork that is supported in Kaleido and meets your needs.
Contract has reverted
Likely error message gas required exceeds allowance or always failing transaction
Fix: Run eth_call with exactly the same parameters, then process the output per the Solidity control structures doc to get the error message of the revert
Note: Some web3 interfaces, including Truffle, and the Kaleido REST API Gateway, perform an eth_call automatically for you when this occurs during gas estimation and return the error string, rather than the generic message

##### Comment Metadata
- Posted at: almost 7 years ago
- Author title: Product Marketing Manager




## Related Product
[Kaleido](https://www.g2.com/products/kaleido-kaleido/reviews)

## Related Category
[Blockchain as a Service](https://www.g2.com/categories/blockchain-as-a-service)

## Related discussions
- [How well does Trello scale into a larger team?](https://www.g2.com/discussions/1-how-well-does-trello-scale-into-a-larger-team)
  - Posted at: about 13 years ago
  - Comments: 6
- [Can we please add a new section](https://www.g2.com/discussions/2-can-we-please-add-a-new-section)
  - Posted at: about 13 years ago
  - Comments: 0
- [Quantifiable benefits from implementing your CRM](https://www.g2.com/discussions/quantifiable-benefits-from-implementing-your-crm)
  - Posted at: about 13 years ago
  - Comments: 4


