EssentialsX

EssentialsX

2M Downloads

InternalServerListPing event throwing a null exception

lululombard opened this issue ยท 20 comments

commented

EssentialsX version (/essentials): 2.0.1-b514

Server software (/version): Paper 1172 (1.12.1)

Since I updated both Paper and EssentialsX to support 1.12.1, I got this stacktrace spammed in my console on every server I own :

[StatusProcessingThread/ERROR]: Could not pass event InternalServerListPingEvent to Essentials v2.0.1-b514
org.bukkit.event.EventException: null
        at com.massivecraft.massivelag.inject.MassiveLagEventExecutor.execute(MassiveLagEventExecutor.java:79) ~[?:?]
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[patched_1.12.1.jar:git-Paper-1172]
        at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:514) ~[patched_1.12.1.jar:git-Paper-1172]
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:496) ~[patched_1.12.1.jar:git-Paper-1172]
        at protocolsupport.protocol.packet.handler.AbstractStatusListener.lambda$handleStatusRequest$1(AbstractStatusListener.java:68) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_131]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_131]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_131]
Caused by: java.lang.NullPointerException
        at com.earth2me.essentials.EssentialsServerListener.onServerListPing(EssentialsServerListener.java:43) ~[?:?]
        at sun.reflect.GeneratedMethodAccessor64.invoke(Unknown Source) ~[?:?]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_131]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_131]
        at com.massivecraft.massivelag.inject.MassiveLagEventExecutor.execute(MassiveLagEventExecutor.java:62) ~[?:?]
        ... 7 more

Everything seems to work though, but my log size is growing very fast.

commented

Could you try removing ProtocolSupport then try removing MassiveLag to see whether one of them is causing the issue?

This is a conflict between either ProtocolSupport or MassiveLag plugins that fire custom ServerListPingEvents with how EssentialsX handles Paper's altered ServerListPingEvent class - this small change in Paper means EssentialsX will have to work around it for plugins that don't support Paper's added methods.

Not entirely sure why MassiveLag would be dispatching an event that's a subclass of ServerListPingEvent, though - this isn't a good nor reliable way to get players on the server.

On ProtocolSupport's end, they can implement a getSampleText and setSampleText method on their subclass (or just remove the event) Done. On EssentialsX's end, we can implement a null check for getSampleText. Both would be ideal in case of other plugins that use (or abuse) SLPEs.

For more information on Paper 1.12's SLPE, see #1419.

Edit: corrections because I can't read

Edit 2: further explanation from #drtshock channel:

16:24:10 +md678685 | Also, the Paper SLPE methods were added to the actual API not just to a subclass within the Paper server
16:24:29 +md678685 | EssentialsServerListener just checks whether or not the method exists in the API
16:26:17 +md678685 | but the plugin that's firing its own event doesn't override it in the subclass of ServerListPingEvent so when called via reflection it presumably returns null, hence why the #iterator() on the next line causes an error

Edit 3: MassiveLag doesn't look like it's responsible for this error.

Edit 4: ProtocolSupport has fixed this on their end.

commented

Same problem at me.

commented

Both MassiveLag and ProtocolSupport causes the issue. I had to remove both to get rid of the errors.
Also, removing Essentials fixes the issue. I'll patch it to get rid of this error as I don't need vanish.

commented

@lululombard Just out of interest, could you post the errors when only MassiveLag is installed alongside EssentialsX? It looks like only ProtocolSupport is causing the error you posted. (I edited the previous comment accordingly.)

commented

For any interested parties, ProtocolSupport/ProtocolSupport#606 has been closed. ProtocolSupport's involvement in this ticket should be fixed.

commented

@lululombard Update ProtocolSupport. If the error persists, please post a new stack trace, otherwise this issue can be closed once the NPE catch in EssentialsX is done.

commented

@md678685 perfect, I still had some errors with MassiveLag, but a patch has been released for it, and now everything is fine with the latest version of Paper, EssentialsX, MassiveLag, and ProtocolSupport.

Thanks a lot !

commented

I'm still receiving this error on the latest builds.

[13:37:11 INFO]: This server is running Paper version git-Paper-1183 (MC: 1.12.1) (Implementing API version 1.12.1-R0.1-SNAPSHOT)
[13:37:45 INFO]: [Essentials] Using Paper 1.12+ ServerListPingEvent methods
[13:37:45 INFO]: Essentials reloaded 2.0.1-b516.
ProtocolSupport is b133 off their jenkins.

https://gist.github.com/NachtRaben/1327ec37e805fa20dc8d21fcb0e26b37

commented

I've submitted #1463 with a proposed fix for the issue. I'll try to upload a test build later so people can check whether the issue is fixed for them.

commented

I actually applied the patch myself and only get a single stacktrace after the server initializes but it seems to be holding well.

commented

@NachtRaben If you're referring to the changes in #1463, the single stacktrace is intentional so that people realise that there's still a broken plugin installed. You may also want to double-check that you're definitely running the latest version of ProtocolSupport or try build 131 which seems to be the first build that was fixed - ProtocolSupport has fixed this.

commented

I was running PS b133 and was still getting the stack, so I tried the patch as a last ditch effort. Unless there's another culprit in the plugins causing the issues but I couldn't think of an easy way of seeing whats creating them.

https://haste.nachtraben.com/UcaHqa7Q8Q.css
This is what the frontend currently has running on this server.

commented

@NachtRaben Could you post the actual error after you start the server? The stacktrace should indicate which plugin is causing it.

commented

latest.txt

Double checked that the NPE still happens on the latest build, then recompiled latest with the patch.
This is the log around when the first stack is printed.

https://haste.nachtraben.com/EiG6EtzWVl.md

commented

@NachtRaben I've pushed a new commit to that PR's branch that should help identify the cause of the stacktrace - could you test it when you get a chance?

commented

Sorry, I had left state, I'll pull and get some data for you.

commented

Vanilla essentials, latest paper, latest PS, etc. Still having the stack.

After the updated patch, receiving this stack:
https://hastebin.com/pinumaqaqu.vbs

The only real difference I can think of between this server and others is that it is pinged internally by a 1.8.8 server.

commented

the 5th line from the bottom seems to suggest the same thing. Note that if you are using the latest 1.12.1 server code, make sure your plugins are also up to 1.12.1. If you need a link to the Spigot Compatible Plugins, let me know.

commented

@NachtRaben ProtocolSupport's LegacyLoginAndPingHandler (shown in the stacktrace) doesn't implement Paper 1.12's methods, so this is now outside our control - the stack trace is there to highlight that an issue is present with another plugin.

Otherwise, I believe this can now be closed as the original issue appears to be resolved.

commented

Thanks for the help, i'll move this over to PS's side of things.