0

I've successfully setup and running cardano node from terminal. Now I've setup cardano node to run as service(systemd, Ubuntu) so that I don't have to run the command all the time and have a terminal always open. From journalctl log all looks good, and I have check tip is reached using explorer.cardano.org. However, I now get error when using cardano-cli and I cannot figure out why...

Details

Cardano-cli error message

Network.Socket.connect: <socket: 11>: permission denied (Permission denied)

ls command

  • srwxr-xr-x 1 root root 0 juni 26 23:45 node.socket=

.service file

[Unit] Description=Runs cardano-node mainnet After=network-online.target StartLimitIntervalSec=0

[Service] Type=simple Restart=always RuntimeMaxSec=432000 User=root ExecStart=/home/toby/cardano-scripts/run-cnode-main.sh

[Install] WantedBy=multi-user.target

run-cnode-main.sh

#!/bin/bash #Start cardano-node on mainnet /home/toby/.local/bin/cardano-node run --config /home/toby/cardano-main/mainnet-config.json --database-path /home/toby/cardano-main/db/ --socket-path /home/toby/cardano-main/db/node.socket --host-addr 127.0.0.1 --port 1337 --topology /home/toby/cardano-main/mainnet-topology.json

1 Answer 1

1
  1. Stop using root (for interactive as well as systemd startup user), it's a terrible idea to run applications
  2. You cannot (*should not) run something as another user and point to paths in your own $HOME folder, this will more often than not only lead you to permission errors.
  3. I assume node.socket= was a typo, if not - your start command does not match $CARDANO_NODE_SOCKET_PATH environment variable.

While you can now address the state by recursively fixing permissions, you've likely populated environment variables, build caches, profiles, etc across a mix of root and toby user, you might want to start from scratch and not run anything to do with cardano-node.

3
  • 0. Thanks for the reply! 1. Okay, I am no linux expert:) I just followed some tutorial online, however I saw that there were some cardano tutorials that created an own user for cardano node. I will look into that. 2. Noted. 3. This was actually not a typo. I found this a bit weird, because I could not recall the socket filename had an = when running command line directly. However, now I don't understand why I do not get a "cannot find socket" error instead... My $CARDANO_NODE_SOCKET_PATH points to a file without the =
    – tobben24
    Jun 27, 2022 at 10:46
  • If there are online tutorials using root, I think it's potentially good to highlight bad practices to them (if they've a way to contact on their pages). About 3, if it wasnt a typo, then perhaps one of your earlier attempts to run cardano-node may have accidentally had an = sign after socket. Once you stop all instances of node running, you should be alright
    – RdLrT
    Jun 28, 2022 at 5:40
  • Okay, I will try to delete the db folder and have a new go for scratch. Thanks for the input @RdLrT!
    – tobben24
    Jun 30, 2022 at 7:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.