Exiting world does not release file handle to zipped datapack / resourcepack
open Minecraft
open a world that contains a zipped datapack in its datapacks directory
after world is loaded, save & exit back to title screen
in windows file explorer, navigate to datapacks directory and try to delete the .zip file of the datapack
EXPECTED:
file can be deleted
ACTUAL:
file cannot be deleted because it is still in use by java process (Minecraft sitting at title screen)
NOTES:
you can work around it by closing Minecraft, or by opening a different world (at which point MC seems to 'flush' its datapacks)
Ideally, Minecraft should only be using the file during load/reload - once loading is complete, it should release the file handle. (for non-zip files, like functions in a datapack, you can delete each while the world is loaded)
Failed to delete world World java.nio.file.FileSystemException: ###\saves\World\datapacks\my-datapack.zip: The process cannot access the file because it is being used by another process. at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:86) at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97) at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:102) at sun.nio.fs.WindowsFileSystemProvider.implDelete(WindowsFileSystemProvider.java:269) at sun.nio.fs.AbstractFileSystemProvider.delete(AbstractFileSystemProvider.java:103) at java.nio.file.Files.delete(Files.java:1126) at czj$a$1.a(SourceFile:285) at czj$a$1.visitFile(SourceFile:280) at java.nio.file.Files.walkFileTree(Files.java:2670) at java.nio.file.Files.walkFileTree(Files.java:2742) at czj$a.f(SourceFile:280) at dsw$a.a(SourceFile:334) at dsw$a$$Lambda$4354/456574378.accept(Unknown Source) at dok.b(SourceFile:43) at dok$$Lambda$4355/1901085596.onPress(Unknown Source) at dmc.as_(SourceFile:20) at dlw.a(SourceFile:16) at dma.a(SourceFile:150) at dmz.a(SourceFile:27) at dks.b(SourceFile:86) at dks$$Lambda$2375/1247247257.run(Unknown Source) at dpj.a(SourceFile:416) at dks.a(SourceFile:86) at dks.c(SourceFile:150) at dks$$Lambda$2374/599726537.run(Unknown Source) at alp.execute(SourceFile:94) at dks.b(SourceFile:150) at dks$$Lambda$1747/1735688275.invoke(Unknown Source) at org.lwjgl.glfw.GLFWMouseButtonCallbackI.callback(GLFWMouseButtonCallbackI.java:36) at org.lwjgl.system.JNI.invokeV(Native Method) at org.lwjgl.glfw.GLFW.glfwPollEvents(GLFW.java:3101) at com.mojang.blaze3d.systems.RenderSystem.flipFrame(SourceFile:105) at dft.e(SourceFile:301) at dkr.e(SourceFile:1027) at dkr.d(SourceFile:630) at net.minecraft.client.main.Main.main(SourceFile:204)
Linked Issues
is duplicated by3
Created Issue:
exiting world does not release file handle to zipped datapack
open Minecraft
open a world that contains a zipped datapack in its datapacks directory
after world is loaded, save & exit back to title screen
in windows file explorer, navigate to datapacks directory and try to delete the .zip file of the datapackEXPECTED:
file can be deletedACTUAL:
file cannot be deleted because it is still in use by java process (Minecraft sitting at title screen)you can work around it by closing Minecraft, or by opening a different world (at which point MC seems to 'flush' its datapacks)
open Minecraft
open a world that contains a zipped datapack in its datapacks directory
after world is loaded, save & exit back to title screen
in windows file explorer, navigate to datapacks directory and try to delete the .zip file of the datapackEXPECTED:
file can be deletedACTUAL:
file cannot be deleted because it is still in use by java process (Minecraft sitting at title screen)
you can work around it by closing Minecraft, or by opening a different world (at which point MC seems to 'flush' its datapacks)open Minecraft
open a world that contains a zipped datapack in its datapacks directory
after world is loaded, save & exit back to title screen
in windows file explorer, navigate to datapacks directory and try to delete the .zip file of the datapackEXPECTED:
file can be deletedACTUAL:
file cannot be deleted because it is still in use by java process (Minecraft sitting at title screen)NOTES:
you can work around it by closing Minecraft, or by opening a different world (at which point MC seems to 'flush' its datapacks)Ideally, Minecraft should only be using the file during load/reload - once loading is complete, it should release the file handle. (for non-zip files, like functions in a datapack, you can delete each while the world is loaded)
exiting world does not release file handle to zipped datapackExiting world does not release file handle to zipped datapack
is duplicated by
relates to
open Minecraft
open a world that contains a zipped datapack in its datapacks directory
after world is loaded, save & exit back to title screen
in windows file explorer, navigate to datapacks directory and try to delete the .zip file of the datapackEXPECTED:
file can be deletedACTUAL:
file cannot be deleted because it is still in use by java process (Minecraft sitting at title screen)NOTES:
you can work around it by closing Minecraft, or by opening a different world (at which point MC seems to 'flush' its datapacks)Ideally, Minecraft should only be using the file during load/reload - once loading is complete, it should release the file handle. (for non-zip files, like functions in a datapack, you can delete each while the world is loaded)
Error 20w17aFailed to delete world Test2 java.nio.file.FileSystemException: ###\saves\World\datapacks\my-datapack.zip: The process cannot access the file because it is being used by another process. at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:86) at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97) at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:102) at sun.nio.fs.WindowsFileSystemProvider.implDelete(WindowsFileSystemProvider.java:269) at sun.nio.fs.AbstractFileSystemProvider.delete(AbstractFileSystemProvider.java:103) at java.nio.file.Files.delete(Files.java:1126) at czj$a$1.a(SourceFile:285) at czj$a$1.visitFile(SourceFile:280) at java.nio.file.Files.walkFileTree(Files.java:2670) at java.nio.file.Files.walkFileTree(Files.java:2742) at czj$a.f(SourceFile:280) at dsw$a.a(SourceFile:334) at dsw$a$$Lambda$4354/456574378.accept(Unknown Source) at dok.b(SourceFile:43) at dok$$Lambda$4355/1901085596.onPress(Unknown Source) at dmc.as_(SourceFile:20) at dlw.a(SourceFile:16) at dma.a(SourceFile:150) at dmz.a(SourceFile:27) at dks.b(SourceFile:86) at dks$$Lambda$2375/1247247257.run(Unknown Source) at dpj.a(SourceFile:416) at dks.a(SourceFile:86) at dks.c(SourceFile:150) at dks$$Lambda$2374/599726537.run(Unknown Source) at alp.execute(SourceFile:94) at dks.b(SourceFile:150) at dks$$Lambda$1747/1735688275.invoke(Unknown Source) at org.lwjgl.glfw.GLFWMouseButtonCallbackI.callback(GLFWMouseButtonCallbackI.java:36) at org.lwjgl.system.JNI.invokeV(Native Method) at org.lwjgl.glfw.GLFW.glfwPollEvents(GLFW.java:3101) at com.mojang.blaze3d.systems.RenderSystem.flipFrame(SourceFile:105) at dft.e(SourceFile:301) at dkr.e(SourceFile:1027) at dkr.d(SourceFile:630) at net.minecraft.client.main.Main.main(SourceFile:204)
open Minecraft
open a world that contains a zipped datapack in its datapacks directory
after world is loaded, save & exit back to title screen
in windows file explorer, navigate to datapacks directory and try to delete the .zip file of the datapackEXPECTED:
file can be deletedACTUAL:
file cannot be deleted because it is still in use by java process (Minecraft sitting at title screen)NOTES:
you can work around it by closing Minecraft, or by opening a different world (at which point MC seems to 'flush' its datapacks)Ideally, Minecraft should only be using the file during load/reload - once loading is complete, it should release the file handle. (for non-zip files, like functions in a datapack, you can delete each while the world is loaded)
Error 20w17aFailed to delete worldTest2java.nio.file.FileSystemException: ###\saves\World\datapacks\my-datapack.zip: The process cannot access the file because it is being used by another process. at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:86) at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97) at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:102) at sun.nio.fs.WindowsFileSystemProvider.implDelete(WindowsFileSystemProvider.java:269) at sun.nio.fs.AbstractFileSystemProvider.delete(AbstractFileSystemProvider.java:103) at java.nio.file.Files.delete(Files.java:1126) at czj$a$1.a(SourceFile:285) at czj$a$1.visitFile(SourceFile:280) at java.nio.file.Files.walkFileTree(Files.java:2670) at java.nio.file.Files.walkFileTree(Files.java:2742) at czj$a.f(SourceFile:280) at dsw$a.a(SourceFile:334) at dsw$a$$Lambda$4354/456574378.accept(Unknown Source) at dok.b(SourceFile:43) at dok$$Lambda$4355/1901085596.onPress(Unknown Source) at dmc.as_(SourceFile:20) at dlw.a(SourceFile:16) at dma.a(SourceFile:150) at dmz.a(SourceFile:27) at dks.b(SourceFile:86) at dks$$Lambda$2375/1247247257.run(Unknown Source) at dpj.a(SourceFile:416) at dks.a(SourceFile:86) at dks.c(SourceFile:150) at dks$$Lambda$2374/599726537.run(Unknown Source) at alp.execute(SourceFile:94) at dks.b(SourceFile:150) at dks$$Lambda$1747/1735688275.invoke(Unknown Source) at org.lwjgl.glfw.GLFWMouseButtonCallbackI.callback(GLFWMouseButtonCallbackI.java:36) at org.lwjgl.system.JNI.invokeV(Native Method) at org.lwjgl.glfw.GLFW.glfwPollEvents(GLFW.java:3101) at com.mojang.blaze3d.systems.RenderSystem.flipFrame(SourceFile:105) at dft.e(SourceFile:301) at dkr.e(SourceFile:1027) at dkr.d(SourceFile:630) at net.minecraft.client.main.Main.main(SourceFile:204)open Minecraft
open a world that contains a zipped datapack in its datapacks directory
after world is loaded, save & exit back to title screen
in windows file explorer, navigate to datapacks directory and try to delete the .zip file of the datapackEXPECTED:
file can be deletedACTUAL:
file cannot be deleted because it is still in use by java process (Minecraft sitting at title screen)NOTES:
you can work around it by closing Minecraft, or by opening a different world (at which point MC seems to 'flush' its datapacks)Ideally, Minecraft should only be using the file during load/reload - once loading is complete, it should release the file handle. (for non-zip files, like functions in a datapack, you can delete each while the world is loaded)
Error 20w17aFailed to delete world World java.nio.file.FileSystemException: ###\saves\World\datapacks\my-datapack.zip: The process cannot access the file because it is being used by another process. at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:86) at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97) at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:102) at sun.nio.fs.WindowsFileSystemProvider.implDelete(WindowsFileSystemProvider.java:269) at sun.nio.fs.AbstractFileSystemProvider.delete(AbstractFileSystemProvider.java:103) at java.nio.file.Files.delete(Files.java:1126) at czj$a$1.a(SourceFile:285) at czj$a$1.visitFile(SourceFile:280) at java.nio.file.Files.walkFileTree(Files.java:2670) at java.nio.file.Files.walkFileTree(Files.java:2742) at czj$a.f(SourceFile:280) at dsw$a.a(SourceFile:334) at dsw$a$$Lambda$4354/456574378.accept(Unknown Source) at dok.b(SourceFile:43) at dok$$Lambda$4355/1901085596.onPress(Unknown Source) at dmc.as_(SourceFile:20) at dlw.a(SourceFile:16) at dma.a(SourceFile:150) at dmz.a(SourceFile:27) at dks.b(SourceFile:86) at dks$$Lambda$2375/1247247257.run(Unknown Source) at dpj.a(SourceFile:416) at dks.a(SourceFile:86) at dks.c(SourceFile:150) at dks$$Lambda$2374/599726537.run(Unknown Source) at alp.execute(SourceFile:94) at dks.b(SourceFile:150) at dks$$Lambda$1747/1735688275.invoke(Unknown Source) at org.lwjgl.glfw.GLFWMouseButtonCallbackI.callback(GLFWMouseButtonCallbackI.java:36) at org.lwjgl.system.JNI.invokeV(Native Method) at org.lwjgl.glfw.GLFW.glfwPollEvents(GLFW.java:3101) at com.mojang.blaze3d.systems.RenderSystem.flipFrame(SourceFile:105) at dft.e(SourceFile:301) at dkr.e(SourceFile:1027) at dkr.d(SourceFile:630) at net.minecraft.client.main.Main.main(SourceFile:204)
Exiting world does not release file handle to zipped datapack / resourcepack
is duplicated by
is duplicated by
Can confirm in 1.17.1. Relaunching Minecraft or opening another world had no effect for me and I was only able to delete the world folder by navigating to it in the OS and deleting it.
As of 1.17.1 I did get an error in the log telling me where my where my problem was, although that might be because I had never loaded it before. Personally, I'd be willing to accept that using cached dimension data in place of invalid data is WAI as long as there's an in-game way to tell when you have a problem (i.e. a notif in the upper-right of the window, similarly to when a world fails to delete as per MC-124365). That said, it would probably be best to just show the validation error prompt if there's any error in the pack whatsoever, rather than allowing a partly-broken pack to be played.
Sometimes the launcher log will go completely blank, forcing me to restart Minecraft in order to see the game output again. It usually seems to happen when there are lots of messages (which there usually are, in part due to MC-124365) and I take an action such as clicking one of the checkboxes, resizing the window or dragging the scroll bar quickly. I'm not using any mods, although I am working on a data pack and therefore get various non-vanilla messages in the output.
Relates to MCL-5830.
This may be a duplicate of MC-124365, or at least highly related to it. I've assumed that when a datapack loads and runs without issue any failure to delete the world afterwards falls under that ticket (regardless of whether or not the pack was zipped), so I'd be interested to know what sort of formatting issue in the pack itself could cause the same problem.
I can only speak about zipped resource packs, but they are closed when they are garbage collected (see net.minecraft.client.resources.FileResourcePack.finalize()). I am not sure if Minecraft really caches everything from data- and resourepacks. For example at least net.minecraft.client.gui.GuiWinGame appears to load the texts only when the GUI is displayed.
It seems to be that is makes the most sense for the game to load everything at once (to avoid blocking on disk I/O during gameplay at a later point in time), but I acknowledge that there are possible space-versus-time trade-offs here.
I have a feeling that Mojang isn't closing a zip stream. For regular resource packs, you can edit the files, but not a zip stream.
Also, they should probably extract everything from the Zipped resource pack into a temp dir. It will be much more efficient
18w30b seems to be affected. I had two Datapacks enabled in the world, then went to the title screen and I could only delete one.
18w31a is affected as well.
Confirmed for 19w03c. Just ran into it again while working on a data pack.
Confirmed for 1.14.4.
Leaving a world that has an active datapack then trying to delete it, through the game menu, tries 5 times before stopping.
This appears to no longer be an issue in 1.18.2.
Also, my previous comment was incorrect- the issue I encountered in 1.17.1 (and still in 1.18.2) is separate and I'll make a new ticket for it shortly.
Actually this has been fixed in snapshot 20w27a. Unfortunately 1.17.1 can't be removed from the affected version list anymore.