Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Eeems opened this issue May 12, 2021 · 6 comments

Comments

@Eeems
Copy link

Eeems commented May 12, 2021

See toltec-dev/toltec#350 (comment)
innernet should attempt to create the folder if it doesn't exist, and give a more meaningful error if it's missing.

@mcginty
Copy link
Collaborator

mcginty commented May 17, 2021

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?

@Eeems
Copy link
Author

Eeems commented May 17, 2021

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
Copy link
Author

Eeems commented May 17, 2021

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

@mcginty
Copy link
Collaborator

mcginty commented May 19, 2021

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).

@Eeems
Copy link
Author

Eeems commented May 19, 2021

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.

@mcginty mcginty changed the title Fails to start if /var/lib/innernet folder doesn't exist Have better error message if data/config folders can't be created because parent directory is missing May 19, 2021
@mcginty
Copy link
Collaborator

mcginty commented May 19, 2021

Sounds good, thanks again for opening the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants