Always "Socket: 11"

Hi all,

Trying to setup a node here using docker (running Debian 10, user to run containers is in the docker group, not requiring sudo). Tried both the cardano-node image and @tdiesler’s nessusio cardano-node version. While I can start the container fine, there is always a problem running the cli. For example, following the documentation for nessusio, I can start the relay on testnet like this:

docker run --detach \
    --name=testrl \
    -p 3001:3001 \
    -e CARDANO_NETWORK=testnet \
    -v test-data:/opt/cardano/data \
    nessusio/cardano-node run

docker logs -f testrl

Then it is suggested that I can run the cli in the following manner:

alias cardano-cli="docker run -it --rm \
  -v ~/cardano:/var/cardano/local \
  -v node-ipc:/opt/cardano/ipc \
  nessusio/cardano-node cardano-cli"

cardano-cli query tip --mainnet

However, whatever I try, I always get an error:

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

Tried to export CARDANO_NODE_SOCKET_PATH environment variable pointing to a path within the home of the user running the container (and using absolute path for that variable) - no difference.

What am I missing or doing wrong there?

The docs say …

For this to work, the node must share its IPC socket location, which can then be use in the alias definition.

You should therefore add this volume to your node run command as well

-v node-ipc:/opt/cardano/ipc

Bah, silly me, how did I miss that … Thanks a lot, @tomdx, with that additional volume it works as intended.

Do you know by chance if it is possible to run all that as non-root as well, by pointing to $UID:$GID of the current user? That didn’t seem to work: if you were to specify --user for the node command only, then you’d get the “Socket: 11 … Connection refused” error; if you were to specify that for both the node and an alias, then you’d get “Socket: 11 … Permission denied” error.

We tried this as part of …

  • #33 Run node/tools images as non-root user

It’s not a trivial thing and maybe we should take another stab at this a little later when the upstream image catches up.

1 Like