mojira.dev
MC-263046

allow_symlinks.txt does not accept relative links

To Reproduce

Imagine you've put all your Minecraft stuff in a folder:

~/minecraft

and within it, your Minecraft installation lives within

~/minecraft/.minecraft

but your save data lives in

~/minecraft/worlds
  1. Upgrade your Minecraft to 1.20-pre7

  2. In a terminal (usually) navigate to ~/minecraft/.minecraft/saves and create a relative link to your save file:

    ln -s ../../worlds/Testificate
  1. Your file browser (and Minecraft) will now see the world.

  2. However, if you actually try to open the world, you'll end up back at the home screen with the message "Failed to access world"

This is regardless of what you've set in your allow_symlinks.txt file

Workaround

Specify the path to the world using absolute paths

Why that's less than ideal

This means that you can't store your minecraft installation on an external drive where the absolute path will vary from computer to computer

Notes

I've attached a log file (yes, it's modded, and note that everything else in the instance, including mods, screenshots, logs, crash reports, and even options.txt are symlinks) showing:

  • Minecraft can resolve an absolute link (though it refuses to load the world because it contains a symlinked datapack, but that's a separate complaint)

  • Minecraft fails to resolve the relative link:

    java.nio.file.NoSuchFileException: ../../../../EnderChest/Testudo/saves/Testificate

Thank you, and I appreciate you taking the time to review this feedback.

Attachments

Comments 4

Just a quick follow-up: so it appears that allow_symlinks.txt itself... can be a symlink.

This is a feature request.

Thanks Moesh. Should I open a new ticket to address the specific fact that relative links cause the loading to abort with "Failed to Access World" instead of failing gracefully as it does with absolute-but-not-allowed symlinks?

One final thing--from the stack trace, I believe the fix should be a simple matter of calling the toRealPath() method.

OpenBagTwo

(Unassigned)

Plausible

(Unassigned)

1.20 Pre-release 7

Retrieved