New 'backups to keep' entry not generated for existing configs
sovdeeth opened this issue ยท 0 comments
Skript/Server Version
[20:16:30 INFO]: [Skript] Skript's aliases can be found here: https://github.com/SkriptLang/skript-aliases
[20:16:30 INFO]: [Skript] Skript's documentation can be found here: https://docs.skriptlang.org/
[20:16:30 INFO]: [Skript] Skript's tutorials can be found here: https://docs.skriptlang.org/tutorials
[20:16:30 INFO]: [Skript] Server Version: 1.20.6-148-20f5165 (MC: 1.20.6)
[20:16:30 INFO]: [Skript] Skript Version: 2.9.4-nightly-f48fa4d63 (skriptlang-nightly)
[20:16:30 INFO]: [Skript] Installed Skript Addons:
[20:16:30 INFO]: [Skript] - skript-reflect v2.5.1 (https://github.com/SkriptLang/skript-reflect)
[20:16:30 INFO]: [Skript] Installed dependencies: None
Bug Description
backups to keep entry is not generated for old configs, leading to a NPE during variable loading and the failure of skript to load variables or parse scripts on startup.
Expected Behavior
At minimum, skript should start normally, using a default value of -1 for the entry if it's missing (this was done for the 2.10.0 beta)
Ideally, the entry should be created for every database entry that's missing them. This has to be done carefully to avoid changing any of the user's database settings.
Steps to Reproduce
start a feature build of skript on a server with a config that includes a database without the backups to keep entry.
Errors or Screenshots
[20:15:59 INFO]: [Skript] Loading variables...
[20:15:59 ERROR]: #!#!
[20:15:59 ERROR]: #!#! ===!!!=== Skript variable load error ===!!!===
[20:15:59 ERROR]: #!#! Unable to load (all) variables:
[20:15:59 ERROR]: #!#! The config is missing the entry for 'backups to keep' in the database 'CSV'
[20:15:59 ERROR]: #!#!
[20:15:59 ERROR]: #!#! Skript will work properly, but old variables might not be available at all and new ones may or may not be saved until Skript is able to create a backup of the old file and/or is able to connect to the database (which requires a restart of Skript)!
[20:15:59 ERROR]: #!#!
[20:15:59 WARN]: [Skript] Task #3 for Skript v2.9.4-nightly-f48fa4d63 generated an exception
java.lang.NullPointerException: Cannot invoke "java.lang.Integer.intValue()" because the return value of "ch.njol.skript.variables.VariablesStorage.getValue(ch.njol.skript.config.SectionNode, String, java.lang.Class)" is null
at Skript-nightly.jar/ch.njol.skript.variables.VariablesStorage.load(VariablesStorage.java:228) ~[Skript-nightly.jar:?]
at Skript-nightly.jar/ch.njol.skript.variables.Variables.load(Variables.java:265) ~[Skript-nightly.jar:?]
at Skript-nightly.jar/ch.njol.skript.Skript$1.run(Skript.java:657) ~[Skript-nightly.jar:?]
at org.bukkit.craftbukkit.scheduler.CraftTask.run(CraftTask.java:101) ~[paper-1.20.6.jar:1.20.6-148-20f5165]
at org.bukkit.craftbukkit.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:482) ~[paper-1.20.6.jar:1.20.6-148-20f5165]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1147) ~[paper-1.20.6.jar:1.20.6-148-20f5165]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:323) ~[paper-1.20.6.jar:1.20.6-148-20f5165]
at java.base/java.lang.Thread.run(Thread.java:1583) ~[?:?]
Other
No response
Agreement
- I have read the guidelines above and affirm I am following them with this report.