Repository navigation
Detect invalid YAML in Paper configuration files - #222
Merged
Merged
Conversation
…-parse-error # Conflicts: # lang/en.json # src/Analyser/PaperAnalyser.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a Paper configuration file is not valid YAML, the server crashes during startup.
This was not detected before, neither in the server log nor in the crash report.
This PR adds
ConfigurationParseProblemto thePaperAnalyserand to a newPaperCrashReportAnalyser, whichPaperCrashReportLognow uses instead of the genericMinecraftCrashReportAnalyser.The problem is intentionally not added to
MinecraftCrashReportAnalyser: Fabric, Forge and Vanilla crash reports use it too, and a mod with its own Configurate configuration would be reported as a broken Paper configuration.The matched line does not contain the file or the position of the error.
Both are read from the rest of the log in
setAnalysis(), because every line of a crash report is its own entry:Configurations.initializeGlobalConfigurationorinitializeWorldDefaultsConfigurationWhen both are known, the new
ConfigurationSyntaxFixSolutionpoints to the position and the existingFileDeleteSolutionis offered as a fallback.The configuration of a single world does not show its name in the stack trace, so there is a second message without the file.
Purpur and Folia crash reports still use the generic analyser and are not covered.
Changes
ConfigurationParseProblemConfigurationSyntaxFixSolutionPaperCrashReportAnalyserand use it inPaperCrashReportLogpaper-configuration-parse-error-26-3.logandpaper-crash-report-configuration-parse-error-26-3.logChanged test expectations
paper-exception-in-server-tick-loop-1-20-4now reports the invalid YAML inconfig/paper-global.ymlat line 128, column 25, where it reported no problem before