Skip to content

"Failed to create default core-configuration-file" because of plugins/BlueMap symlink #349

@ion1

Description

@ion1

What I did / Steps to reproduce

I have all the static Minecraft files, including plugin jars, under one directory in a Docker image, and all the state/configuration data under another directory mounted from the host filesystem.

Unfortunately, PaperMC places both plugin jars and plugin state/configuration side by side under the plugins directory. To work around this, I have a file structure as follows:

/minecraft-static/plugins/foo.jar (file)
/minecraft-static/plugins/foo → ../../minecraft-dynamic/plugins/foo (symlink)
/minecraft-dynamic/plugins/foo (directory)

This has worked with every plugin I have installed so far, but BlueMap fails to start, saying:
[Craft Scheduler Thread - 3 - BlueMap/WARN]: Failed to create default core-configuration-file: java.nio.file.FileAlreadyExistsException: ../../minecraft-static/plugins/BlueMap

BlueMap uses createDirectories in BlueMapConfigs.java. According to the documentation it throws FileAlreadyExistsException "if dir exists but is not a directory". The fact that it does not handle the case where dir exists but is a symlink to an existing directory has been reported and deemed to be intentional behavior.

PaperMC itself has worked around this problem previously.

Expected result

I expect BlueMap to see that plugins/BlueMap is a writeable directory, just one behind a symlink.

Actual result

BlueMap fails to start, saying "Failed to create default core-configuration-file".

Context

BlueMap Version: BlueMap-3.4-spigot
Platform: PaperMC 1.19.2-207 in a Docker container on Linux

Log
[2022-10-13 05:28:03] [Craft Scheduler Thread - 3 - BlueMap/INFO]: Loading...
[2022-10-13 05:28:03] [Craft Scheduler Thread - 3 - BlueMap/WARN]: Failed to create default core-configuration-file: java.nio.file.FileAlreadyExistsException: ../../minecraft-static/plugins/BlueMap
[2022-10-13 05:28:03] [Craft Scheduler Thread - 3 - BlueMap/WARN]: 
################################
 There is a problem with your BlueMap setup!
 BlueMap tried to find this file, but it does not exist:
 ../../minecraft-static/plugins/BlueMap/core.conf
################################
[2022-10-13 05:28:03] [Craft Scheduler Thread - 3 - BlueMap/ERROR]: Failed to load!
java.io.IOException: de.bluecolored.bluemap.common.config.ConfigurationException
        at de.bluecolored.bluemap.common.plugin.Plugin.load(Plugin.java:326) ~[?:?]
        at de.bluecolored.bluemap.bukkit.BukkitPlugin.lambda$onEnable$0(BukkitPlugin.java:147) ~[?:?]
        at org.bukkit.craftbukkit.v1_19_R1.scheduler.CraftTask.run(CraftTask.java:101) [paper-1.19.2.jar:git-Paper-207]
        at org.bukkit.craftbukkit.v1_19_R1.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:57) [paper-1.19.2.jar:git-Paper-207]
        at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22) [paper-1.19.2.jar:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:?]
        at java.lang.Thread.run(Unknown Source) [?:?]
Caused by: de.bluecolored.bluemap.common.config.ConfigurationException
        at de.bluecolored.bluemap.common.config.ConfigManager.loadConfigFile(ConfigManager.java:87) ~[?:?]
        at de.bluecolored.bluemap.common.config.ConfigManager.loadConfig(ConfigManager.java:61) ~[?:?]
        at de.bluecolored.bluemap.common.config.BlueMapConfigs.loadCoreConfig(BlueMapConfigs.java:122) ~[?:?]
        at de.bluecolored.bluemap.common.config.BlueMapConfigs.<init>(BlueMapConfigs.java:44) ~[?:?]
        at de.bluecolored.bluemap.common.config.BlueMapConfigs.<init>(BlueMapConfigs.java:37) ~[?:?]
        at de.bluecolored.bluemap.common.plugin.Plugin.load(Plugin.java:113) ~[?:?]
        ... 7 more

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions