Recreation config file

Since one of my nodes still has a very old config.yaml I was thinking about recreation of that specific file.

It is a non-dockerized Linux. So I was thinking if I run storagenode setup and add all the required modifications as flags, it sounds like this would be the way to go.

Does this command only create config.yaml or does it any additional things like database creation or something because this probably wouldn’t be a good idea.

Also for not overwriting the existing config.yaml, is it safe to test under a different name, to check, if the required modifications are correct before copying things over?

This command will fail, if there would be a config.yaml. So, you need to rename or delete it first. This is done to protect from second (unintended) run of the setup, because it’s very important for protection.
So you would need to do it only when you are sure what are you doing.

This command also will create all needed/missed folders structure and storage-dir-verification file containing your NodeID in binary form.
This file is used to check if the current NodeID matches the stored in file to protect from running with a wrong identity. It’s also verified if it ever exist, if not the node will fail to protect from disqualification because of missed disk in mountpoint for example.
If there would not be a needed folder structure the node will crash too to protect from missed disk in mountpoint again.
The file is checked also on write and node will fail, if it’s not writeable (in case of read-only fs or wrong permissions)

This does not sound like it was safe to play around / test with that command. I am sure I gonna miss something on my first attempts, any suggestions to get that done safely on a running node to not to mess things up and lose the node?

If the only purpose to generate a config.yaml I would recommend to specify a temp dir as a data location for the setup step, then move config.yaml to the normal location manually.

Yes it’s only about the config.yaml. I have just checked, the storage-dir-verification file does exist and it is in the correct location and I guess the folder structure I could check manually, just to compare if there is anything wrong.

Ok that means not to use the current data dir.

But once I know I have the command right and the resulting config.yaml is 100% correct, would it then be safe to run it with the original data dir on the running node?

Yes, of course, if you specified a correct (actual) path to the identity location.
You also can compare temp and actual data location folders with diff for example.

1 Like
2025-02-16T17:08:34Z	ERROR	piecestore:cache	encountered error while computing space used by satellite	{"Process": "storagenode", "error": "filewalker: used_space_per_prefix_db: context canceled", "errorVerbose": "filewalker: used_space_per_prefix_db: context canceled\n\tstorj.io/storj/storagenode/storagenodedb.(*usedSpacePerPrefixDB).Get:81\n\tstorj.io/storj/storagenode/pieces.(*FileWalker).WalkAndComputeSpaceUsedBySatelliteWithWalkFunc:96\n\tstorj.io/storj/storagenode/pieces.(*FileWalker).WalkAndComputeSpaceUsedBySatellite:83\n\tstorj.io/storj/storagenode/pieces.(*Store).WalkAndComputeSpaceUsedBySatellite:783\n\tstorj.io/storj/storagenode/pieces.(*CacheService).Run.func1:86\n\tgolang.org/x/sync/errgroup.(*Group).Go.func1:78", "SatelliteID": "12EayRS2V1kEsWESU9QMRseFhdxYxKicsiFmxrsLZHeLUtdps3S"}
2025-02-16T17:08:34Z	ERROR	piecestore:cache	error getting current used space for trash: 	{"Process": "storagenode", "error": "filestore error: failed to walk trash namespace af2c42003efc826ab4361f73f9d890942146fe0ebe806786f8e7190800000000: context canceled", "errorVerbose": "filestore error: failed to walk trash namespace af2c42003efc826ab4361f73f9d890942146fe0ebe806786f8e7190800000000: context canceled\n\tstorj.io/storj/storagenode/blobstore/filestore.(*blobStore).SpaceUsedForTrash:302\n\tstorj.io/storj/storagenode/pieces.(*CacheService).Run.func1:105\n\tgolang.org/x/sync/errgroup.(*Group).Go.func1:78"}
2025-02-16T17:08:35Z	ERROR	failure during run	{"Process": "storagenode", "error": "piecestore monitor: error verifying location and/or readability of storage directory: open config/storage/storage-dir-verification: no such file or directory", "errorVerbose": "piecestore monitor: error verifying location and/or readability of storage directory: open config/storage/storage-dir-verification: no such file or directory\n\tstorj.io/storj/storagenode/monitor.(*Service).verifyStorageDir:161\n\tstorj.io/common/sync2.(*Cycle).Run:102\n\tstorj.io/storj/storagenode/monitor.(*Service).Run.func1:109\n\tgolang.org/x/sync/errgroup.(*Group).Go.func1:78"}
Error: piecestore monitor: error verifying location and/or readability of storage directory: open config/storage/storage-dir-verification: no such file or directory

I have this issue, does someone knows how to manage to recreate /storage/storage-dir-verification file?

It’s the ID of the node I believe, in binary format…
There was an old post. Search for it.
I believe you should run the setup in a dffferent location and it will recreat it there.
You can preserve the identity location.
Here:
https://forum.storj.io/t/removed-storage-dir-verification-how-to-recover/18995/3?u=snorkel

1 Like