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

New 'backups to keep' entry not generated for existing configs #7184

Open
1 task done
sovdeeth opened this issue Nov 3, 2024 · 0 comments
Open
1 task done

New 'backups to keep' entry not generated for existing configs #7184

sovdeeth opened this issue Nov 3, 2024 · 0 comments
Assignees
Labels
2.10 Targeting a 2.10.X version release bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. PR available Issues which have a yet-to-be merged PR resolving it priority: high Issues with potentially high impact that could be harmful to users.

Comments

@sovdeeth
Copy link
Member

sovdeeth commented Nov 3, 2024

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.
@sovdeeth sovdeeth added bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. priority: high Issues with potentially high impact that could be harmful to users. 2.10 Targeting a 2.10.X version release labels Nov 3, 2024
@Efnilite Efnilite self-assigned this Nov 6, 2024
@Efnilite Efnilite added the PR available Issues which have a yet-to-be merged PR resolving it label Nov 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.10 Targeting a 2.10.X version release bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. PR available Issues which have a yet-to-be merged PR resolving it priority: high Issues with potentially high impact that could be harmful to users.
Projects
None yet
Development

No branches or pull requests

2 participants