Failed to publish with error "InsufficientGas in command 0"

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

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

Here is a full log

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

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

Here is my envs active-env

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

sui --version
sui 0.31.2-6bb3186e1-dirty

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

5 Likes

Increase the budget amount

4 Likes

I also tried increasing the gas budget, for example

sui client publish --gas-budget 300000

, I got another error:


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

And if I check my gas client

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

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.

2 Likes

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

2 Likes

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

4 Likes

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

Thanks this helped me

1 Like