# Failed to publish with error "InsufficientGas in command 0"

**URL:** <https://forums.sui.io/t/failed-to-publish-with-error-insufficientgas-in-command-0/42457>\
**Category:** Technical Support\
**Created:** [April 15, 2023, 6:21am UTC](https://forums.sui.io/t/failed-to-publish-with-error-insufficientgas-in-command-0/42457 "2023-04-15T06:21:59Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![channa](https://dub1.discourse-cdn.com/sui/user_avatar/forums.sui.io/channa/32/31020_2.png) [@channa](https://forums.sui.io/u/channa)\
**Post date:** [April 15, 2023, 6:21am UTC](https://forums.sui.io/t/failed-to-publish-with-error-insufficientgas-in-command-0/42457/1 "2023-04-15T06:21:59Z")

</div>

I am trying to publish a simple SUI program to the testnet with the following error:

```auto
Status : Failure { error: "InsufficientGas in command 0" }

```

Here is a full log

```auto
sui client publish --gas-budget 30000
INCLUDING DEPENDENCY Sui
INCLUDING DEPENDENCY MoveStdlib
BUILDING munti_app
Successfully verified dependencies on-chain against source.
----- Transaction Digest ----
5YRZxNqDuZwWiyFZWZrdANbsHsiJrDHoCqTinBCS5cgk
----- Transaction Data ----
Transaction Signature: [Signature(Ed25519SuiSignature(Ed25519SuiSignature([0, 211, 229, 181, 52, 222, 103, 238, 1, 59, 191, 194, 235, 230, 59, 48, 131, 193, 121, 66, 246, 185, 25, 239, 162, 100, 200, 88, 165, 86, 82, 70, 81, 204, 144, 87, 221, 7, 151, 5, 210, 216, 207, 79, 131, 126, 224, 239, 163, 164, 66, 41, 123, 220, 25, 90, 68, 214, 231, 239, 82, 90, 224, 247, 2, 90, 73, 234, 252, 40, 216, 84, 116, 203, 9, 28, 199, 113, 187, 18, 85, 217, 0, 19, 127, 128, 94, 237, 225, 243, 171, 40, 15, 107, 234, 163, 200])))]
Transaction Kind : Programmable
Inputs: [Pure(SuiPureValue { value_type: Some(Address), value: "0xef9b134d48ae5cc2c0bcab39b263cda15745089aa99280eaf8f0b7b16d3b2f9c" })]
Commands: [
  Publish(_,0x0000000000000000000000000000000000000000000000000000000000000001,0x0000000000000000000000000000000000000000000000000000000000000002),
  TransferObjects([Result(0)],Input(0)),
]

Sender: 0xef9b134d48ae5cc2c0bcab39b263cda15745089aa99280eaf8f0b7b16d3b2f9c
Gas Payment: Object ID: 0xad11b9d687d97c56f6f097e78fd16655ca9edc68fbccfc8db07d6e758b45dfd6, version: 0x1bfa5f, digest: C8Za6FqSDqScVWjLuuadDmJ3nteftgbAepyUXDkvoGd5 
Gas Owner: 0xef9b134d48ae5cc2c0bcab39b263cda15745089aa99280eaf8f0b7b16d3b2f9c
Gas Price: 1000
Gas Budget: 30000

----- Transaction Effects ----
Status : Failure { error: "InsufficientGas in command 0" }
Mutated Objects:
  - ID: 0xad11b9d687d97c56f6f097e78fd16655ca9edc68fbccfc8db07d6e758b45dfd6 , Owner: Account Address ( 0xef9b134d48ae5cc2c0bcab39b263cda15745089aa99280eaf8f0b7b16d3b2f9c )

----- Events ----
Array []
----- Object changes ----
Array [
    Object {
        "type": String("mutated"),
        "sender": String("0xef9b134d48ae5cc2c0bcab39b263cda15745089aa99280eaf8f0b7b16d3b2f9c"),
        "owner": Object {
            "AddressOwner": String("0xef9b134d48ae5cc2c0bcab39b263cda15745089aa99280eaf8f0b7b16d3b2f9c"),
        },
        "objectType": String("0x2::coin::Coin<0x2::sui::SUI>"),
        "objectId": String("0xad11b9d687d97c56f6f097e78fd16655ca9edc68fbccfc8db07d6e758b45dfd6"),
        "version": String("1833568"),
        "previousVersion": String("1833567"),
        "digest": String("87zfyn9UhjJk6vXS19QiGHvtX951Q33kGnZQjr44CXmL"),
    },
]
----- Balance changes ----
Array [
    Object {
        "owner": Object {
            "AddressOwner": String("0xef9b134d48ae5cc2c0bcab39b263cda15745089aa99280eaf8f0b7b16d3b2f9c"),
        },
        "coinType": String("0x2::sui::SUI"),
        "amount": String("-30000"),
    },
]

```

Here is my remaining gas

```auto
sui client gas
                             Object ID | Gas Value 
----------------------------------------------------------------------------------
 0xad11b9d687d97c56f6f097e78fd16655ca9edc68fbccfc8db07d6e758b45dfd6 | 4970000 

```

Here is my envs active-env

```auto
sui client envs
localnet => http://0.0.0.0:9000
devnet => https://fullnode.devnet.sui.io:443
testnet => https://fullnode.testnet.sui.io:443 (active)

```

Here is my sui version

```auto
sui --version
sui 0.31.2-6bb3186e1-dirty

```

I’ve tried to publish to the local and testnet, but no lucks. Please help!

---

<div class="post-metadata">

**Author:** ![fastfrank](https://dub1.discourse-cdn.com/sui/user_avatar/forums.sui.io/fastfrank/32/1138_2.png) [@fastfrank](https://forums.sui.io/u/fastfrank)\
**Post date:** [April 16, 2023, 9:25am UTC](https://forums.sui.io/t/failed-to-publish-with-error-insufficientgas-in-command-0/42457/2 "2023-04-16T09:25:52Z")

</div>

Increase the budget amount

---

<div class="post-metadata">

**Author:** ![channa](https://dub1.discourse-cdn.com/sui/user_avatar/forums.sui.io/channa/32/31020_2.png) [@channa](https://forums.sui.io/u/channa)\
**Post date:** [April 18, 2023, 7:51am UTC](https://forums.sui.io/t/failed-to-publish-with-error-insufficientgas-in-command-0/42457/3 "2023-04-18T07:51:33Z")

</div>

I also tried increasing the gas budget, for example

```auto
sui client publish --gas-budget 300000

```

, I got another error:

```auto

----- Transaction Effects ----
Status : Failure { error: "InsufficientGas" }

```

And if I check my gas client

```auto
sui client gas                        
                             Object ID | Gas Value 
----------------------------------------------------------------------------------
 0x03c10c2f94666fd45182717ba70042b45b1d35bce57b62964ed7d74636fb6ca6 | 199608000 
 0x15fbac1a1e69a4cfcc084b81d0b2210f25395fc43699209e416645a56f926aab | 200000000 
 0x8f3129182c5ecbf130ad555b3a119eb725273dce7a2846e15027e3a3f5ca6bfb | 200000000 
 0x9ba2649be2e60ea1b825b00a61dc352e7941478d0acaed7426414275abf1bf49 | 200000000 
 0xad11b9d687d97c56f6f097e78fd16655ca9edc68fbccfc8db07d6e758b45dfd6 | 4640000  
 0xfb4f98b57b152836aa9ccee92177908f89d49df44e61e7e330271d91603706b3 | 200000000 

```

---

<div class="post-metadata">

**Author:** ![fastfrank](https://dub1.discourse-cdn.com/sui/user_avatar/forums.sui.io/fastfrank/32/1138_2.png) [@fastfrank](https://forums.sui.io/u/fastfrank)\
**Post date:** [April 18, 2023, 9:42am UTC](https://forums.sui.io/t/failed-to-publish-with-error-insufficientgas-in-command-0/42457/4 "2023-04-18T09:42:27Z")

</div>

With recent changes, the gas budget required has gone up.  
This means you may need to `merge` coins to satisfy budget needs. I wouldn’t try transaction with anything less than 2-3 million MISTS.

---

<div class="post-metadata">

**Author:** ![channa](https://dub1.discourse-cdn.com/sui/user_avatar/forums.sui.io/channa/32/31020_2.png) [@channa](https://forums.sui.io/u/channa)\
**Post date:** [April 18, 2023, 10:28am UTC](https://forums.sui.io/t/failed-to-publish-with-error-insufficientgas-in-command-0/42457/5 "2023-04-18T10:28:29Z")

</div>

@fastfrank Increasing the gas to 2-3 million MISTS did not help. I had the same error.

---

<div class="post-metadata">

**Author:** ![channa](https://dub1.discourse-cdn.com/sui/user_avatar/forums.sui.io/channa/32/31020_2.png) [@channa](https://forums.sui.io/u/channa)\
**Post date:** [April 18, 2023, 3:04pm UTC](https://forums.sui.io/t/failed-to-publish-with-error-insufficientgas-in-command-0/42457/6 "2023-04-18T15:04:56Z")

</div>

Finally, I was able to publish my contract to the **devnet** with a gas budget of 30000000.

---

<div class="post-metadata">

**Author:** ![suisunbeam](https://avatars.discourse-cdn.com/v4/letter/s/7c8e57/32.png) [@suisunbeam](https://forums.sui.io/u/suisunbeam)\
**Post date:** [March 8, 2024, 5:30am UTC](https://forums.sui.io/t/failed-to-publish-with-error-insufficientgas-in-command-0/42457/7 "2024-03-08T05:30:42Z")

</div>

> Finally, I was able to publish my contract to the **devnet** with a gas budget of 30000000.

Thanks this helped me
