Transaction error with AlwaysSucceeds plutus script on testnet

Hi All,

I was testing some stuff on testnet with the always succeed plutus script and when trying to claim a UTXO I got the following error.

cardano-cli: evaluateTransactionExecutionUnits: the impossible happened: MissingScript ScriptWitnessIndexTxIn 0
CallStack (from HasCallStack):

I cant seem to parse this statement, any ideas?

The transaction is being build in the following way

cardano-cli transaction build --alonzo-era --testnet-magic $magicnr \
        --tx-in 0b4cb5132eda910e6cbf2763d0c2949859d6c306e6982db3c1de7f7ae12091b6#1 \
        --tx-in-script-file AlwaysSucceeds.plutus \
        --tx-in-datum-value 40 --tx-in-redeemer-value 40 \
        --tx-in-collateral e2f9d09f7d9d1a8238be0d454c78492f15eb59aa7f2c11c448bfa2678c5a06f7#0 \
        --change-address addr_test1vrpc07j7cy82v90kj2xpskldwr2m4m4cwk37v7g7fpm89fgvg4y3n \
        --protocol-params-file protocol.json --out-file body.tx

Following the lead of the error I found the stated function in /Api/Fees.hs, see Cardano.Api.Fees. Reading the function I cannot see how I can do anything about it failing? Sould I rebuild the software with cabal?

Seems like it never even tried to execute your script as the required input was missing.

Without being able to see more my first guess would be your relative path to AlwaysSucceeds.plutus was not local to the working directory caradno-cli command was executing from …

Maybe try an absolute path as a quick sanity check?

Thnx for the reply, yeah that was my first instinct. I even recompiled the plutus code with cabal, still the same :confused: Never seen this error before and I am still debugging it. If the path would be the problem the error would give

Command failed: transaction build  Error: AlwaysSucceeds.plutus: AlwaysSucceeds.plutus: openBinaryFile: does not exist (No such file or directory)

Google-Fu brought up this: [BUG] - cardano-cli transaction build may shortcut script UTxO · Issue #3059 · input-output-hk/cardano-node · GitHub

Seems like the ordering of CLI option parameters matter ?!?!?

Tnx for the great source, I did not come across that one yet. I followed up on that bug. Even with permuting the tx-in parameters I get the same error. Ill try some other things with other UTXO as input.

I do think that the bug in that is of a different nature than the one I am experiencing. The error message is different. But it perhaps gives insight in the origin of it.

EDIT: I created a bug call on github for it. [BUG] - cardano-cli transaction build may shortcut script on testnet · Issue #3276 · input-output-hk/cardano-node · GitHub

For this error, it means the plutus file is not found where you said it should be: in the same folder where you’re running the command. Either point to the path relative to where you are running or drop the file into that folder where you are running the command. You can use a full path also as so: --tx-in-script-file /home/yourname/node/AlwaysSucceeds.plutus \

1 Like

Thanks for the help but I eventually solved the problem. The script was there, I tried it with the absolute path. I found the problem in my bash script that tried to consume an old utxo while looping through a list of them.

Ah, thanks for the update. I have had many times where I thought something was up with the cli and it was my bash all along lol

1 Like