Error starting testnet core

hi all,

I hope everything is well. I am at this stage with the testnet tutorial:

https://cardano-foundation.gitbook.io/stake-pool-course/stake-pool-guide/stake-pool/corenode-start

I have customised the command according to my file names:

cardano-node run
–topology testnet-topology2.json
–database-path /db_c
–socket-path /db_c/node.socket
–host-addr <x.x.x.x>
–port
–config testnet-config.json
–shelley-kes-key kes.skey
–shelley-vrf-key vrf.skey
–shelley-operational-certificate node.cert

In the above IP and port are modified, in the run code they are my ones.

On running the script I always get the following:

Listening on http://127.0.0.1:12798
FsError {fsErrorType = FsInsufficientPermissions, fsErrorPath = /db_c, fsErrorString = “Permission denied”, fsErrorNo = Just (Errno 13), fsErrorStack = [(“ioToFsError”,SrcLoc {srcLocPackage = “ouroboros-consensus-0.1.0.0-inplace”, srcLocModule = “Ouroboros.Consensus.Storage.FS.IO”, srcLocFile = “src/Ouroboros/Consensus/Storage/FS/IO.hs”, srcLocStartLine = 88, srcLocStartCol = 41, srcLocEndLine = 88, srcLocEndCol = 68}),(“handleError”,SrcLoc {srcLocPackage = “ouroboros-consensus-0.1.0.0-inplace”, srcLocModule = “Ouroboros.Consensus.Storage.FS.IO”, srcLocFile = “src/Ouroboros/Consensus/Storage/FS/IO.hs”, srcLocStartLine = 84, srcLocStartCol = 23, srcLocEndLine = 84, srcLocEndCol = 38}),(“rethrowFsError”,SrcLoc {srcLocPackage = “ouroboros-consensus-0.1.0.0-inplace”, srcLocModule = “Ouroboros.Consensus.Storage.FS.IO”, srcLocFile = “src/Ouroboros/Consensus/Storage/FS/IO.hs”, srcLocStartLine = 65, srcLocStartCol = 54, srcLocEndLine = 65, srcLocEndCol = 71}),(“createDirectoryIfMissing”,SrcLoc {srcLocPackage = “ouroboros-consensus-0.1.0.0-inplace”, srcLocModule = “Ouroboros.Consensus.Storage.FS.API”, srcLocFile = “src/Ouroboros/Consensus/Storage/FS/API.hs”, srcLocStartLine = 123, srcLocStartCol = 5, srcLocEndLine = 123, srcLocEndCol = 29})], fsLimitation = False}

cardano-node: FsInsufficientPermissions for /db_c: Permission denied at CallStack (from HasCallStack):
ioToFsError, called at src/Ouroboros/Consensus/Storage/FS/IO.hs:88:41 in ouroboros-consensus-0.1.0.0-inplace:Ouroboros.Consensus.Storage.FS.IO
handleError, called at src/Ouroboros/Consensus/Storage/FS/IO.hs:84:23 in ouroboros-consensus-0.1.0.0-inplace:Ouroboros.Consensus.Storage.FS.IO
rethrowFsError, called at src/Ouroboros/Consensus/Storage/FS/IO.hs:65:54 in ouroboros-consensus-0.1.0.0-inplace:Ouroboros.Consensus.Storage.FS.IO
createDirectoryIfMissing, called at src/Ouroboros/Consensus/Storage/FS/API.hs:123:5 in ouroboros-consensus-0.1.0.0-inplace:Ouroboros.Consensus.Storage.FS.API

@ADAfrog suggested there may be issues with permissions on the db_c directory. I have never had this happen when running the relay node. When running the relay the first time (in the absence of a db directory), said directory would just get created and the node.socket as well as other files get populated in it. This does not happen with the core node. I have also tried to create an empty db_c directory but that did not solve the problem.

Is there a part of the config file that needs changing between relay running and core running? I went through the config file and didn’t find anything obvious. I ask this because, in the tutorial, before starting the CORE node, it suggest downloading new topology, genesis and config files:

https://cardano-foundation.gitbook.io/stake-pool-course/stake-pool-guide/stake-pool/core_relay

I don’t think these linked files with the shelley_ prefix actually exist (i get a 404 not found every time), so I just use the original files (used for relay building and running). Is this where the problem lies?

One more thing: to run the core node, I have not started a completely new build. I have just made a new directory (eg core_t) into which I copied topology, config, genesis, vrf, kes and cert. All the dependencies, ghc, libsodium and cardano-node are the same as the relay. Could this be the issue?

Thank you in advance for you time and let me know if you need more info,

Cheers,

A

Hi, are you running as root user?

1 Like

This is on my local machine. If I run a sudo command it normally asks for my password. I wad under the impression that this run command didn’t need root privilege?

H A drem,

This would indicate an issue with permissions. It could be attributed to how you created the directory.

Compare the db_c folder permissions with the db folder on your functioning nodes to confirm. My db folder permissions are rwxr-xr-x. Once verifying discrepancy on your end, chmod your db_c folder to mirror.

Regards,

Your friend FROG

1 Like

Hi all,

thank you for your input. OK, so far I have found this:

