innernet icon indicating copy to clipboard operation
innernet copied to clipboard

Have better error message if data/config folders can't be created because parent directory is missing

Open Eeems opened this issue 4 years ago • 6 comments

See https://github.com/toltec-dev/toltec/pull/350#issuecomment-839978312 innernet should attempt to create the folder if it doesn't exist, and give a more meaningful error if it's missing.

Eeems avatar May 12 '21 17:05 Eeems

Huh, the ensure_dirs_exist(...) call at https://github.com/tonarino/innernet/blob/main/client/src/data_store.rs#L63 should be creating the directories if they don't exist. I feel like something else weird is going on - are there any weird permissions that might otherwise prevent the directory from being created?

mcginty avatar May 17 '21 07:05 mcginty

I did a manual mkdir -p with no issues. Which you can barely make out in the second screenshot in the linked issue. I can't remember if the parent directory existed or not.

Eeems avatar May 17 '21 14:05 Eeems

I've just tested, and it is indeed that the parent folder didn't exist yet.

Eeems avatar May 17 '21 14:05 Eeems

Hmm, do we want to actually have innernet create /var/lib if it's missing? That seems like it may be problematic since it's typically assumed to exist on systems that use FHS (which is all the systems we support, currently).

mcginty avatar May 19 '21 08:05 mcginty

It's probably fair to not create parent folders as it's something we have solved in toltec as part of the package install scripts. But it would be good to have a more user friendly if the parent folder is missing.

Eeems avatar May 19 '21 14:05 Eeems

Sounds good, thanks again for opening the issue.

mcginty avatar May 19 '21 14:05 mcginty