TX Help - Unable to send transaction errors

cardano-cli query utxo \
--address $(cat keys/payment.addr) \
--mainnet \
--allegra-era

                           TxHash                                 TxIx        Amount
--------------------------------------------------------------------------------------
3cb6142f56212759e40f86c61a002c824fef6d9468f52b8638ce226e4edb09e3     0        1000000
492e76213a0a2a38822a10b0b17c725ee6c5e5bbc17850d636fda420ec695603     0        5000000
bcba40888dfd99deb276ad2928958d817f3bd3b95bf47c84f61919ae6ace7953     0        502011024

cardano-cli transaction build-raw \
--tx-in bcba40888dfd99deb276ad2928958d817f3bd3b95bf47c84f61919ae6ace7953#0 \
--tx-in 492e76213a0a2a38822a10b0b17c725ee6c5e5bbc17850d636fda420ec695603#0 \
--tx-in 3cb6142f56212759e40f86c61a002c824fef6d9468f52b8638ce226e4edb09e3#0 \
--tx-out addr1qyqgpa2upfmuyjtm2myjc43l6u4f5hahj0hnghex9dm5y6xrzdkdfapgx33rm343s85ps8nzczu978n0yrkjxn3chwysp27ccg+0 \
--tx-out $(cat keys/payment.addr)+0 \
--invalid-hereafter 0 \
--fee 0 \
--out-file tx.draft

cardano-cli transaction calculate-min-fee \
--tx-body-file tx.draft \
--tx-in-count 3 \
--tx-out-count 2 \
--witness-count 1 \
--byron-witness-count 0 \
--mainnet \
--protocol-params-file protocol.json

508011024 - 503011024 - 183101 = 4816899

cardano-cli transaction build-raw \
--tx-in bcba40888dfd99deb276ad2928958d817f3bd3b95bf47c84f61919ae6ace7953#0 \
--tx-in 492e76213a0a2a38822a10b0b17c725ee6c5e5bbc17850d636fda420ec695603#0 \
--tx-in 3cb6142f56212759e40f86c61a002c824fef6d9468f52b8638ce226e4edb09e3#0 \
--tx-out addr1qyqgpa2upfmuyjtm2myjc43l6u4f5hahj0hnghex9dm5y6xrzdkdfapgx33rm343s85ps8nzczu978n0yrkjxn3chwysp27ccg+503011024 \
--tx-out $(cat keys/payment.addr)+4816899 \
--invalid-hereafter 21815237 \
--fee 183101 \
--out-file tx.draft

cardano-cli transaction sign \
--tx-body-file tx.raw \
--signing-key-file keys/payment.skey \
--mainnet \
--out-file tx.signed

cardano-cli transaction submit \
--tx-file tx.signed \
--mainnet

Gives the error:

Command failed: transaction submit  Error: Error while submitting tx: ShelleyTxValidationError ShelleyBasedEraAllegra (ApplyTxError [LedgerFailure (UtxowFailure (UtxoFailure (OutsideValidityIntervalUTxO (ValidityInterval {invalidBefore = SNothing, invalidHereafter = SJust (SlotNo 21807823)}) (SlotNo 21815670)))),LedgerFailure (UtxowFailure (UtxoFailure (BadInputsUTxO (fromList [TxInCompact (TxId {_unTxId = "4e..."}) 4])))),LedgerFailure (UtxowFailure (UtxoFailure (ValueNotConservedUTxO (DeltaCoin 0) (DeltaCoin 177557)))),LedgerFailure (UtxowFailure (UtxoFailure (OutputTooSmallUTxO [(Addr Mainnet (KeyHashObj (KeyHash "ed...")) (StakeRefBase (KeyHashObj (KeyHash "6e..."))),Coin 0)])))])

I’m querying cardano-cli query tip --mainnet and taking the slot + 200 as well. I really don’t understand what I’m doing wrong here, can anyone please help?

1 Like

Hi!

try to use only 1 tx-in address - the 3rd one with the most ADA. there is another topic with similar issue. perhaps there is a tx with less than 1 ADA after the transaction…

1 Like

Still no luck, however, I ended up registering my stake pool with the 500ADA. Fingers crossed [DOGE] DogePool | Cardano Staking is a success :D!

This shouldn’t be marked as “solution” though :slight_smile:
I just got the same issue and got my hopes up… but nope…

Change --out-file:

cardano-cli transaction build-raw \
[...]
--out-file tx.draft

to:

cardano-cli transaction build-raw \
[...]
--out-file tx.raw

so that you are signing the appropriate transaction.

When sending the full amount, you do not need to send yourself back the change.
eg: 508011024 - 183101 = 507827923. The only time minUTxOValue takes effect is when you create a UTxO with change.

Hi, I have similar problem, i am doing exactly whats in the tutorial (sending simple transaction) : Guide: How to build a Cardano Stake Pool - CoinCashew

Everything seems OK, until i run last part of code :
cardano-cli transaction submit
–tx-file tx.signed
–mainnet

It gives me error :

Shelley command failed: transaction submit Error: Error while submitting tx: ApplyTxError
[LedgerFailure (UtxowFailure (UtxoFailure (BadInputsUTxO (fromList [TxInCompact (TxId
{_unTxId = “9d2a28fbe34b33cb89961e8ef767a25083dadf3dddee553264fe1fcd4e2e9a37”}) 0])))),
LedgerFailure (UtxowFailure (UtxoFailure (ValueNotConservedUTxO (DeltaCoin 0) (DeltaCoin 6095240671))))]

I have 1.24.2 cardano-cli version, do you know what is the problem?
Thanks

1 Like

Have you used allegra or mary era to build your transactions?

