Cncli 2.0.3 You do not have a cardano-cli binary available in $PATH

Anyone have this error when trying cncli leaderlog?
cardano-cli --version
cardano-cli 1.26.1 - linux-x86_64 - ghc-8.10
git rev 3c556c5b09811c159dc7a92021f4d1c6aac3a104

I updated cncli with prereqs -c

type -p cardano-cli
/home/user/.cabal/bin/cardano-cli

Hi!

When do you get this error? executing cncli leaderlog?

Yes, but cnode is in $PATH

cncli leaderlog --pool-id <pool_id> --pool-vrf-skey vrf.skey --byron-genesis mainnet-byron-genesis.json --shelley-genesis mainnet-shelley-genesis.json --ledger-state ledger-state.json --db cncli.db

I think for this command the cardano-cli is not needed… or are you executing it via cntools?

Yes, in the scripts directory:
./cncli.sh leaderlog

1 Like

from inside the latest script I found:
echo "ERROR: cardano-node not in PATH, please manually set CCLI in env file"

could you execute the script with bash -x cncli.sh leaderlog to see which line produce this error

hmm, bash -x cncli.sh leaderlog works
I get at the end:

  • cncli_tip=27897744
    ++ echo ‘( 27897744 / 27897744 ) * 100’
    ++ bc -l
  • cncli_sync_prog=100.00000000000000000000
    ++ echo ‘100.00000000000000000000 > 99.999’
    ++ bc -l
  • (( 1 ))
    ++ echo ‘(27897744 - 76944 + 432000) - (3 * 2160 / 0.05)’
    ++ bc
  • slot_for_next_nonce=28123200
  • curr_epoch=262
  • next_epoch=263
  • [[ 27897744 -gt 28123200 ]]
  • [[ -t 1 ]]
  • break

But if I run:
sudo ./cncli.sh leaderlog
You do not have a cardano-cli binary available in $PATH.

It was working before.

hmm definitely an environment issue - but I dont know why worked with bash -x.
which line of the script contains the error handling: grep -n "You do not have a cardano-cli" cncli.sh

I can’t find it

I think I need to delete and rebuild scripts folder with prereqs -c

ok, probably the cncli tool says itself and not the wrapper cncli.sh script
but you can always call the cncli tool manually to check if it is working…
{CNCLI} leaderlog --db "{CNCLI_DB}" --byron-genesis “{BYRON_GENESIS_JSON}" --shelley-genesis "{GENESIS_JSON}” --ledger-set current {ledger_state_param} --pool-id "{POOL_ID}" --pool-vrf-skey “${POOL_VRF_SKEY}” --tz UTC

1 Like

You are right, the problem is in cncli tool itself, it seems I have installed via cntools on top of regular cncli from github.
How can I clean cncli instalations to install again via prereqs.sh?

@Alexd1985 dou you know how to reinstall cncli on a cntools environment?

I know how to use prereqs.sh -c
But how to completely remove cncli before that?

/opt/cardano/cnode/scripts$ sudo ./cncli.sh leaderlog
You do not have a cardano-cli binary available in $PATH.

i think it is just a binary what you can delete and that is it.

$ type cncli
cncli is /home/xxx/.cargo/bin/cncli
$ rm -rf  /home/xxx/.cargo/bin/cncli

done, reinstalling via cntools…

~/tmp$ ./prereqs.sh -c
Using apt to prepare packages for “Ubuntu” system
Updating system packages…
Installing missing prerequisite packages, if any…
Creating Folder Structure …
Environment Variable already set up!
Installing CNCLI
previous CNCLI installation found, pulling latest version from GitHub…
latest version: v2.0.3
updating RUST if needed…
building CNCLI v2.0.3 …
cncli 2.0.3 installed!
Downloading files…

/opt/cardano/cnode/scripts$ sudo ./cncli.sh leaderlog
You do not have a cardano-cli binary available in $PATH.
You do not have a cardano-cli binary available in $PATH.
sleeping for 10s and testing again…

u updated ok, how is your env file? how are the ccli and the cncli lines, commented or un-commented?

#CCLI="${HOME}/.cabal/bin/cardano-cli"
#CNCLI="${HOME}/.cargo/bin/cncli"

cheers,

they are all commented

try to uncomment ccli line save and try again

but after this u must check if the producer will start again (restart the node)