Exception occurred handling message from socket
andrewkm opened this issue ยท 4 comments
Description
Occasionally, when editor is left open too long, upon hitting apply I get the following:
[20:56:03] [luckperms-worker-12/WARN]: [LuckPerms] Exception occurred handling message from socket
java.lang.IllegalStateException: Sender does not have applyedits permission
at me.lucko.luckperms.common.webeditor.socket.listener.HandlerChangeRequest.handle(HandlerChangeRequest.java:60) ~[?:?]
at me.lucko.luckperms.common.webeditor.socket.listener.WebEditorSocketListener.handleMessageFrame(WebEditorSocketListener.java:149) ~[?:?]
at me.lucko.luckperms.common.webeditor.socket.listener.WebEditorSocketListener.lambda$onMessage$0(WebEditorSocketListener.java:93) ~[?:?]
at java.util.concurrent.ForkJoinTask$RunnableExecuteAction.exec(ForkJoinTask.java:1423) ~[?:?]
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:387) ~[?:?]
at java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1312) ~[?:?]
at java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1843) ~[?:?]
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1808) ~[?:?]
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:188) ~[?:?]
Reproduction Steps
Leave editor open for a while, hit Apply.
Must re-open new editor for it to function again.
Expected Behaviour
No error.
Server Details
Paper 1.19.4 Build 489
LuckPerms Version
v5.4.71
Logs and Configs
No response
Extra Details
No response
Do you happen to have disconnected & reconnected in-game between opening the editor and trying to apply the changes? That is one of the potential causes for this issue; another being you got revoked the permission to apply editor changes before trying to do so.
I would say that that is intended behaviour, but I suspect there are other, less obvious, potential causes for that warning. I'm keeping this issue open for now and test a few things, but I do not see how it could be directly related to "just waiting around" indefinitely without reconnecting or switching servers in a network. Thank you for bringing this to our attention.
Yeah, if you log out of the server your existing editor sessions are invalidated.
The reason for this is: e.g. you have an admin go rogue, if you ban them from the server you would also expect their open editor sessions (if they had any) to no longer work, so LuckPerms checks whether they are still connected to the server, and still have the necessary permissions in LuckPerms before applying the change.
Solution is: don't logout (or use a session created from the console, they shouldn't be invalidated in this way) :)