Skip to content

Detect invalid YAML in Paper configuration files - #222

Merged
pavog merged 2 commits into
masterfrom
paper-configuration-parse-error
Nov 17, 2026
Merged

pavog merged 2 commits into
masterfrom
paper-configuration-parse-error

Conversation

@pavog

@pavog pavog commented Nov 17, 2026

Copy link
Copy Markdown
Member
[18:52:01 ERROR]: Encountered an unexpected exception
org.spongepowered.configurate.loader.ParsingException: []: Unknown error occurred while loading
	at io.papermc.paper.configuration.Configurations.initializeGlobalConfiguration(Configurations.java:132) ~[paper-26.3.jar:26.3-248-0727243]
Caused by: mapping values are not allowed here
 in 'reader', line 134, column 8:

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 ConfigurationParseProblem to the PaperAnalyser and to a new PaperCrashReportAnalyser, which PaperCrashReportLog now uses instead of the generic MinecraftCrashReportAnalyser.
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:

  • the file from the stack frame of Configurations.initializeGlobalConfiguration or initializeWorldDefaultsConfiguration
  • the line and column from the YAML error

When both are known, the new ConfigurationSyntaxFixSolution points to the position and the existing FileDeleteSolution is 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

  • add ConfigurationParseProblem
  • add ConfigurationSyntaxFixSolution
  • add PaperCrashReportAnalyser and use it in PaperCrashReportLog
  • add translations for both messages and the solution
  • add paper-configuration-parse-error-26-3.log and paper-crash-report-configuration-parse-error-26-3.log

Changed test expectations

  • paper-exception-in-server-tick-loop-1-20-4 now reports the invalid YAML in config/paper-global.yml at line 128, column 25, where it reported no problem before

@pavog
pavog merged commit ccce193 into master Nov 17, 2026
3 checks passed
@pavog
pavog deleted the paper-configuration-parse-error branch November 17, 2026 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant