changes at mysql dont apply to the server
Closed this issue ยท 6 comments
I have a custom website setup with launcher for my network. I wrote a simple php script so users can buy ranks on the server, it calculates the accout balance and sets the luckperms db luckperms_players primary_group to whatever the bought rank is. The script changes the group name in db, but it doesnt apply to the server. Changing it myself from phpmyadmin has the same effect. I've granted my mysql user all permissions for the db, restarted the server, refreshed the plugins and tried /lp networksync. None of that changes the ingame player rank even after relogging. But it does change the db value if i change user group from console. The names are correct, i've tested it on each of the 3 group i have, including default. what could be the issue ?
using LuckPerms-Sponge-5.0.39
spongeforge-1.12.2-2838-7.1.8
phpmyadmin 5.0.1
LP caches the permission, group and userdata.
It doesn't update its cache, unless told so, which can be done in two ways:
- Setup sync-minutes in the luckperms.conf
- enable messaging-service (Won't be useful in your case)
I personally suggest to better have a plugin, that is hooked into your store-system and into the LP API to modify the groups a user has, rather than directly editing the database entries themself, as this may cause unwanted issues.
LP caches the permission, group and userdata.
It doesn't update its cache, unless told so, which can be done in two ways:
- Setup sync-minutes in the luckperms.conf
- enable messaging-service (Won't be useful in your case)
I personally suggest to better have a plugin, that is hooked into your store-system and into the LP API to modify the groups a user has, rather than directly editing the database entries themself, as this may cause unwanted issues.
I've set sync-minutes to 1, msg-service was enabled before as mysql. Did start getting pool errors, saying that i need to shorten maxlifetime, which i did downto 30 secs, still nothing. and i dont have enough knowledge to write myself a connection plugin, nore have an understanting on how to connect all of that.
What i've noticed, if set a rank on user with default group, it does as i've said. But if i rewrite it on user with admin group, it sets it in db, and after some time, resets it back to admin.
I would check the wait_timeout
setting of your database and compare it with what you have set in LP.
LP's config has the value set in milliseconds while MySQL has it in seconds, so keep that in mind.
https://github.com/lucko/LuckPerms/wiki/Storage-system-errors
I've managed to fix the wait_timeout
https://imgur.com/Cwqj5ry checked it with both just typing mysqld --verbose --help
as root and logging into mysql via terminal as the user i use for website and lp config. Both are at 28800. still no effect. Restarted, waited a min, nothing.
deleted msg: fixed the pool errors by going back to 30mins in LP config, but it doesnt help much.
I would check the
wait_timeout
setting of your database and compare it with what you have set in LP.
LP's config has the value set in milliseconds while MySQL has it in seconds, so keep that in mind.https://github.com/lucko/LuckPerms/wiki/Storage-system-errors
any other solutions sir ?