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

PluginRemapper is invasive to plugins! Can cause plugins to work improperly #10676

Closed
RegotlyLong opened this issue May 9, 2024 · 11 comments
Closed
Labels
resolution: awaiting response Additional information is required from the issue reporter type: bug Something doesn't work as it was intended to. version: 1.20.6 Game version 1.20.6

Comments

@RegotlyLong
Copy link

Expected behavior

I wish PluginRemapper could be switched off in paper-global.yml or somewhere else, because in version 1.20.6 I found a lot of plugins being switched off due to problems caused by Remapper!

Observed/Actual behavior

[ModernPluginLoadingStrategy] Could not load plugin 'PlaceholderAPI.jar' in folder 'plugins.paper-remapped'
org.bukkit.plugin.InvalidPluginException: java.lang.ExceptionInInitializerError
at io.papermc.paper.plugin.provider.type.spigot.SpigotPluginProvider.createInstance(SpigotPluginProvider.java:127) ~[paper-1.20.6.jar:git-Paper-53]
at io.papermc.paper.plugin.provider.type.spigot.SpigotPluginProvider.createInstance(SpigotPluginProvider.java:35) ~[paper-1.20.6.jar:git-Paper-53]
at io.papermc.paper.plugin.entrypoint.strategy.modern.ModernPluginLoadingStrategy.loadProviders(ModernPluginLoadingStrategy.java:116) ~[paper-1.20.6.jar:git-Paper-53]
at io.papermc.paper.plugin.storage.SimpleProviderStorage.enter(SimpleProviderStorage.java:38) ~[paper-1.20.6.jar:git-Paper-53]
at io.papermc.paper.plugin.entrypoint.LaunchEntryPointHandler.enter(LaunchEntryPointHandler.java:36) ~[paper-1.20.6.jar:git-Paper-53]
at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:508) ~[paper-1.20.6.jar:git-Paper-53]
at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:287) ~[paper-1.20.6.jar:git-Paper-53]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1140) ~[paper-1.20.6.jar:git-Paper-53]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:326) ~[paper-1.20.6.jar:git-Paper-53]
at java.base/java.lang.Thread.run(Thread.java:1583) ~[?:?]
Caused by: java.lang.ExceptionInInitializerError
at java.base/java.lang.Class.forName0(Native Method) ~[?:?]
at java.base/java.lang.Class.forName(Class.java:534) ~[?:?]
at java.base/java.lang.Class.forName(Class.java:513) ~[?:?]
at org.bukkit.plugin.java.PluginClassLoader.(PluginClassLoader.java:78) ~[paper-api-1.20.6-R0.1-SNAPSHOT.jar:?]
at io.papermc.paper.plugin.provider.type.spigot.SpigotPluginProvider.createInstance(SpigotPluginProvider.java:123) ~[paper-1.20.6.jar:git-Paper-53]
... 9 more
Caused by: java.lang.ArrayIndexOutOfBoundsException: Index 3 out of bounds for length 3
at PlaceholderAPI-2.11.3.jar/me.clip.placeholderapi.PlaceholderAPIPlugin.(PlaceholderAPIPlugin.java:58) ~[PlaceholderAPI-2.11.3.jar:?]
at java.base/java.lang.Class.forName0(Native Method) ~[?:?]
at java.base/java.lang.Class.forName(Class.java:534) ~[?:?]
at java.base/java.lang.Class.forName(Class.java:513) ~[?:?]
at org.bukkit.plugin.java.PluginClassLoader.(PluginClassLoader.java:78) ~[paper-api-1.20.6-R0.1-SNAPSHOT.jar:?]
at io.papermc.paper.plugin.provider.type.spigot.SpigotPluginProvider.createInstance(SpigotPluginProvider.java:123) ~[paper-1.20.6.jar:git-Paper-53]
... 9 more
[13:55:40 ERROR]: [ModernPluginLoadingStrategy] Could not load plugin 'LoaderLib.jar' in folder 'plugins.paper-remapped'
org.bukkit.plugin.InvalidPluginException: Cannot find main class `me.loader.Loader'
at org.bukkit.plugin.java.PluginClassLoader.(PluginClassLoader.java:80) ~[paper-api-1.20.6-R0.1-SNAPSHOT.jar:?]
at io.papermc.paper.plugin.provider.type.spigot.SpigotPluginProvider.createInstance(SpigotPluginProvider.java:123) ~[paper-1.20.6.jar:git-Paper-53]
at io.papermc.paper.plugin.provider.type.spigot.SpigotPluginProvider.createInstance(SpigotPluginProvider.java:35) ~[paper-1.20.6.jar:git-Paper-53]
at io.papermc.paper.plugin.entrypoint.strategy.modern.ModernPluginLoadingStrategy.loadProviders(ModernPluginLoadingStrategy.java:116) ~[paper-1.20.6.jar:git-Paper-53]
at io.papermc.paper.plugin.storage.SimpleProviderStorage.enter(SimpleProviderStorage.java:38) ~[paper-1.20.6.jar:git-Paper-53]
at io.papermc.paper.plugin.entrypoint.LaunchEntryPointHandler.enter(LaunchEntryPointHandler.java:36) ~[paper-1.20.6.jar:git-Paper-53]
at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:508) ~[paper-1.20.6.jar:git-Paper-53]
at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:287) ~[paper-1.20.6.jar:git-Paper-53]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1140) ~[paper-1.20.6.jar:git-Paper-53]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:326) ~[paper-1.20.6.jar:git-Paper-53]
at java.base/java.lang.Thread.run(Thread.java:1583) ~[?:?]
Caused by: java.lang.ClassNotFoundException: me.loader.Loader
at org.bukkit.plugin.java.PluginClassLoader.loadClass0(PluginClassLoader.java:197) ~[paper-api-1.20.6-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.java.PluginClassLoader.loadClass(PluginClassLoader.java:164) ~[paper-api-1.20.6-R0.1-SNAPSHOT.jar:?]
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526) ~[?:?]
at java.base/java.lang.Class.forName0(Native Method) ~[?:?]
at java.base/java.lang.Class.forName(Class.java:534) ~[?:?]
at java.base/java.lang.Class.forName(Class.java:513) ~[?:?]
at org.bukkit.plugin.java.PluginClassLoader.(PluginClassLoader.java:78) ~[paper-api-1.20.6-R0.1-SNAPSHOT.jar:?]
... 10 more

Steps/models to reproduce

none

Plugin and Datapack List

none

Paper version

: This server is running Paper version git-Paper-53 (MC: 1.20.6) (Implementing API version 1.20.6-R0.1-SNAPSHOT) (Git: 5729b29)
Error obtaining version information

Other

none

@RegotlyLong RegotlyLong added status: needs triage type: bug Something doesn't work as it was intended to. labels May 9, 2024
@papermc-sniffer papermc-sniffer bot added the version: 1.20.6 Game version 1.20.6 label May 9, 2024
@Machine-Maker
Copy link
Member

Plugin & Datapack List
none

I find that really hard to believe seeing as the error provided is because of plugin loading.

@RegotlyLong
Copy link
Author

Plugin & Datapack List
none

I find that really hard to believe seeing as the error provided is because of plugin loading.

[13:55:40 ERROR]: [ModernPluginLoadingStrategy] Could not load plugin 'LoaderLib.jar' in folder 'plugins.paper-remapped'
org.bukkit.plugin.InvalidPluginException: Cannot find main class `me.loader.Loader'
at org.bukkit.plugin.java.PluginClassLoader.(PluginClassLoader.java:80) ~[paper-api-1.20.6-R0.1-SNAPSHOT.jar:?]
at io.papermc.paper.plugin.provider.type.spigot.SpigotPluginProvider.createInstance(SpigotPluginProvider.java:123) ~[paper-1.20.6.jar:git-Paper-53]
at io.papermc.paper.plugin.provider.type.spigot.SpigotPluginProvider.createInstance(SpigotPluginProvider.java:35) ~[paper-1.20.6.jar:git-Paper-53]
at io.papermc.paper.plugin.entrypoint.strategy.modern.ModernPluginLoadingStrategy.loadProviders(ModernPluginLoadingStrategy.java:116) ~[paper-1.20.6.jar:git-Paper-53]
at io.papermc.paper.plugin.storage.SimpleProviderStorage.enter(SimpleProviderStorage.java:38) ~[paper-1.20.6.jar:git-Paper-53]
at io.papermc.paper.plugin.entrypoint.LaunchEntryPointHandler.enter(LaunchEntryPointHandler.java:36) ~[paper-1.20.6.jar:git-Paper-53]
at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:508) ~[paper-1.20.6.jar:git-Paper-53]
at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:287) ~[paper-1.20.6.jar:git-Paper-53]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1140) ~[paper-1.20.6.jar:git-Paper-53]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:326) ~[paper-1.20.6.jar:git-Paper-53]
at java.base/java.lang.Thread.run(Thread.java:1583) ~[?:?]
Caused by: java.lang.ClassNotFoundException: me.loader.Loader
at org.bukkit.plugin.java.PluginClassLoader.loadClass0(PluginClassLoader.java:197) ~[paper-api-1.20.6-R0.1-SNAPSHOT.jar:?]
at org.bukkit.plugin.java.PluginClassLoader.loadClass(PluginClassLoader.java:164) ~[paper-api-1.20.6-R0.1-SNAPSHOT.jar:?]
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526) ~[?:?]
at java.base/java.lang.Class.forName0(Native Method) ~[?:?]
at java.base/java.lang.Class.forName(Class.java:534) ~[?:?]
at java.base/java.lang.Class.forName(Class.java:513) ~[?:?]
at org.bukkit.plugin.java.PluginClassLoader.(PluginClassLoader.java:78) ~[paper-api-1.20.6-R0.1-SNAPSHOT.jar:?]
... 10 more

