Cncli leaderlog output when no blocks assigned

I’m trying to get cncli working to check if I have blocks assigned and I’m not sure if it’s working. This is what it returns:
“status”: “error”,
“errorMessage”: “Query returned no rows”
Does that mean it works and I have no blocks or does it mean there is a problem with my installation?

Most likely you have not performed a “sync” prior to running your leaderlogs?

cncli sync

I did run a sync and have it running in systemctl to keep it sync’d.
cncli status
returns ok

I got it working. I missing the --ledger-state option with a ledger-state.json that I got with
cardano-cli query ledger-state
I now get more info from cncli leaderlog, but sadly, I have no blocks :frowning:

1 Like


i’m experiencing a similar problem you are having. How were you able to return slot options? When running the ledger-state i’m returning error.

“status”: “error”,
“errorMessage”: “Query returned no rows”

cncli status returns ok:
“status”: “ok”

My problem was that I wasn’t passing in the ledger-state argument. First, I needed to generated a ledger-state.json with:

cardano-cli query ledger-state --mainnet > ledger-state.json

Then I get the leaderlog like this:

/usr/local/bin/cncli leaderlog \
    --db "$cncli_db_path" \
    --pool-id "$pool_id" \
    --pool-vrf-skey "$config_path/vrf.skey" \
    --byron-genesis "$config_path/mainnet-byron-genesis.json" \
    --shelley-genesis "$config_path/mainnet-shelley-genesis.json" \
    --ledger-state "$config_path/ledger-state.json" \
    --ledger-set "$epoch" \
    --tz "$timezone"

Note that
cardano-cli query ledger-state
needs a LOT of memory. I only have 8 GB of RAM on my machine and I needed to add a 12 GB swapfile for it to complete without crashing and it takes several minutes to complete.

Thanks for the heads up. I have a 16gb system. I rebuilt the ledger-state.json and I’m still returning status of error.

-cli query ledger-state --mainnet > ledger-state.json

cncli leaderlog --pool-id 96275eff5bd2aef690184859d1abca6839c04ae9dc0987f1c1ef3755 --pool-vrf-skey ${NODE_HOME}/vrf.skey --byron-genesis ${NODE_HOME}/mainnet-byron-genesis.json --shelley-genesis ${NODE_HOME}/mainnet-shelley-genesis.json --ledger-state ledger-state.json --ledger-set next --db cncli.db --tz America/Los_Angeles
“status”: “error”,
“errorMessage”: “Query returned no rows”

Did you verify the contents of ledger-state.json? Mine is about 2.4 GB.

Yes, it is at 2.4gb or 2,452,299kb as of right now…

I’ve installed using the coinbase guide; when running the command bash ${NODE_HOME}/scripts/ current UTC . I get the following:

“status”: “error”,
“errorMessage”: “attempt to write a readonly database”

Was able to fix it, was in wrong user ownership/group.

Great! Now, if you’re like me, instead of being disappointed every day that you didn’t get a block, you can check leaderlog and only be disappointed once every 5 days!

1 Like

I have no assigned slot current or next or previous when running cncli leaderlog. However, I was able to mint 1 in epoch 264. Extremely surprising. I guess luck and if other pools lose it. The battle continues!

Hi I am facing the same issue as you,
“status”: “error”,
“errorMessage”: “attempt to write a readonly database”

How were you able to resolve it?
I see that my cncli.db permissions are set to this by default:
-rw-r–r-- 1 root root 2034790400 May 16 15:27 cncli.db

I was thinking of changing the ownership to my user


Yes, you’ll have to change privilege’s to your user you’re logged in as . You can do the entire directory or just the individual files. Below are some cmd for ubuntu.



chown :

Hmm. I changed the owner to my user ubuntu but im still getting the same error. Do i need to modify the .db file to be writable? Im a bit confused why it would need to write to the db in the first place though. Its just querying it for the leaderslots I thought.
Screen Shot 2021-05-16 at 2.01.14 PM

Usergroup priv? Below is a copy of mines.

Ah it seems to work now. I ran the script and got the ledger-state. Then all of a sudden my leaderlog.json was populated correctly. Im a bit confused as to how that leaderlog script was ran without me manually running it. Ill need to check my services to see how its actually running. Thank you for your responses.

You probably have a cron schedule for it, if you used coincash guide.

Also, if resources is an issue . Go with manually running cnclci leaderlog. I actually just run it myself. Below is the command.

cncli leaderlog
–db cncli.db
–pool-id “”
–pool-vrf-skey ${NODE_HOME}/vrf.skey
–byron-genesis ${NODE_HOME}/mainnet-byron-genesis.json
–shelley-genesis ${NODE_HOME}/mainnet-shelley-genesis.json
–ledger-state ledger-state.json
–ledger-set current
–tz “”