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

Time out crashing with LuckPerms in script #952

Open
Coolkc456 opened this issue Feb 7, 2025 · 3 comments
Open

Time out crashing with LuckPerms in script #952

Coolkc456 opened this issue Feb 7, 2025 · 3 comments
Labels
bug Something isn't working

Comments

@Coolkc456
Copy link

Coolkc456 commented Feb 7, 2025

Minecraft Version

1.20.1

KubeJS Version

fabric-2001.6.5-build.16

Rhino Version

fabric-2001.2.3-build.6

Architectury Version

9.2.14-fabric

Forge/Fabric Version

Fabric 0.16.10

Describe your issue

I have a script that uses LuckPerms to check if a player has a permission and if so, runs a command. It was working for several days but it now suddenly crashes the server. I have tested it with players who do and do not have the permission and it crashed regardless.

Here is my crash log: https://mclo.gs/VuduoQ9
Here is my regular log that shows me logging in and then timing out and the server crashing: https://mclo.gs/ZHYK2gV

My script will work at first, but eventually it will begin resulting in the error I have documented in the logs. I'm not sure what triggers it to start breaking. KubeJS loads with no errors. LuckPerms works fine by itself or in command blocks. It's only when combined with KubeJS that results in issues.
https://mclo.gs/QJvsN1Z

@Coolkc456 Coolkc456 added the bug Something isn't working label Feb 7, 2025
@ChiefArug
Copy link
Contributor

This is caused by how KJS handles threading, or rather how it doesn't. All scripts in KJS lock onto a main lock and only one bit of a script can execute at a time. This can occasionally cause issues when two scripts try to execute in parallel and one of them depends on the other finishing (here specifically a chat event waiting on permissions to be grabbed from the main thread while the main thread waits for the lock to be given back from the chat event for another (probably something.tick, i cant tell though because you don't have full stack watchdog installed) handler.

A solution to this one on the KJS side will be to make the chat event execute on the main thread, or you can do that with a server tick event listening for entries to be added to a synchronous list from a chat handler.

@Coolkc456
Copy link
Author

Thank you for that insight! Does this issue happen even if it isn't using LuckPerms commands? I've found out that it's happening on these scripts as well, even though these scripts just run tellraw commands.
https://mclo.gs/JfWm3ui

@ChiefArug
Copy link
Contributor

Those scripts on their own won't be causing it, as all command stuff is run directly on the server thread. The issue is caused by two different script trying to execute at the same time on different threads.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants