LuckPerms

LuckPerms

41.4k Downloads

Perm sync not triggering on server within a proxy networ using "pluginmsg"

ofunny opened this issue · 10 comments

commented

Description

I have one Waterfall proxy and several paper servers connected to this proxy (LP installed on the proxy and on each server, all use the same MySQL database and tables, all use "pluginmsg" as messaging service).

If I update a permission/group for a given user on server "a" while the user is online on server "b" (or not online at all) the change logs get pushed to the proxy and than to all other servers (as I would expect it).

Example log excerpt server "a", "b" and proxy: https://pastebin.com/FytWLZTB

However: the permission/group changes will not be applied on server "b" until the user logs out/in again or somebody performs a manual sync (like "lp user ... info") on server "b". For example: if I would promote user "peter" on server "a" to a higher rank group while he is online on server "b", he will not get promoted on server "b" until he performs a logout once or until I would manually trigger the LP sync on server "b".

That behaviour also breaks some plugins like Tab (https://www.mc-market.org/resources/14009/) what are listening on the LP event for group/permission changes on each server (so in this case it will never update pre/suffixes on server "b"). Same problem with LP placeholders not getting updated on all servers in this case.

So it looks like the automated sync on each connected server on "pluginmsg" notify or the "pluginmsg" service itself is not working as expected!

Reproduction Steps

  1. Create a proxy/server setup connected via same MySql
  2. Use the LP options below for LP on each server and on the proxy

    storage-method: MySQL
    split-storage.enabled: false
    sync-minutes: -1
    watch-files: false
    messaging-service: pluginmsg
    auto-push-updates: true
    push-log-entries: true
    broadcast-received-log-entries: true
    redis.enabled: false
  3. Use a plugin listening on the LP update event like TAB or create a group with a special permission like "gamemode".
  4. Connect your player to server "a" (make sure he is not in the given group).
  5. Assign the group to the given player on server "b" .
    (Do not perform a "lp user ... info" on server "a" since it would manually trigger a sync,
    also do not log the player out and in again).
  6. Test if the player has access to the new permissions (like gamemode) on server "b" or if the event gets called.
  7. Test the same thing without a player logged in. Change a group on server "a", check if events get called on all other servers.

Expected Behaviour

I would expect the messaging service "pluginmsg" to notify the proxy about a permission/group change on sever "a" and than (the proxy) triggering a sync from the database (update). After that, I would expect that the proxy would inform (via "pluginmsg") all other servers connected about a permission/group change so all other servers also trigger a LP sync and than call the corresponding LP events. Finally plugins listening to the LP events will be triggered and can react on the permission/group update on all connected servers.

As described under:
https://luckperms.net/wiki/Network-Installation
https://luckperms.net/wiki/Syncing-data-between-servers

Server Details

Paper#397 (1.17.1)

LuckPerms Version

v5.3.87

Logs and Configs

Example log excerpt server "a", "b" and proxy: https://pastebin.com/FytWLZTB

Config options on all servers and the proxy:


storage-method: MySQL
split-storage.enabled: false
sync-minutes: -1
watch-files: false
messaging-service: pluginmsg
auto-push-updates: true
push-log-entries: true
broadcast-received-log-entries: true
redis.enabled: false

Extra Details

No response

commented

At this point I just followed the guide on https://luckperms.net/wiki/Network-Installation what is recommending me the following:
...
If you're running multiple servers which are not connected to one proxy, but use the same database set this option to sql.
If you're running a small network with one BungeeCord proxy, then you should set this option to pluginmsg.
...
Where I guess that pluginmsg advantages are, that it will only inform when a given change really has happened.
While sql just spams some database table with "are there any updates" queries?

commented

If you're using an SQL based database, it is better to use sql or auto for the messaging service.

commented

If you really are running a network with one BungeeCord (name brand bungee, not Velocity) proxy, and have players on all of the backends at all times, it should ideally work properly. However, if it doesn't, it's a good idea to try something else. Does sql cause the plugin to work?
There aren't really 'advantages' to using one or the other, in any tangible non-theoretical sense the performance should be identical unless your database ping is massive. Using sql messaging will not spam or overload any database with any queries. Try using sql.

commented

6065acc7-0033-43a2-a64f-f6ae33480e25 doesn't seem to be a valid mojang uuid?

Are you sure you have ip forwarding setup and configured correctly?

Follow the Network Install steps carefully.

commented

6065acc7-0033-43a2-a64f-f6ae33480e25 doesn't seem to be a valid mojang uuid?
Are you sure you have ip forwarding setup and configured correctly?
Follow the Network Install steps carefully.

You got that ID from my log example: "[22:50:22 INFO]: [LuckPerms] [Messaging] Sending user ping for 'ofunny' with id: 6747a4c9-d53e-48ee-b6e8-7cb5a44ed5d5"
Are you actually sure that this represents my users ID? Looks more like an ID of the actual ping that has been send.
My user ID is different to that of course and all servers (via "whois" as well as "lp user ... info") detect my correct UUID what corresponds to the one held by Mojang/Microsoft (460d353e-....-....-....-10596c2ed944) – so that should work fine!

Of course "ip_forward: true" is on within my Waterfall config as well as all servers have "bungeecord: true" activated. I use Geyser with Floodgate (Floodgate on backend servers) what would not work if that setup would be wrong at any step.

Using sql messaging will not spam or overload any database with any queries. Try using sql.

I will try "sql" as messaging service tomorrow – will this trigger the LP events even if no players are online (since the plugin TAB is listening for it to update). Will "pluginmsg" online cause an update if a player is on the given server? In my test case the player has been online but I would need the event to be triggered in any circumstance.

commented

Due to how pluginmsg works, it requires a player to be online on the server for the message to be sent/received — that is to say, if you want an update message to be broadcasted to all servers at all times, you'd need a player on each and every server. sql messaging does not suffer from this limitation.

commented

Due to how pluginmsg works, it requires a player to be online on the server for the message to be sent/received — that is to say, if you want an update message to be broadcasted to all servers at all times, you'd need a player on each and every server. sql messaging does not suffer from this limitation.

I mean in my example the player has been online and it still did not update with pluginmsg but good to know that. Today I'm going to check again if my tests haven't been affected by some cached permissions of Essentials. Because I'm not totally sure if TAB works correctly nor on what event it is listening since it does no update on logout/login just on LP commands of on the same server (sync). Just to be sure I did not report something wrong.

commented

Hello! Do you have any updates, resolutions, fixes? The issue seems to be setup-related, and it would be good to know if changing something fixed it!

commented

Sorry for the late update. It turned out that part of the problem was a missing implementation in the Tab plugin. He did not listen on all events necessary what got fixed meanwhile. Still the plugimsg service has some limitation for example if a plugin performs an automated update on a server where the affected player is not online it will not populate to the server on what the player is currently online until the player triggers a sync by rejoining or command – that's why I finally switch to sql as messaging service now.

commented

Ah right, yeah that is a known limitation of the plugin messaging channels. (not a problem that can be solved)

that's why we have the sql, redis etc types. :)