Cardano-cli fails: Network.Socket.connect: <socket: 11>: does not exist (No such file or directory)

My basic problem

When I execute any command like

cardano-cli query protocol-parameters \
    --mainnet \
    --out-file $NODE_HOME/params.json

Then I always get the following error:
cardano-cli: Network.Socket.connect: <socket: 11>: does not exist (No such file or directory)

GliveView shows me that everything is ok:
image

What I tried:

Here is how I start my node:

DIRECTORY=/root/astralis-node1
PORT=6000
HOSTADDR=0.0.0.0
TOPOLOGY=${DIRECTORY}/mainnet-topology.json
DB_PATH=${DIRECTORY}/db
SOCKET_PATH=${DIRECTORY}/db/node.socket
CONFIG=${DIRECTORY}/mainnet-config.json
KES=${DIRECTORY}/kes.skey
VRF=${DIRECTORY}/vrf.skey
CERT=${DIRECTORY}/node.cert
cardano-node run --topology ${TOPOLOGY} --database-path ${DB_PATH} --socket-path ${SOCKET_PATH} --host-addr ${HOSTADDR} --port ${PORT} --config ${CONFIG} --shelley-kes-key ${KES} --shelley-vrf-key ${VRF} --shelley-operational-certificate ${CERT}

I assume that the SOCKET_PATH is wrong? But how can do I know which socket path is correct?

2. Other problem: KES expired

When I look at the log file with
journalctl --unit=cardano-node

Then I get those file entries:

Jan 30 00:56:29 vmi523241.contaboserver.net bash[25458]: [vmi52324:cardano.node.ChainDB:Notice:5227] [2022-01-29 23:56:29.96 UTC] Chain extended, new tip: 00f778c30f36c5c0d5793066a4826b603c4d0510b97b03c4275743184dccf914 at slot 51934298
Jan 30 00:56:30 vmi523241.contaboserver.net bash[25458]: [vmi52324:cardano.node.LeadershipCheck:Info:5237] [2022-01-29 23:56:30.00 UTC] {"utxoSize":5297543,"kind":"TraceStartLeadershipCheck","delegMapSize":1135316,"credentials":"Cardano","slot":51934299,"chainDensity":4.8955806e-2}
Jan 30 00:56:30 vmi523241.contaboserver.net bash[25458]: [vmi52324:cardano.node.Forge:Error:5237] [2022-01-29 23:56:30.00 UTC] fromList [("val",Object (fromList [("kind",String "TraceForgeStateUpdateError"),("reason",Object (fromList [("forgeStateUpdateError",Object (fromList [("kesInfo",Object (fromList [("endPeriod",Number 227.0),("evolution",Number 0.0),("kind",String "KESInfo"),("startPeriod",Number 165.0)])),("kind",String "KESKeyAlreadyPoisoned"),("targetPeriod",Number 400.0)])),("kind",String "HardForkForgeStateUpdateError")])),("slot",Number 5.1934299e7)])),("credentials",String "Cardano")]

I wanted to solve the KES expiration by following this guide: https://www.coincashew.com/coins/overview-ada/guide-how-to-build-a-haskell-stakepool-node/18.-operational-and-maintenance-tips

But I cannot generate a new KES since all commands are throwing with the exception above if my first problem.

Add the following line to bashrc and source it:
export CARDANO_NODE_SOCKET_PATH=/root/astralis-node1/db/node.socket

You can also test by just running that command then trying again to query tip

–Edit: I would also consider moving this out of the /root directory

Should be: export CARDANO_NODE_SOCKET_PATH="/root/astralis-node1/db/node.socket"

1 Like

Thanks, I will try it tomorrow.

Is this env variable required by the cli? Can you explain to me why this should be the solution?

cardano-cli has to connect to a running cardano-node (for some of its commands).

It does so through a Unix domain socket. In order to do that, it needs to know, where to find that socket.

From your startup script, we know SOCKET_PATH=${DIRECTORY}/db/node.socket and DIRECTORY=/root/astralis-node1, which together make that the socket is found in /root/astralis-node1/db/node.socket.

2 Likes

It worked!! Awesome!! Thanks a lot!!