Permission errors for chunks (/blobs/)

Hello, please help me with my permission errors. After a power outage, I restarted the node and noticed that the database didn’t have the correct permissions, causing the node to be unable to start. I found and ran the command below, which allowed the node to start. However, I only ran this command for the database files and didn’t run it on all the chunks inside the blob folder.

COMMAND:
sudo chown $(id -u):$(id -g) -R /media/node/node-hdd-1

Now, I have noticed that my suspension score has started falling, and after checking the logs, I found errors like the one below:

ERROR LOG:
2023-10-26T15:54:13Z ERROR piecestore download failed {"process": "storagenode", "Piece ID":...config/storage/blobs/ukfu6bhbboxilvt7jrwlqk7y2tapb5d2r2tsmj2sjxvw5qaaaaaa/45/nbztdjryxkxjtr7avgn4ehdcvolj6xcb2gbpxjrdl3sje4765a.sj1: permission denied", "errorVerbose": "pieces error: filestore error: unable to open...

Do I need to run the above command in the whole /storage/ folder as well now?
I stopped the node because I noticed a lot of these errors and would like to fix permissions before starting it again.

Thank you for help!

I forgot to mention that in the past, I always started the node by running commands through the terminal, such as the setup node command and the run node command. However, after a few power outages, I created a bash script as shown below. Now, I remove, set up, and start the node with a single command in the terminal (node restart): sudo bash startnode.sh

My “startnode.sh” file looks like this:

#!/bin/bash
sudo docker stop node-1
sudo docker rm node-1

sudo docker run -d --rm -e SETUP="true" \
--user $(id -u):$(id -g) \
--mount type=bind,source="/media/node/node-hdd-1/identity/storagenode/",destination=/app/identity \
--mount type=bind,source="/media/node/node-hdd-1/",destination=/app/config \
--name node-1 storjlabs/storagenode:latest

sleep 60

sudo docker run -d --restart unless-stopped --stop-timeout 300 --network=container:ip-1 \
-e WALLET="0x6743b72bD912e9CA862cDde85895781331c84CEE" \
-e EMAIL="demnode@demo.si" \
-e ADDRESS="node-1.demo.si:39204" \
-e STORAGE="18000GB" \
-e PORT="39204:28967" \
-e PORT="14002:14002" \
--user $(id -u):$(id -g) \
--mount type=bind,source="/media/node/node-hdd-1/identity/storagenode/",destination=/app/identity \
--mount type=bind,source="/media/node/node-hdd-1/",destination=/app/config \
--name node-1 storjlabs/storagenode:latest \
--storage2.piece-scan-on-startup=false

Is it possible that my new bash file created these permission errors?
I started using this method for node restart on the same day the power outage occurred, and now I’m not sure what caused these errors.

You definitely don’t want to run the SETUP command again. That should only be run once.

As far as permissions are concerned, I’m not sure but if the user is changing and you are setting permissions by user, it will inevitably need changed. Perhaps apply rights at a group level would be better than at the user level.

2 Likes

I moved all files on Ubuntu to root user and started node there. Now works without permission errors.

2 Likes

Please remove it forever. This command can DESTROY your node. It should be executed only once for the identity for the entire node’s life.

1 Like

Okay, thank you for details.