ls -l
total 64
drwxrwxr-x 3 ste ste 4096 Aug 23 10:35 addresses
drwxr-xr-x 5 ste ste 4096 Aug 24 20:27 db_t
-rw-rw-r-- 1 ste ste 494 Aug 23 09:04 protocol.json
-rw-rw-r-- 1 ste ste 31112 Jul 29 21:24 testnet-byron-genesis.json
-rw-rw-r-- 1 ste ste 4198 Aug 21 11:24 testnet-config.json
-rw-rw-r-- 1 ste ste 2487 Jul 29 21:24 testnet-shelley-genesis.json
-rw-rw-r-- 1 ste ste 105 Aug 22 14:04 testnet-topology2.json
-rw-rw-r-- 1 ste ste 131 Aug 21 11:23 testnet-topology.json

db_t is the “relay” db and if I execute the following command:

cardano-node run
–topology testnet-topology2.json
–database-path db_t
–socket-path db_t/node.socket
–port
–config testnet-config.json

as a relay it works just fine and connects to the one actual relay node in AWS.

So I check permissions in the core_t directory and get:

ls -l
total 72
drwxr-xr-x 2 ste ste 4096 Aug 25 08:13 db_c
-rw-r–r-- 1 ste ste 1327 Aug 24 20:17 kes.skey
-rw-r–r-- 1 ste ste 365 Aug 24 20:18 node_srm.cert
-rw-rw-r-- 1 ste ste 494 Aug 23 09:04 protocol.json
-rw-rw-r-- 1 ste ste 31112 Jul 29 21:24 testnet-byron-genesis.json
-rw-rw-r-- 1 ste ste 4198 Aug 21 11:24 testnet-config.json
-rw-rw-r-- 1 ste ste 2487 Jul 29 21:24 testnet-shelley-genesis.json
-rw-rw-r-- 1 ste ste 105 Aug 22 14:04 testnet-topology2.json
-rw-rw-r-- 1 ste ste 131 Aug 21 11:23 testnet-topology.json
-rw-r–r-- 1 ste ste 230 Aug 24 20:17 vrf.skey

To me the permissions (755) in db_t and db_c look the same. However, when from directory core_t I run:

cardano-node run
–topology testnet-topology2.json
–database-path /db_c
–socket-path /db_c/node_c.socket
–port
–config testnet-config.json
–shelley-kes-key kes.skey
–shelley-vrf-key vrf.skey
–shelley-operational-certificate node_srm.cert

I still get the same permission issue. I must be missing something. Is it possible that attempting to run a core in a local machine that has previously run as relay stuffs things up?

Now I have to go to work, tonight I will try to build a node from scratch on AWS and run it as core, to see if that solves the problem.

Cheers,

A

hi all,

I have rebuilt a node from scratch in AWS, run it as a core for the first time, and still get the same permission error on the db folder.

This is odd, I have not run into this issue when running the relay node. Below I will paste the commands I run for relay (ports, files and db names may change):

cardano-node run
–topology testnet-topology.json
–database-path db_t
–socket-path db_t/node.socket
–port 8778
–config testnet-config.json

And for core (again, details may vary):

cardano-node run
–topology testnet-topology2.json
–database-path /db
–socket-path /db/node.socket
–port 8777
–config testnet-config.json
–shelley-kes-key kes.skey
–shelley-vrf-key vrf.skey
–shelley-operational-certificate node.cert

The permissions on the db folder seem to make no difference: I have tried changing them on the relay node (which works fine) and it still spins. I have tried changing them on the core node, and it still won’t. I set them to 755, as suggested by @ADAfrog.

I have generated the KES, vfr, cert and all the rest on a separate machine. The cold keys are where they should be (in cold storage) and nowhere near the directory of the node I attempt to spin. Could this create the issue?

Any ideas will be greatly appreciated,

Cheers

A

hi,

–database-path /db
–socket-path /db/node.socket

you need to put relative path - in this case you have set absolute path (starts with / ) your user doesn’t have permissions to create a folder/directory outside it’ s home dir.
change to this:

–database-path db
–socket-path db/node.socket

quick info:

An absolute path is defined as specifying the location of a file or directory from the root directory(/). In other words,we can say that an absolute path is a complete path from start of actual file system from / directory.

Relative path is defined as the path related to the present working directly(pwd). It starts at your current directory and never starts with a / .

more info: https://www.geeksforgeeks.org/absolute-relative-pathnames-unix/

please edit and let us know if this worked for you.

cheers,
Lauris

3 Likes

This is correct - good eye Lauris

2 Likes

thank you all for giving me your time!

@lauris your solution was very well spotted, thank you!

To prevent others from making my same mistakes, I would like to know who to contact to get this (and another small issue) permanently fixed on the cardano-foundation gitbook (stake pool school). As below:

https://cardano-foundation.gitbook.io/stake-pool-course/stake-pool-guide/stake-pool/corenode-start

The code on this page needs amending to reflect the absolute/relative path issue;

https://cardano-foundation.gitbook.io/stake-pool-course/stake-pool-guide/stake-pool/core_relay

The code at the top of the page (wget) leads to 404 not-found files (the ones starting with shelley_ prefix). This step is redundant anyway, as people would have already gotten the necessary files for their relays, here:

https://cardano-foundation.gitbook.io/stake-pool-course/stake-pool-guide/getting-started/getconfigfiles_and_connect

Let me know if you have any advice in relation on who to contact at IOHK for this (I tried Carlos, but I imagine he’d be crazy-busy).

Thanks again for your time and help, all legends in my book :slight_smile:

Cheers

A

Thank you. :heart: