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

Installing to folder without proper write permissions gives non-sensical logger error #31

Open
AnToniceQ opened this issue Jul 30, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@AnToniceQ
Copy link

The NeoForge jar installer throws a NullPointerException when a inaccessible folder is inputted.

In this specific example, I tried to install a NeoForge server to /home/jjjjjjj/NeoForgeServer, where jjjjjjj is not a valid user. The issue has been tested only in this specific use case and there may exist more ways to obtain this exception.


Screenshot from 2024-07-30 21-19-37

Screenshot from 2024-07-30 21-20-33


Found on system: 22.04.1-Ubuntu
Using installer: neoforge-21.0.146

@Matyrobbrt
Copy link
Member

@AnToniceQ please upload the installer log, which can be found in the directory the installer is in, with the same file name as the installer, but with .log at the end.

@AnToniceQ
Copy link
Author

AnToniceQ commented Jul 31, 2024

@AnToniceQ please upload the installer log, which can be found in the directory the installer is in, with the same file name as the installer, but with .log at the end.

Dang! Should have done that in the first place. Here is the log that I recreated today:

neoforge-21.0.146-installer.jar.log

EDIT: Now that I think of it, I probably opened this issue in a wrong repo. Should I move this issue to https://github.com/neoforged/LegacyInstaller/ ?

@sciwhiz12
Copy link
Member

Confirmed.

The root cause is not with the fact that the installer is trying to install to a non-existent directory -- it is able to do so by my testing, for example with a directory of /home/sciwhiz12/test/server/nonexist (which only the /home/sciwhiz12 part actually exists).

Rather, the root cause is that the installer is told to install to a folder which the current user has no permissions to write to. By default, /home is only writable to the root user, with each home directory underneath having permissions assigned to their respective users. In this case, trying to create a folder underneath /home fails without the proper permissions -- indeed, running the installer as root (via sudo) confirms that the same steps in the issue function normally as expected.

Therefore, the actual issue here is that the installer is giving a non-sensical error of the logger being null rather than a more well-meaning error that the program has no permissions to the target directory. I'll be moving the issue to https://github.com/neoforged/LegacyInstaller for that.

(Additionally, the installer code for running headless fails to log the exception which causes the installer to ultimately fail, which made reproducing this issue require a graphical environment.)

@sciwhiz12 sciwhiz12 transferred this issue from neoforged/NeoForge Aug 5, 2024
@sciwhiz12 sciwhiz12 changed the title Inaccessible folder installations throws exception Installing to folder without proper write permissions gives non-sensical logger error Aug 5, 2024
@sciwhiz12 sciwhiz12 added the bug Something isn't working label Aug 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants