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

New home env var check fails by default on linux #52

Closed
P4sca1 opened this issue Dec 26, 2022 · 10 comments · Fixed by #55
Closed

New home env var check fails by default on linux #52

P4sca1 opened this issue Dec 26, 2022 · 10 comments · Fixed by #55
Assignees

Comments

@P4sca1
Copy link

P4sca1 commented Dec 26, 2022

Environment.GetFolderPath returns an empty string, when the path does not exist.
According to https://jimrich.sk/environment-specialfolder-on-windows-linux-and-os-x/ System.Environment.SpecialFolder.ApplicationData resolves to /home/{user}/.config, which is a directory that does not exist by default (at least on ubuntu).

@zabszk
Copy link
Member

zabszk commented Dec 26, 2022

I have just tested it on clean Ubuntu 2020.04 LTS and Debian 11 installations and it's not the case. It doesn't return an empty string if the path doesn't exist.

Many SCP:SL communities (including our official ones) run LocalAdmin in Docker containers, where the .config folder doesn't exist and it was never an issue for anyone either.

@P4sca1
Copy link
Author

P4sca1 commented Dec 26, 2022

Weird, I started to get the error can't obtain a valid user home directory path recently. It was fixed after I created the .config folder manually. I'm running from a docker container based on Ubuntu 22.04. The env variable HOME=home/myuser is set.

@zabszk
Copy link
Member

zabszk commented Dec 26, 2022

Interesting issue. I will retest it on Ubuntu 22.04 LTS then.

If you run it in docker (presumably using pterodactyl), adding a command to create that path shouldn't be an issue as a temporary workaround.

@P4sca1
Copy link
Author

P4sca1 commented Dec 26, 2022

I am using my own docker image from https://github.com/ips-hosting/game-images and did just that to fix the issue. Maybe one of my other command line arguments was causing the issue.

@J-Stuff
Copy link

J-Stuff commented Dec 31, 2022

Testing with Ed_PlayZ. This issue is occouring on clean installs of Ubuntu.
image

https://nextcloud.j-stuff.net/s/Hinb9SHmNKefBx8

It requires a .config directory to be created manually by the user in the home directory of the host user to remove the error.

@zabszk zabszk self-assigned this Dec 31, 2022
@zabszk
Copy link
Member

zabszk commented Dec 31, 2022

I can't reproduce the issue (even on a clean installation of Ubuntu 2020.04 LTS), but I made a PR that should fix this bug.

@zabszk
Copy link
Member

zabszk commented Dec 31, 2022

@P4sca1 @J-Stuff Can you test the build from PR (https://github.com/northwood-studios/LocalAdmin-V2/suites/10123726988/artifacts/494040544)? I can't reproduce the issue.

@cynthrune
Copy link

@zabszk seems to be fixed in that one.

@J-Stuff
Copy link

J-Stuff commented Dec 31, 2022

Fixed in the test build!
https://nextcloud.j-stuff.net/s/9aEBJHrPTsp9ayx

@zabszk
Copy link
Member

zabszk commented Dec 31, 2022

Fixed in the test build! https://nextcloud.j-stuff.net/s/9aEBJHrPTsp9ayx

Thanks for testing.

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

Successfully merging a pull request may close this issue.

4 participants