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

Bug report : Trying to pull config from the wrong folder #62

Open
Deliphin opened this issue Mar 1, 2024 · 1 comment
Open

Bug report : Trying to pull config from the wrong folder #62

Deliphin opened this issue Mar 1, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@Deliphin
Copy link

Deliphin commented Mar 1, 2024

Describe the bug
I'm using a server host (HumbleServers), which uses Pterodactyl for its game management. My servers' mods including this one are stored in /home/container/mods/ and configs in /home/container/config/, but if I try to run the Jar on its own for its terminal interface, it fails to load because it's expecting the properties file to be in /home/config/, skipping over the container folder.
Note: It does correctly create the properties file in the correction location (/home/container/config/AdvancedBackups.properties) when the game server is run.

Pterodactyl doesn't allow users to access the /home/ folder, so making a copy of my config folder there is not an option.

Advanced Backups - Version 3.4
Note : this cannot restore backups made prior to the 3.0 release.
Searching for properties...ERROR LOADING PROPERTIES!
java.io.FileNotFoundException: /home/config/AdvancedBackups.properties (No such file or directory)
        at java.base/java.io.FileInputStream.open0(Native Method)
        at java.base/java.io.FileInputStream.open(FileInputStream.java:216)
        at java.base/java.io.FileInputStream.<init>(FileInputStream.java:157)
        at java.base/java.io.FileReader.<init>(FileReader.java:75)
        at co.uk.mommyheather.advancedbackups.cli.AdvancedBackupsCLI.main(AdvancedBackupsCLI.java:64)



Ensure you're running this from within the mods directory, and the config file is in the parent directory!

To Reproduce
Steps to reproduce the behavior:

  1. Place AdvancedBackups' jar in /home/container/mods/
  2. In the Startup tab, switch the Server Jar File from the minecraft server jar, to the mod's jar.
  3. Launch the server.
  4. See error.

Expected behavior
It to correctly find the config and allow me to use the terminal interface.

Versioning (please complete the following information):

  • OS: Unknown (I'm guessing something Linux based? I know that this server is running in a container.)
  • Minecraft Version(s): 1.20.1
  • Modloader(s): Fabric
  • Mod Version: 3.4

Additional context
What I believe is going on is its starting directory is up 1 level from the mods'. This would make sense given Pterodactyl is probably expecting to run whatever jar it's given from the container folder. If that's the case, then the solution should be as simple as adding more checks for config locations. Instead of just ../config/AdvancedBackups.properties, also check /config/AdvancedBackups.properties.

My full startup tab in Pterodactyl:
image

@Deliphin Deliphin added the bug Something isn't working label Mar 1, 2024
@Deliphin Deliphin changed the title Bug report : Trying to pull config from the wrong folder? Bug report : Trying to pull config from the wrong folder Mar 1, 2024
@HeatherComputer
Copy link
Owner

Hmm.

This is a bit of a tricky one with the current architecture, as there's a fair bit more than config discovery that relies on cwd.

Are you able to modify the startup command itself? If so, you could add a cd to the start and remove the mods/ from the path to the jar.

If not, I'd suggest running the manual restoration steps.

I'll likely be rewriting the commandline the update after next (so, 3.6), so I'll fix this bug then.

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

2 participants