Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/q reload throws exception after deleting .cache #2511

Open
2 tasks done
Wolf2323 opened this issue Sep 12, 2023 · 1 comment
Open
2 tasks done

/q reload throws exception after deleting .cache #2511

Wolf2323 opened this issue Sep 12, 2023 · 1 comment
Assignees
Labels
Bug A bug in the code or in a documentation.

Comments

@Wolf2323
Copy link
Member

Confirm the following

  • I use the latest release or dev-build. I also checked that this problem hasn't already been fixed in a newer dev-build.
  • There are no open or closed issues that are related to my problem.

BetonQuest version information

BetonQuest version: 2.0.0-DEV-702
Server version: git-Paper-111 (MC: 1.20.1)

Hooked into: Citizens (2.0.32-SNAPSHOT (build 3198)), DecentHolograms (2.8.3), ProtocolLib (5.1.0), WorldEdit (7.3.0-SNAPSHOT+6498-ff8e505)

Expected behaviour

No Exception

Actual behaviour

Exception

Steps to reproduce

  1. Start server
  2. Delete .cache folder
  3. execute /q reload

Error, Warning, Exception or Thread Dump

java.io.IOException: The file 'plugins/BetonQuest/.cache/schedules.yml' could not be reloaded! Reason: The file 'plugins/BetonQuest/.cache/schedules.yml' could not be found! Reason: plugins/BetonQuest/.cache/schedules.yml (No such file or directory)
	at BetonQuest.jar//org.betonquest.betonquest.modules.config.ConfigAccessorImpl.reload(ConfigAccessorImpl.java:160)
	at BetonQuest.jar//org.betonquest.betonquest.modules.schedule.LastExecutionCache.reload(LastExecutionCache.java:65)
	at BetonQuest.jar//org.betonquest.betonquest.BetonQuest.reload(BetonQuest.java:1247)
	at BetonQuest.jar//org.betonquest.betonquest.commands.QuestCommand.onCommand(QuestCommand.java:305)
	at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45)
	at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:155)
	at org.bukkit.craftbukkit.v1_20_R1.CraftServer.dispatchCommand(CraftServer.java:1007)
	at org.bukkit.craftbukkit.v1_20_R1.command.BukkitCommandWrapper.run(BukkitCommandWrapper.java:64)
	at com.mojang.brigadier.CommandDispatcher.execute(CommandDispatcher.java:265)
	at net.minecraft.commands.CommandDispatcher.performCommand(CommandDispatcher.java:324)
	at net.minecraft.commands.CommandDispatcher.a(CommandDispatcher.java:308)
	at net.minecraft.server.network.PlayerConnection.a(PlayerConnection.java:2342)
	at net.minecraft.server.network.PlayerConnection.lambda$handleChatCommand$20(PlayerConnection.java:2302)
	at net.minecraft.util.thread.IAsyncTaskHandler.b(IAsyncTaskHandler.java:59)
	at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(Unknown Source)
	at net.minecraft.server.TickTask.run(TickTask.java:18)
	at net.minecraft.util.thread.IAsyncTaskHandler.d(IAsyncTaskHandler.java:153)
	at net.minecraft.util.thread.IAsyncTaskHandlerReentrant.d(IAsyncTaskHandlerReentrant.java:24)
	at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:1339)
	at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:197)
	at net.minecraft.util.thread.IAsyncTaskHandler.x(IAsyncTaskHandler.java:126)
	at net.minecraft.server.MinecraftServer.bg(MinecraftServer.java:1316)
	at net.minecraft.server.MinecraftServer.x(MinecraftServer.java:1309)
	at net.minecraft.util.thread.IAsyncTaskHandler.c(IAsyncTaskHandler.java:136)
	at net.minecraft.server.MinecraftServer.p_(MinecraftServer.java:1287)
	at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:1175)
	at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:318)
	at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.io.FileNotFoundException: The file 'plugins/BetonQuest/.cache/schedules.yml' could not be found! Reason: plugins/BetonQuest/.cache/schedules.yml (No such file or directory)
	at BetonQuest.jar//org.betonquest.betonquest.modules.config.ConfigAccessorImpl.load(ConfigAccessorImpl.java:97)
	at BetonQuest.jar//org.betonquest.betonquest.modules.config.ConfigAccessorImpl.readFromFile(ConfigAccessorImpl.java:71)
	at BetonQuest.jar//org.betonquest.betonquest.modules.config.ConfigAccessorImpl.reload(ConfigAccessorImpl.java:157)
	... 27 more

Additional information

No response

@Wolf2323 Wolf2323 added the Bug A bug in the code or in a documentation. label Sep 12, 2023
@J0B10
Copy link
Member

J0B10 commented Sep 22, 2023

Until now the exception should have been caught and logged as error.
On server restart a new cache is created so the error resolves itself.

As I don't have a test server to quickly reproduce it:

Was the stack trace stripped from an uncaught exception or an logged error?

What is expected new behaviour?

Should it create a new empty cache?

Should it log a warning?

Should the user be able to delete the cache safely only during reload or at all times?

@J0B10 J0B10 self-assigned this Sep 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in the code or in a documentation.
Projects
Status: Todo
Development

No branches or pull requests

2 participants