Sockets confuse me: how to troubleshoot?

I’ve been up and running on testnet thanks to @laplasz Working through practicing transactions and following the Stake Pool Course. I can build keys and addresses, but ran into this while building a full simple transaction,

relay@relay-test3:~/keys$ export CARDANO_NODE_SOCKET_PATH=~/cardano-node/relay/db/node.socket
relay@relay-test3:~/keys$ cardano-cli transaction submit --tx-file tx.signed --testnet-magic 1097911063

cardano-cli: Network.Socket.connect: <socket: 11>: does not exist (No such file or directory)relay@relay-test3:~/keys$

My foundation knowledge of linux is lacking. I have thought of sockets as ports or a way for processes to communicate, but I’m not sure I understand the specifics of how linux uses, configures, and maintains sockets, or how that implements with Cardano. I’ve read through the Ubuntu pages on sockets and have not made much more sense to me.

I guess my question is, can anyone explain sockets to me in a way that can help me improve my own troubleshooting? I’ve simply copy/pasted the lines from tutorials related to sockets and setting paths, but I’d like to comprehend this better. Thank you in advance, Eazy

Hi There!

check the logs of your node… is it running or got stuck in the starting phase?

Yes, I’ve been up and running for a few days. Left it running to watch for uptime and crashes.

Screen Shot 2021-05-03 at 11.44.40 AM

check that the file exists:
ls -l ~/cardano-node/relay/db/node.socket
the result should begin with ‘s’
srwxr-xr-x 1 user group 0 Apr 30 07:59 node.socket

if exists then list the processes which using this socket file:

$ lsof storage/node.socket
cardano-n 6012   user   27u  unix 0x0000000000000000      0t0 31984423 storage/node.socket type=STREAM

The file exists, I have /relay/db/node.socket which returns the following when checking perms/listing the file.

relay@relay-test3:~/relay/db$ ls -l node.socket
srwxrwxr-x 1 relay relay 0 Apr 30 09:32 node.socket

This is a line in the output when I run, sudo lsof -u relay

cardano-n 4001546 relay 25u unix 0xffff9f8fc066f400 0t0 3555735 db/node.socket type=STREAM

The file exists, and I appear to have access.

I went back and ran the export CARDANO_NODE_SOCKET_PATH to /relay/db/node.socket and I think the transaction completed, but probably with errors since it had old ttl and tip info. I’ll keep working on this and see if I can build some new transactions.

1 Like

My script works correctly to show the file and its permissions. But what should I do with the output of lsof storage? Mine is different than your output


first try ls -l storage/node.socket
but I guess the path of your socket file is:
/home/princess/relay/db/node.socket so use this path for lsof
also use this path during export, without ~ character
export CARDANO_NODE_SOCKET_PATH=/home/princess/relay/db/node.socket

Both lsof and the path export took. But the error keeps arising with <Node Socket 11>

When I run ‘top’, it looks like my node isn’t running. But sudo systemctl status cardano-node shows that it is active. Any recommendations?

I see from your last pic that the node is using the parh: /home/queen/cardano-my-node

1 Like

yes, what you need to do is to export the socket file correctly.
do you know what is the full path of the socket file? go to the folder where the socket file is placed then call the command pwd