Skip to content

Detect plugin loader errors while disabling Bukkit plugins - #212

Merged
pavog merged 1 commit into
masterfrom
paper-plugin-loader-lifecycle-exception
Nov 16, 2026
Merged

pavog merged 1 commit into
masterfrom
paper-plugin-loader-lifecycle-exception

Conversation

@pavog

@pavog pavog commented Nov 16, 2026

Copy link
Copy Markdown
Member
[16:57:16 INFO]: [BrokenHandlerList] Disabling BrokenHandlerList v1.0
[16:57:16 ERROR]: Error occurred (in the plugin loader) while unregistering events for BrokenHandlerList v1.0 (Is it up to date?)
java.lang.IllegalStateException: BrokenEvent handlers cannot be unregistered
	at p14-broken-handler-list.jar//com.repro.BrokenHandlerListPlugin$BrokenEvent$1.unregister(BrokenHandlerListPlugin.java:16) ~[?:?]
	at org.bukkit.event.HandlerList.unregisterAll(HandlerList.java:78) ~[paper-api-26.3.build.248-stable.jar:?]

When the plugin loader fails to clean up after a plugin while disabling it, Paper logs Error occurred (in the plugin loader) while <step> for <plugin> (Is it up to date?).
Nothing was detected for these lines before, because PluginDisablingProblem only matched Error occurred while disabling.
This PR adds patterns to PluginDisablingProblem for all nine cleanup steps that Paper logs this way: disabling, cancelling tasks, global tasks and async tasks, unregistering services, events, lifecycle event handlers and plugin channels, and removing chunk tickets.

All of these steps run while the plugin is being disabled, so they are reported as the existing "could not be disabled" problem with the same solutions instead of a new problem per step.
The nine steps are listed literally in PluginDisablingProblem::PLUGIN_LOADER_STEPS, one pattern each, so the while enabling line is not reported as a disabling problem.

The log comes from a Paper 26.3 test server with a plugin whose custom HandlerList throws in unregister(Plugin).
A throwing PluginEnableEvent or PluginDisableEvent listener does not cause these lines: Paper catches it and logs Could not pass event, which PluginRuntimeProblem already detects.

Changes

  • add patterns for plugin loader cleanup errors to PluginDisablingProblem
  • add a class docblock and pattern examples to PluginDisablingProblem
  • add test log paper-plugin-loader-unregistering-events-26-3.log

@pavog
pavog merged commit 68d39e5 into master Nov 16, 2026
3 checks passed
@pavog
pavog deleted the paper-plugin-loader-lifecycle-exception branch November 16, 2026 16:09
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