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

3 Likes

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")))))])

1 Like

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 Like

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

I have the same problem with the same instructions, after updating everything to 1.33.0, and going back through my scripts for the 100th time. I am stuckā€¦
this is the error:

Command failed: transaction submit  Error: Error while submitting tx: ShelleyTxValidationError ShelleyBasedEraAlonzo (ApplyTxError [UtxowFailure (WrappedShelleyEraFailure (UtxoFailure (OutsideValidityIntervalUTxO (ValidityInterval {invalidBefore = SNothing, invalidHereafter = SJust (SlotNo 10000)}) (SlotNo 50581813))))])

and this is the tx.signed

{
    "type": "Tx AlonzoEra",
    "description": "",
    "cborHex": "84a70082825820c2a011032ff72b91a2b45f1cbce94941be06b5bcbaca12546a9ab8c8264c59c107825820e9192ef37a99f6fa392e39525c7e9cdc0d7a4be6>
}

1.22.0 ? last version is 1.33.0

This looks like you should look at your --invalid-hereafter parameter. Itā€™s saying that the transaction is only valid until slot 10000 (which is way in the past).

If you used something like --invalid-hereafter $(( ${currentSlot} + 10000)) in the post above yours, make sure that $currentSlot is really set to the current slot at the tip.

yes sorry, was a Typo. thanks for the catch,