mojira.dev
MC-307086

Server world upgrade (FileFixerUpper) fails with "Invalid argument" on copy-on-write filesystems (btrfs, ZFS) due to copy_file_range EINVAL not being handled

Summary

When starting a Fabric (or vanilla) server for the first time on Minecraft 26.1, the world upgrade process (`FileFixerUpper`) crashes with:

AbortedFileFixException: java.nio.file.FileSystemException: ./world/filefix/cow/tmp_N: Invalid argument

This occurs on **btrfs** (Linux) and **ZFS** (FreeBSD/Linux).

Steps to Reproduce

  1. Place an existing pre-26.1 world (or a fresh world from an older version) in the server directory.

  2. Run the server on a host whose filesystem is btrfs or ZFS.

  3. The server fails immediately during world upgrade at ~2% progress.

Expected Behavior

The server upgrades the world successfully.

Actual Behavior

The server crashes with the following stack trace:

[13:02:32] [main/INFO]: Starting upgrade for world "world"
[13:02:32] [main/INFO]: Upgrading progress: 2%
[13:02:32] [main/ERROR]: Failed to write to /level.dat: java.nio.file.FileSystemException: ./world/filefix/cow/tmp_9: Invalid argument
[13:02:32] [main/ERROR]: Failed to start the minecraft server
net.minecraft.util.filefix.AbortedFileFixException: java.nio.file.FileSystemException: ./world/filefix/cow/tmp_10: Invalid argument
        at knot//net.minecraft.util.filefix.FileFixerUpper.fix(FileFixerUpper.java:95)
        at knot//net.minecraft.util.filefix.FileFixerUpper.fix(FileFixerUpper.java:80)
        at knot//net.minecraft.server.Main.main(Main.java:157)
        at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:514)
        at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:72)
        at net.fabricmc.loader.impl.launch.knot.KnotServer.main(KnotServer.java:23)
        at net.fabricmc.loader.impl.launch.server.FabricServerLauncher.main(FabricServerLauncher.java:69)
        at net.fabricmc.installer.ServerLauncher.main(ServerLauncher.java:69)
Caused by: java.nio.file.FileSystemException: ./world/filefix/cow/tmp_10: Invalid argument
        at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:100)
        at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106)
        at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
        at java.base/sun.nio.fs.UnixFileSystem.copyFile(UnixFileSystem.java:696)
        at java.base/sun.nio.fs.UnixFileSystem.copy(UnixFileSystem.java:1022)
        at java.base/sun.nio.fs.UnixFileSystemProvider.copy(UnixFileSystemProvider.java:280)
        at java.base/java.nio.file.Files.copy(Files.java:1192)
        at knot//net.minecraft.util.filefix.virtualfilesystem.FileNode.ensureCopy(FileNode.java:21)
        at knot//net.minecraft.util.filefix.virtualfilesystem.CopyOnWriteFSProvider.newChannel(CopyOnWriteFSProvider.java:104)
        at knot//net.minecraft.util.filefix.virtualfilesystem.CopyOnWriteFSProvider.newByteChannel(CopyOnWriteFSProvider.java:86)
        at java.base/java.nio.file.spi.FileSystemProvider.newOutputStream(FileSystemProvider.java:426)
        at java.base/java.nio.file.Files.newOutputStream(Files.java:215)
        at knot//net.minecraft.nbt.NbtIo.writeCompressed(NbtIo.java:70)
        at knot//net.minecraft.util.filefix.FileFixerUpper.writeUpdatedLevelData(FileFixerUpper.java:232)
        at knot//net.minecraft.util.filefix.FileFixerUpper.applyFileFixers(FileFixerUpper.java:201)
        at knot//net.minecraft.util.filefix.FileFixerUpper.applyFileFixersOnCow(FileFixerUpper.java:177)
        at knot//net.minecraft.util.filefix.FileFixerUpper.startOrContinueFileFixing(FileFixerUpper.java:129)
        at knot//net.minecraft.util.filefix.FileFixerUpper.fix(FileFixerUpper.java:93)
        ... 7 more

Environment

  • Minecraft: 26.1

  • Java: 25 (OpenJDK)

  • Affected OS/FS: Linux (btrfs), FreeBSD 15 (ZFS)

Comments 1

If you try to upgrade the world using the original version of the game without the fabric, the error message is simpler, but the reason is the same, so I think it's a Minecraft issue.

[00:17:33] [Worker-Main-20/INFO]: Starting upgrade for world "world"
[00:17:33] [Worker-Main-20/INFO]: Upgrading progress: 2%
[00:17:34] [Worker-Main-20/ERROR]: Failed to write to /level.dat: java.nio.file.FileSystemException: /home/acdd233/.var/app/org.prismlauncher.PrismLauncher/data/PrismLauncher/instances/26.1/minecraft/saves/world/filefix/cow/tmp_9: Invalid argument
[00:17:52] [Worker-Main-10/INFO]: Starting upgrade for world "world"
[00:17:52] [Worker-Main-10/INFO]: Upgrading progress: 2%
[00:17:52] [Worker-Main-10/ERROR]: Failed to write to /level.dat: java.nio.file.FileSystemException: /home/acdd233/.var/app/org.prismlauncher.PrismLauncher/data/PrismLauncher/instances/26.1/minecraft/saves/world/filefix/cow/tmp_9: Invalid argument

acdd233

(Unassigned)

Unconfirmed

(Unassigned)

26.1

Retrieved