Permission denied for 'db' while running core node - Solved


I am trying to complete the staking pool school handbook.
I have successfully run the relay node and set up my core node.

but I got ‘cardano-node: /db: createDirectory: permission denied (Permission denied)’ error while running the core node. I am able to create a directory manually but then it just don’t work when starting the node. Please help


With what parameters did you execute the cardano-run command?
Can you post the permissions of the db folder? ls -l db

cardano-node run
–topology testnet-topology.json
–database-path /db
–socket-path /db/node.socket
–host-addr XX.XXX.XXX.XX
–port 3001
–config testnet-config.json
–shelley-kes-key kes.skey
–shelley-vrf-key vrf.skey
–shelley-operational-certificate node.cert

The permission on the folder in which db to be created

coreuser@core:~/pool$ ls -l
total 76
-rw------- 1 coreuser coreuser 203 Apr 24 20:22 cold.counter
-rw------- 1 coreuser coreuser 187 Apr 24 20:20 cold.skey
-rw------- 1 coreuser coreuser 197 Apr 24 20:20 cold.vkey
-rw------- 1 coreuser coreuser 1327 Apr 24 20:20 kes.skey
-rw------- 1 coreuser coreuser 183 Apr 24 20:20 kes.vkey
-rw------- 1 coreuser coreuser 365 Apr 24 20:22 node.cert
-rw-rw-r-- 1 coreuser coreuser 31112 Mar 16 17:34 testnet-byron-genesis.json
-rw-rw-r-- 1 coreuser coreuser 2277 Mar 16 17:34 testnet-config.json
-rw-rw-r-- 1 coreuser coreuser 2487 Mar 16 17:34 testnet-shelley-genesis.json
-rw-rw-r-- 1 coreuser coreuser 107 Apr 24 18:46 testnet-topology.json
-rw------- 1 coreuser coreuser 230 Apr 24 20:20 vrf.skey
-rw------- 1 coreuser coreuser 176 Apr 24 20:20 vrf.vkey

ok - but first create the db folder before you give it to cardano-node run - the folder should exist. or have you created the db folder under /? I would recommend to create it under pool folder - /home/coreuser/pool/db instead of /db - probably /db folder not owned by coreuser that is why cardano-node has permission issues

Thanks @laplasz for the suggestions.
I did create the db manually and tried running the node but no change in the result. Attaching the screenshot of the same.


Still you defined /db in the command. Instead you need to define the path to the folder either ./db or ~/pool/db or /home/usercore/pool/db

you can get the full path to the db folder by going inside the folder and use pwd command

Wow! that worked. Thank you so much for the help.

No problem! - there is a category for setup a stake pool under Delegations - you can edit the original post to modify the category - once it is in the right place - there will be a solution button for answers - to able to mark the topic as solved.