cardano-cli transaction build-raw
{tx_in} \ --tx-out (cat payment.addr)+{txOut} \ --tx-out {destinationAddress}+{amountToSend} \ --invalid-hereafter (( {currentSlot} + 10000)) \ --fee {fee}
–allegra-era
–out-file tx.raw

so allegra

Try using mary-era instead, mary-hardfork has been released, use mary for every command instead of allegra in the future :smiley:

Hi! I got the same issue and I added the --mary-era option, but I’m having the same problem:

Command failed: transaction submit Error: Error while submitting tx: ShelleyTxValidationError ShelleyBasedEraMary (ApplyTxError [UtxowFailure (UtxoFailure (ValueNotConservedUTxO (Value 1000000000 (fromList [])) (Value 2000000000 (fromList [])))),UtxowFailure (UtxoFailure (OutsideValidityIntervalUTxO (ValidityInterval {invalidBefore = SNothing, invalidHereafter = SJust (SlotNo 28443327)}) (SlotNo 28447251))),DelegsFailure (DelplFailure (DelegFailure (StakeDelegationImpossibleDELEG (KeyHashObj (KeyHash "3a887bc794b6f2feff6de1a87583bb2afa95b5d8123e8e8967e0b1d6")))))])

i have solved it i was facing same issue
PLZ calculate the value it should be exact same to your balance & don’t forget to calculate the gas fees firstly its already comes before this command

cardano-cli transaction build-raw
–tx-in 96af3a4293ce505b36524feafd30c58ce3cd6e95080760b5c6d18268663f9dbc9#0
–tx-out $(cat /home/ubuntu/cardano/keys/payment2.addr)+150000000
–tx-out $(cat /home/ubuntu/cardano/keys/payment1.addr)+849825303
–fee 174697
–out-file /home/ubuntu/cardano/tx.raw

in my case i have 100,000,000 Lovelace (100ADA)

150000000 + 849825303 + 174697 = 100,000,000

Happy cordano transaction
Thanks me later

Hello! I am experiencing the same issue.

Command failed: transaction submit  Error: Error while submitting tx: ShelleyTxValidationError ShelleyBasedEraAlonzo (ApplyTxError [UtxowFailure (WrappedShelleyEraFailure (UtxoFailure (OutputTooSmallUTxO [(Addr Mainnet (KeyHashObj (KeyHash "ce504498a6fg56745fa7004c2183a276d56379bafas72c74255b4b97d0474886")) StakeRefNull,Value 19 (fromList []),SNothing)])))])

I’m trying to send 1 ADA (minus the fee of 175,181 Lovelace) so a total of 824,819 Lovelace to be sent.

Is there a minimum value? I want to zero out some accounts and consolidate. Don’t want to leave a single Lovelace behind!

1 ADA + fee is the minimum amount, if I remember well

Whoa that’s crazy! So that means there’ll be lots of instances where there will be UTXOs <1 ADA over the years. Lots of TxHashes that can never be cleared out like my example above.

I understood in the past that this “issue” will be fixed, but no dates for the moment

1 Like

Having same issue following cashew instructions.

Command failed: transaction submit Error: Error while submitting tx: ShelleyTxValidationError ShelleyBasedEraAlonzo (ApplyTxError [UtxowFailure (WrappedShelleyEraFailure (UtxoFailure (ValueNotConservedUTxO

So the solution is to calculate a gas fee? is the gas fee that -fee 174697 value?..and where did that number come from? Guess I’m not understanding the details of the said solution?

I scripted the tx.raw generation based on the Cashew instructions.
Do any of you see any issues with the command execution that could be resulting in a tx.raw file that would cause that error when signed and sent?

currentSlot=$(cardano-cli query tip --mainnet | jq -r ‘.slot’)
echo Current Slot: $currentSlot

cardano-cli query utxo --address $(cat payment.addr) --mainnet > fullUtxo.out

tail -n +3 fullUtxo.out | sort -k3 -nr > balance.out

cat balance.out

tx_in=""
total_balance=0
while read -r utxo; do
in_addr=$(awk ‘{ print $1 }’ <<< “${utxo}”)
idx=$(awk ‘{ print $2 }’ <<< “${utxo}”)
utxo_balance=$(awk ‘{ print $3 }’ <<< “${utxo}”)
total_balance=$((${total_balance}+${utxo_balance}))
echo TxHash: ${in_addr}#${idx}
echo ADA: ${utxo_balance}
tx_in="${tx_in} --tx-in ${in_addr}#${idx}"
done < balance.out

txcnt=$(cat balance.out | wc -l)
echo Total ADA balance: ${total_balance}
echo Number of UTXOs: ${txcnt}

stakePoolDeposit=$(cat $NODE_HOME/params.json | jq -r ‘.stakePoolDeposit’)
echo stakePoolDeposit: $stakePoolDeposit

cardano-cli transaction build-raw ${tx_in} --tx-out $(cat payment.addr)+0 --invalid-hereafter $(( ${currentSlot} + 10000)) --fee 0 --out-file tx.tmp --certificate stake.cert

fee=$(cardano-cli transaction calculate-min-fee --tx-body-file ./tx.tmp --tx-in-count ${txcnt} --tx-out-count 1 --mainnet --witness-count 2 --byron-witness-count 0 --protocol-params-file ./params.json | awk ‘{ print $1 }’)
echo fee: $fee

txOut=$((${total_balance}-${stakeAddressDeposit}-${fee}))
echo Change Output: ${txOut}

cardano-cli transaction build-raw ${tx_in} --tx-out $(cat payment.addr)+${txOut} --invalid-hereafter $(( ${currentSlot} + 10000)) --fee ${fee} --certificate-file stake.cert --out-file tx.raw