Paper icon indicating copy to clipboard operation
Paper copied to clipboard

Config files are reset every startup

Open krankydonkey opened this issue 6 months ago • 2 comments

Expected behavior

Changes made to the paper-config and paper-world-default files (when paper is stopped) persist once paper starts up. This is on a self-hosted server.

Observed/Actual behavior

As part of its starting process, the paper server seems to overwrite these files with the default files.

Steps/models to reproduce

I have observed this behavior in two separate deployments.

  1. On a ubuntu 24 server, having downloaded the paper-1.21.4.jar file and running it with the base command java -Xms4G -Xmx4G -jar paper.jar --nogui

The first time this is run all files will generate per normal. Then the server down and edit the paper-defaults.yml. When the server is started again with the same command, the changes to the paper-defaults are wiped.

  1. Within a docker container from itzg/docker-minecraft-server (see the discussion there https://github.com/itzg/docker-minecraft-server/issues/3461 ). Same deal, when changes are made and the container is restarted the changes disappear.

Plugin and Datapack List

bStats, spark

Paper version

1.21.3, 1.21.4, 1.21.5

Other

No response

krankydonkey avatar May 23 '25 07:05 krankydonkey

Additionally, it will even overwrite the files if nothing has been changed. If i make the config files read-only with chmod i get the following error on startup

[00:23:38 WARN]: [Configurations] Could not save config/paper-global.yml: Paper could not persist the full set of configuration settings in the configuration file. Any setting missing from the configuration file will be set with its default value in memory. Admins should make sure to review the configuration documentation at https://docs.papermc.io/paper/configuration for more details. org.spongepowered.configurate.ConfigurateException: []: java.nio.file.AccessDeniedException: /data/config/.674620409881305588455paper-global.yml.tmp at org.spongepowered.configurate.loader.AbstractConfigurationLoader.save(AbstractConfigurationLoader.java:211) ~[configurate-core-4.2.0-20250225.064233-204.jar:?] at io.papermc.paper.configuration.Configurations.trySaveFileNode(Configurations.java:112) ~[paper-1.21.4.jar:1.21.4-231-09e9afd] at io.papermc.paper.configuration.Configurations.initializeGlobalConfiguration(Configurations.java:137) ~[paper-1.21.4.jar:1.21.4-231-09e9afd] at io.papermc.paper.configuration.Configurations.initializeGlobalConfiguration(Configurations.java:107) ~[paper-1.21.4.jar:1.21.4-231-09e9afd] at io.papermc.paper.configuration.PaperConfigurations.initializeGlobalConfiguration(PaperConfigurations.java:215) ~[paper-1.21.4.jar:1.21.4-231-09e9afd] at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:212) ~[paper-1.21.4.jar:1.21.4-231-09e9afd] at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1163) ~[paper-1.21.4.jar:1.21.4-231-09e9afd] at net.minecraft.server.MinecraftServer.lambda$spin$2(MinecraftServer.java:310) ~[paper-1.21.4.jar:1.21.4-231-09e9afd] at java.base/java.lang.Thread.run(Unknown Source) ~[?:?] Caused by: java.nio.file.AccessDeniedException: /data/config/.674620409881305588455paper-global.yml.tmp at java.base/sun.nio.fs.UnixException.translateToIOException(Unknown Source) ~[?:?] at java.base/sun.nio.fs.UnixException.rethrowAsIOException(Unknown Source) ~[?:?] at java.base/sun.nio.fs.UnixException.rethrowAsIOException(Unknown Source) ~[?:?] at java.base/sun.nio.fs.UnixFileSystemProvider.newByteChannel(Unknown Source) ~[?:?] at java.base/java.nio.file.spi.FileSystemProvider.newOutputStream(Unknown Source) ~[?:?] at java.base/java.nio.file.Files.newOutputStream(Unknown Source) ~[?:?] at java.base/java.nio.file.Files.newBufferedWriter(Unknown Source) ~[?:?] at org.spongepowered.configurate.loader.AtomicFiles.atomicBufferedWriter(AtomicFiles.java:89) ~[configurate-core-4.2.0-20250225.064233-204.jar:?] at org.spongepowered.configurate.loader.AtomicFiles.lambda$atomicWriterFactory$0(AtomicFiles.java:58) ~[configurate-core-4.2.0-20250225.064233-204.jar:?] at org.spongepowered.configurate.loader.AbstractConfigurationLoader.save(AbstractConfigurationLoader.java:194) ~[configurate-core-4.2.0-20250225.064233-204.jar:?] ... 8 more

krankydonkey avatar May 23 '25 07:05 krankydonkey

configuration files are loaded and their passed through a transformer to deal with populating missing things and applying transformations to the files, we don't know if any such transformations or additions have occurred and so, we just save the file back, as it's generally of 0 concern.

Losing stuff is something we've had one or two reports of, but, we've yet to be able to reproduce this, I'd guess, can you provide a configuration file with the tweaks you're wanting to make?

electronicboy avatar May 23 '25 07:05 electronicboy