LuckPerms

LuckPerms

41.4k Downloads

Error when using default assignments

Rindula opened this issue ยท 8 comments

commented

The Problem

When setting any kind of default assignment in the config an reloading the config (or restarting the server) the player gets kicked with the message
[LP] A database error occurred whilst loading permissions data. Please try again later.
When removing/commenting out the Part in config, everything works fine.

Errorlog in Console

[17:07:06 ERROR]: [LuckPerms] Exception occurred whilst loading data for <PLAYERUID CENSORED> - Rindula
[17:07:06 WARN]: java.lang.NullPointerException: script engine
[17:07:06 WARN]: 	at me.lucko.luckperms.common.defaultassignments.AssignmentExpression.eval(AssignmentExpression.java:62)
[17:07:06 WARN]: 	at me.lucko.luckperms.common.defaultassignments.AssignmentRule.apply(AssignmentRule.java:85)
[17:07:06 WARN]: 	at me.lucko.luckperms.common.plugin.util.AbstractConnectionListener.loadUser(AbstractConnectionListener.java:110)
[17:07:06 WARN]: 	at me.lucko.luckperms.bukkit.listeners.BukkitConnectionListener.onPlayerPreLogin(BukkitConnectionListener.java:108)
[17:07:06 WARN]: 	at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor1.execute(Unknown Source)
[17:07:06 WARN]: 	at org.bukkit.plugin.EventExecutor.lambda$create$1(EventExecutor.java:69)
[17:07:06 WARN]: 	at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:76)
[17:07:06 WARN]: 	at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70)
[17:07:06 WARN]: 	at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:536)
[17:07:06 WARN]: 	at net.minecraft.server.v1_14_R1.LoginListener$LoginHandler.fireEvents(LoginListener.java:337)
[17:07:06 WARN]: 	at net.minecraft.server.v1_14_R1.LoginListener$2.run(LoginListener.java:246)
[17:07:06 WARN]: 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[17:07:06 WARN]: 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[17:07:06 WARN]: 	at java.lang.Thread.run(Thread.java:748)
[17:07:06 INFO]: Disconnecting com.mojang.authlib.GameProfile@7b021d76[id=<PLAYERUID CENSORED>,name=Rindula,properties={textures=[com.mojang.authlib.properties.Property@4daca9a]},legacy=false] (/46.5.0.242:2614): [LP] A database error occurred whilst loading permissions data. Please try again later.
[17:07:06 INFO]: com.mojang.authlib.GameProfile@7b021d76[id=<PLAYERUID CENSORED>,name=Rindula,properties={textures=[com.mojang.authlib.properties.Property@4daca9a]},legacy=false] (/46.5.0.242:2614) lost connection: [LP] A database error occurred whilst loading permissions data. Please try again later.

Config part of the default assignments as in use

default-assignments:
#  rule1:
#    if:
#      has-true: (<group.vip> | <group.vip+>) & <titles.tilecollector>
#      has-false: <some.random.permission>
#      lacks: <prison/group.prison_titlepack>
#    give:
#      - prison/group.prison_titlepack
#    take:
#      - some.random.permission
  rule2:
    if:
      lacks: <group.level0> & <group.level1> & <group.level2> & <group.level3> & <group.level4> & <group.level5> & <group.level6> & <group.level7> & <group.level8> & <group.level9> & <group.level10>
    give:
      - group.level0
#  rule3:
#    if:
#      has-true: <group.default>
#    take:
#      - group.default
#    give:
#      - group.member
#    set-primary-group: member

And no, removing the parts that are commented out does not work.

commented

Maybe as an additional information; I'm running Minecraft Paper Server version 97 (1.14.2) which is at the time beeing the most current version.

Edit: Luckperms is running in the version v4.4.26

commented

Why are you checking if the user lacks group.level0 AND group.level1 AND group.level2 AND ....you get the point by now.
Why not just check for if user lacks group.level0? do you replace it?

Also another question: Do you actually have the roles created? LP can't set a role that doesn't exist.

# WARNING: Unlike internal commands, this system does not ensure that a group exists before adding
# a user to it. It also does not unsure that a user is a member of a group before making that group
# their primary group.
#
# Before you use "give: group.<name>" or "set-primary-group", make sure that the group exists, and
# that the user is a member of the group.

And a final note: UUIDs aren't anything private. Everyone can get them through sites like namemc.com and they can't harm the user in any way.

commented

I copied the idea from example rule2. (But even the existing examples don't work.) I want to check if the User is in any of these level groups and if not put him into level0. Of course all the groups are persistent.

commented

Why are you checking if the user lacks group.level0 AND group.level1 AND group.level2 AND ....you get the point by now.
Why not just check for if user lacks group.level0? do you replace it?

These groups are on a track and a user should only have one level in general. So he has level2 but none of the others for example, because even a higher level might have to lack permissions from lower ones.

What do you mean with "replace it"?

commented

Your Java installation seems to be missing the Nashorn runtime library, which is needed for default assignments.

I'm not really sure why that is.

Which Java version are you using? How did you install the JRE on your system? Perhaps try reinstalling it?

commented

Also sorry for the delay in replying!

commented

Which Java version are you using? How did you install the JRE on your system? Perhaps try reinstalling it?

Well, my Server is setup in a Docker environment. I use a presetup Java-Docker (see here) which uses the alpine-java Image (see here).

I'm using the latest tag, which might not have Nashorn included, since it has it's own tag for it.

Edit: I change it now and come back to you when I tried it.

commented

Okay, using a Java installation with Nashorn works fine.

Thanks for your help!