Command line can't find identity but node is running

I attempted to migrate my node to another disk this morning and rolled back after realizing that the target folder was messed up. Naturally that meant recreating the docker image on the old location.

It started fine, shows the data on the dashboard and sends/receives data.
I never tried the command line commands before, but now I wanted to validate the node and got the following error on multiple commands:

docker exec -it storagenode_old /app/storagenode dashboard
2020-03-31T10:05:25.614Z FATAL file or directory not found error: open /root/.local/share/storj/identity/storagenode/identity.cert: no such file or directory

I checked /root/.local/share/storj and there is only a folder called “storage”. Is that even the correct path? I mean, we mount the identity to /app/identity.

Here is the command I used to create the node, I used the same when I initialized it ~3 months ago:
docker run -d --restart unless-stopped -p 28967:28967 -p 14002:14002 -m 512m -e WALLET="XXXX" -e EMAIL="XXXX" -e ADDRESS="XXXX:28967" -e BANDWIDTH="33.0TB" -e STORAGE="1982GB" --mount type=bind,source="/share/storagenode/identity",destination=/app/identity --mount type=bind,source="/share/storagenode/storage",destination=/app/config --name storagenode_old storjlabs/storagenode:beta

There are three files (identity.1579209243.cert, identity.cert, identity.key) in /share/storagenode/identity

To check dashboard do:
docker exec -it storagenode_old /app/dashboard.sh

Unless your container isn’t restarting in a loop. You can check by running docker ps

Also if your path is /share/storagenode/storage/ then in config omit storage part like so: /share/storagenode Unless storji files are in storage dir that is inside another storage dir then leave as it is.

If you only have 3 identity files you didnt authorize them and you wont be able to run a node.

If you only have THESE three files, it was signed at some point, but you somehow managed to lose the 3 ca.* equivalents. Either that or you didn’t mention them as they don’t have identity in their name. They are part of it though and required to run your node.

But kollo has the correct answer regarding the dashboard. The way you are running it it looks in the default config location and doesn’t take your environment variables set in the docker run command into account. This is why the dashboard.sh script exists inside the container.

Thanks for the answers!

Seems like you can run a node without the *.ca files - My node was running happily for 3 months (!). Better safe than sorry - I added them.

docker exec -it storagenode_old /app/dashboard.sh runs fine.
But /app/storagenode command can do more than just view the dashboard and it is even mentioned in the docs. So I expect to be able to use it - I mean, that docker image is designed to just be dropped in place, so why shouldn’t it!

Does it work on your nodes?

I just ran the diag command and the output is even scarier:

docker exec -it storagenode_old /app/storagenode diag
unable to get bandwidth summary: bandwidthdb error: no such table: bandwidth_usage_rollups
Error: bandwidthdb error: no such table: bandwidth_usage_rollups
Why should there be a missing table? Or am I just the first to run it on v1.0.1

Take a look at the command inside the dashboard.sh file for the additional parameters you would need to add to make those commands work. You need to at least point to the correct config file location. Possibly more.

The correct config file location? That would defeat the whole purpose of docker, it’s supposed to just work without fiddling with the internals! We are not in beta anymore after all

Then why are you trying to fiddle with the internals by using the binary directly? If you want to fiddle, you have to fiddle correctly. You can’t have it both ways.

1 Like

I attempt to run commands that are mentioned in the docs, one of them being named diag.

So after all these posts I am still not sure whether my node now has a misconfiguration or the command line is broken.

Try using the complete location of your idenity files in your start command. "/share/storagenode/identity/storagenode"

The identity files are in /share/storagenode/identity/ (on the host system), there is no “storagenode” folder in there.

According to your log its looking in /root/.local/share/storj/identity/storagenode for the identity

Yes, that is the point, that folder does not exist and I see no reason why it should.
Could you please check your own node, does it have any folders in /root/.local/share/storj? Do the commands run without error message, e.g. docker exec -it storagenode /app/storagenode dashboard

I tend to agree with BrightSilence that this might be a shortcoming (or bug) of the container, unrelated to my specific installation

Unfortunately I didn’t use the default location for anything all mine is all custom locations.
But this was my docker start
docker run -d --restart unless-stopped -p 28967:28967 -p 10.10.1.52:14002:14002 -e WALLET="" -e EMAIL="" -e ADDRESS="" -e BANDWIDTH="20TB" -e STORAGE="3.3TB" --mount type=bind,source="/home/deathless/Storagenode/Identity/storagenode",destination=/app/identity --mount type=bind,source="/home/deathless/Storagenode/Storage",destination=/app/config --name storagenode storjlabs/storagenode:beta

It’s not related to the container at all. If you don’t use the default config file location you have to tell the binary where to look for the config. The docs page you linked to shows the help command for a reason.

Among other things it displays these

--config-dir string                main directory for storagenode configuration (default "/root/.local/share/storj/storagenode")
--identity-dir string              main directory for storagenode identity credentials (default "/root/.local/share/storj/identity/storagenode")

This is why it is looking in those locations. If you’re using the binary directly you have to specify those, whether you are using the docker setup or not.

If you had looked at the command used in the dashboard.sh file like I suggested in an earlier post you’d see the command used for the dashboard is:

./storagenode dashboard --config-dir /app/config --identity-dir /app/identity

I was at the time on my phone, so I couldn’t look up the command myself. Looks like these two are the only two you need to specify.
So simply add --config-dir /app/config --identity-dir /app/identity to your commands and they should work.

Please note, since you are now working inside the container, you use the paths where they are mapped inside the container, not the paths on the host system. So don’t change these paths, they are correct for everyone.

Thanks, BrightSilence.

I didn’t look at the command because I was concerned that the node might be misconfigured, explicitly setting the correct path would make the command work, but not fix any issue.

I guess they should specify what you said in the docs and/or make the script have the correct default location.

If you want to simplify things you can create a simple storagenode.sh script on the host system with this command.

docker exec -it storagenode /app/storagenode $* --config-dir /app/config --identity-dir /app/identity

Then you can simply use the storagenode binary by typing:

./storagenode.sh dashboard

etc.