Node always restarting (solved but what happens ?) + docker stats high Block I/O

Hi i got some strange Issue. My (Linux) node is always restaring after installing. I used the start commands on CLI from doc. When deleting the line with "–user $(id -u):$(id -g) " the node is running perfectly fine. My Node has been running for years 100 % fine. Right now i just copy pasted the start commands from doc. The last years i started the node without the line "–user $(id -u):$(id -g) " by accident so it worked perfectly fine.

So some thoughts about what’s going on ? Perhaps some has some restarting issue and can try the same workaround. Here you can see the cli start command from storj doc.

docker run --rm -e SETUP=“true”
–user $(id -u):$(id -g)
–mount type=bind,source="",destination=/app/identity
–mount type=bind,source="",destination=/app/config
–name storagenode storjlabs/storagenode:latest

docker run -d --restart unless-stopped --stop-timeout 300
-p 28967:28967/tcp
-p 28967:28967/udp
-e EMAIL=""
–user $(id -u):$(id -g)
–mount type=bind,source="",destination=/app/identity
–mount type=bind,source="",destination=/app/config
–name storagenode storjlabs/storagenode:latest

Second: I can see in docker stats a realy high Block I/O nearly 1 TB per day. But only some GB on Net I/O. So why the hell is Block I/O that high ? Can someone confirm ? What’s your docker stats saying ?

This additional option allow you to use the system user and user group inside the container, to do not use root. It is more safe.
But in this case you should not run it with sudo (you need to add your user to the docker user group), and also change permissions for data and identity locations to your user.
If you have running your node without this option, and do not care about security implications too much, you can leave it as is and do not use this option.

If someone has previously been running the container as root and now tries to implement the user and group option, will it cause problems with accessing the existing files?

Yes if you want to switch now you need to stop the node, change ownership of all files inthe mounted path, and then start the node.

Changing ownership may take a long time.

1 Like

OK thanks, so if running without –user $(id -u):$(id -g) and without sudo it is safe ?

And I should change all my storagenode folders with

sudo chown -cR user:group /path of storagenode ?

and for group using docker ? (after set the user to the docker group)

Mhh OK, the solution is to change ownership and using –user $(id -u):$(id -g) for more security. Now I got my explantion for restarting. Some files has been root:root. So the storj Node couldn’t read the files and restartet and restartet and restartet… That is the explanation for restarting the whole time.

My Node is old and so first time running there was no such command and I missed the information about the –user $(id -u):$(id -g) start command.

For those who read til this post, solution path is:

  1. stop node
  2. Change ownership with “sudo chown -cR user:group / -v”
  3. Then restart with every command and the node is running without root :slight_smile:

(user is your own user and just use a group that your user is using)
I added my user to the docker group. Alexey explained it very well. For changing permissions I made an CLI user change to a user who was able to use sudo. It took some hours for changing the permissions and this time the node was offline but now running all as it should be and more safe.

1 Like

Please confirm/check your chown command: as currently shown you are modifying the user and group of all files recursively, starting at the root “/” ?

1 Like

I think @StoreMe meant to use the path for storagenode, i.e. /mnt/storj/storagenode, not the root /.