LuckPerms

LuckPerms

41.4k Downloads

Missing user data for WorldGuard permission check via Vault

LucidAPs opened this issue ยท 11 comments

commented

MC : 1.15.2
LP : build 116
User data is not cached.
https://pastebin.com/raw/TNQfjDSH

commented

Please read the warning next time:

The operation to load user data for 'cee3152c-3879-39c0-b8ee-8b2f7eb5fafc' was cancelled by LuckPerms. This is NOT a bug.
The lookup request was made on the main server thread. It is not safe to execute a request to
load data for offline players from the database in this context.
If you are a plugin author, please consider making your request asynchronously.
Alternatively, server admins can disable this catch by setting 'vault-unsafe-lookups' to true
in the LP config, but should consider the consequences (lag) before doing so.

commented

Yea i read it so what? I should enable vault-unsafe-lookups and enjoy the lag is that what you are saying?

commented

It's your choice. LP does this for a reason.

commented

Kinda yes.
There is nothing on LPs end other than this, to "fix" this, as it isn't a bug, nor a issue on our end.
Also the "lag" should be fairly minimal or even non-existant.
The warning is not saying, that lag will for sure be the result.

I recall that the dev of WorldGuard has been already made aware of this but refused(?) to change how WorldGuard is handling stuff.

commented

Related issue: #1651

commented

Yeah Wiz told me it's your guys fault, i won't lie the whole thing with developers just throwing the ball to others is getting hilarious and annoying.

commented

Like mentioned in the linked issue is there not much that LP can do about it.
It already does everything it can and this is just a warning that a different plugin (and not LP) attempts to check permissions of a player (or the player itself I assume) on the main synchronous server-thread which depending on how much it is, can cause a lot of lag, so LP denies this request by default by throwing a "fake" exception.
Since Wiz still doesn't get it (it seems) is the enabling of unsafe lookups the only good option here.

commented

I didn't say it's anyone's fault. I also "get it". Seems luck did too last time, despite the rest of you guys telling me I'm doing things wrong.
WG can't just let people bypass protection by e.g. setting off tnt and then immediately logging out while it blows up. That'd be a bit dumb don't you think? Short of a proper log that can tell us what's going on here, looks to me like WG is acting just fine.

commented

Since the change made as a result of #1651, LP now clears user data after a delay of 1 minute, so checks made via Vault in that time should proceed as normal.

Using wiz's TNT example: players should be able to set off TNT & then log out - assuming it explodes within 1 minute, WorldGuard should still be able to run permission checks on the player that detonated it without a problem.

Following along in the stack trace above, seems like:

  • a connected (online) player has hit an entity
  • entity has died
  • entity death event is picked up by WorldGuard
  • WorldGuard calls an "onSpawnEntity" event - not sure if this is the Bukkit one or something internal
  • WorldGuard checks for bypass permissions on ... not sure - maybe the entity?

cee3152c-3879-39c0-b8ee-8b2f7eb5fafc doesn't seem to be a valid player UUID, unless you're running in offline mode?

Not sure what else to say - could be a bug in the way LP is clearing user data (perhaps the system to ensure data is kept loaded for at least 1 minute is broken?), or it could be a WorldGuard issue - although there's nothing glaringly obvious to me that it could be.

Need more info to go any further.

commented

Essentially what's happening on the WG side is Player(Connection) attacks and kills entity, entitydeathevent (bukkit) fires, WG fires internal SpawnEntityEvent on an XP orb, which triggers a check for the xp-drops flag. that flag check checks if the cause of the event (includes player -> entity dying) have perms. perms are only checked for players, so either the attacking entity of the dying entity corresponds to that uuid (as we mentioned, would need more of a log to see which - especially since as you said that's an offline uuid. possibly an npc is in the mix here?)

commented

Makes sense, thanks for the explaination.

There's a special case in LP for NPCs:

https://github.com/lucko/LuckPerms/blob/0d89fc9d28aa95939c83023f44288d1dba49417d/bukkit/src/main/java/me/lucko/luckperms/bukkit/vault/LuckPermsVaultPermission.java#L150-L163

Which works for Citizens NPCs at least (see #1470 (comment)) - but might not cover everything - so definitely a possibility.