@RegotlyLong
Copy link
Author

Plugin & Datapack List
none

I find that really hard to believe seeing as the error provided is because of plugin loading.

There are some plug-ins that will lead to a lack of class files after being remapper, this problem will be very serious, not only will lead to the MD5 file has been modified, but also may make the plug-in author think that you may be in the magic of his plug-ins, and some plug-ins are not allowed to be remapper, be removed will be less class files.

@electronicboy
Copy link
Member

You can disable plugin remapping by adding -Dpaper.disable-plugin-rewriting=true to your JVM args, however, this will break any plugins which are using internals which haven't been adopted specifically for paper

if the remapper is breaking stuff, then we'd generally like to be able to have the means to reproduce and investigate this stuff

@lynxplay
Copy link
Contributor

lynxplay commented May 9, 2024

Please provide a minimal replication plugin for your issue ^
We cannot debug failures of unknown plugins.

@lynxplay lynxplay added resolution: awaiting response Additional information is required from the issue reporter and removed status: needs triage labels May 9, 2024
@RegotlyLong
Copy link
Author

Please provide a minimal replication plugin for your issue ^ We cannot debug failures of unknown plugins.
How can I send it to you?

@lynxplay
Copy link
Contributor

lynxplay commented May 9, 2024

Presumably have the plugin be open source (e.g. here on github) or provide the jar as is.

@Malfrador
Copy link
Member

Malfrador commented May 9, 2024

PlaceholderAPI is parsing the Craftbukkit package to determine the Minecraft version. However, Craftbukkit package relocation has been removed in recent versions of Paper, so this no longer works. This has been anounced quite a while ago so there was sufficient time to prepare for this change.
PlaceholderAPI has already updated to support this. You currently need to use the dev builds, which you can download here. Using the dev build, PAPI loads fine on latest Paper 1.20.6

I am unable to find "LoaderLib" anywhere online, only a Fabric mod of the same name. We would need that plugin to reproduce the issue. If you don't want to post it publicly, you can also send it privately on the Paper Discord using /modmail.

@RegotlyLong
Copy link
Author

The problem arises when plugins are obfuscated, and it is possible that an obfuscated plugin may not be remapper, which is why it causes noclassfound

@RegotlyLong
Copy link
Author

If possible, it is recommended that the paper's config can be added to turn off the remapper by default.

@kennytv
Copy link
Member

kennytv commented May 10, 2024

If a plugin wishes to not be remapped (and actually runs on a Mojang mapped server!), it can mark itself as such https://docs.papermc.io/paper/dev/userdev#1205

@kennytv kennytv closed this as not planned Won't fix, can't repro, duplicate, stale May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
resolution: awaiting response Additional information is required from the issue reporter type: bug Something doesn't work as it was intended to. version: 1.20.6 Game version 1.20.6
Projects
Status: Done
Development

No branches or pull requests

6 participants