Problems with /banall
jopasma7 opened this issue · 30 comments
Hi,
I write this message because I have several problems with the /banall It does not give me any error on the console, but when I enter the server and I put /banall nick it appears that I banned it correctly, it even appears in the database, but when I give it to unbanall it appears that user is not banned. I also get the same error with IP.
I do not understand why this happens.
¿Can help me?
I have already managed to set the exact time on the server and in the database.
Should everything work properly now?
Restart the server and look at the logs. If you no longer see the "The time on your server and MySQL database are out" message, then yes, it should work correctly.
However, you will need to ensure something like NTP is setup, as the clocks will go out of sync again.
You may need to reset lastChecked
to 0 within schedules.yml for all externalX options, e.g. externalPlayerBans
I have restarted and the time error no longer appears.
I put in Schedules this:
scheduler:
expiresCheck: 30
playerBans: 30
playerMutes: 30
playerWarnings: 30
ipBans: 30
ipRangeBans: 30
externalPlayerBans: 120
externalPlayerMutes: 120
externalPlayerNotes: 120
externalIpBans: 120
saveLastChecked: 60
lastChecked:
externalPlayerNotes: 0
playerMutes: 1478702790
ipRangeBans: 1478702790
expiresCheck: 1478702790
externalPlayerMutes: 0
playerBans: 1478702790
externalPlayerBans: 0
externalIpBans: 0
playerWarnings: 1478702790
ipBans: 1478702790
it is right?
Other than the formatting (which I assume is from copy/paste), yes, that looks correct. Have your bans now synced?
I will try, I wait 2 min for unbanall for that "schedules" right?
wait 2 min then and I write you
Now it seems to work correctly. Sometimes it takes a little more or a little less than the 2 minutes set but it seems to work for now great.
I'll check if it bans on all the servers in the bunguecoord and if something goes wrong I'll let you know immediately.
Really, thank you very much.
:)
Glad to hear. I'm going to close this issue, but feel free to still comment on it.
The default syncing time for global bans/mutes is 2 minutes. If that's too long, adjust your externalPlayerBans
externalIpBans
and so on within schedules.yml.
The reason why /unbanall says that they're not banned, is most likely because you're trying it before it has been synced with the local ban tables.
It behaves in this way, to prevent accidental global unbans.
I have waited for more than 1 day and I still can not unban with the /unbanall and in the database if it appears that it is banned, but i can't unbanall with the command.
I also just changed what you told me, but it still does not work. I put it in 1 second to try, but nothing.
I do not know why this happens.
Only appears "That player is not banned"
Check your local bans table for that server. If they're not in there, it won't allow you to execute /unbanall. As I said, this is to prevent accidental global unbans.
Do you see any warnings when BM starts up, specifically about a time difference between the server and database?
Note: Changes to schedules.yml requires the plugin to be reloaded (/bmreload won't be affected by it). I'll raise a bug about that.
Yes, When I ban a player, he immediately appears in the database of "player bm_player_ban_all"
Also, it is assumed that when you ban someone global, the server expels it, right?
On my server when I give / banall the player does not expel it, do you know the reason? Maybe I'm doing something wrong.
Yes, I restart the server for the change in the file schedules
/banall does not expel them immediately.
Were they any warnings on startup? If the clocks are out of sync, you will experience syncing issues.
You'll see something like:
The time on your server and MySQL database are out by 12 seconds, this may cause syncing issues.
For reference if anyone else would like clarification on how the global option works:
Global Database:
/banall
Inserts the ban into bm_player_ban_all.
This table is checked periodically (as defined in schedules.yml) by all servers that have the global database option enabled.
When a server sees a new ban within bm_player_ban_all, which it does not have in it's local table (e.g. bm_player_bans), it will at that point expel the user if they're online, and create the ban locally, as if a player had executed /(temp)ban
.
/unbanall
Checks if the player is currently banned locally, if not, will not allow unbanning. This is to prevent accidentally unbanning the wrong player, which would then sync to all servers.
Inserts the unban into bm_player_unban_all.
This table is checked periodically (as defined in schedules.yml) by all servers that have the global database option enabled.
When a server sees a new unban within bm_player_ban_all, it checks to see if the player is banned locally. If they are, the current local ban is removed, and migrated into bm_player_ban_records.
This behaviour may seem odd compared to other plugins, but it's done by design. This is loosely similar to how using the same local database syncing works as well. This allows creating additional applications (mobile, web etc) which can manage bans (create, update, delete...), by only accessing the database itself. For other plugins to achieve this, they often need an API/integration on the Minecraft server itself.
But, it is usually updated when you restart the server, right? or max 1 - 2 days
I've been more than 1 day with 4 tests of 4 nicks in banall and still will not let me give them / unbanall
You're using a cache so that when the MySQL goes down, you can still keep the banneds out ?
On another note: it seems your pMA can't use its control user (judging from the message on the bottom), and I don't see why you'd want that.
Yes, it will be updated when the server is restart. However, if the clock on the servers and database are out of sync, it will cause issues. I've asked this question a few times now, are there any warnings when the server starts up, from BanManager?
Do you have SSH access to the minecraft servers, and the server where your database is hosted?
^ SSH or whatever ways you have to command the computer. Obviously not used on Window$ most of times.
@rautamiekka Yes, it's all cached in memory. The scenario of the database going down is just one of the reasons.
Based on the ip address in the screenshot, the database is hosted over at OVH, so I am assuming they have SSH access. This problem looks like a classic NTP not setup problem, which does output a warning on startup, but @BlackLottus hasn't confirmed whether that message appears or not yet.
If there is a time issue, a message will appear at server startup when BanManager is enabled. Can you please paste the output of all [BanManager] log messages on startup?
E.g. [BANMANAGER][INFO] Loading 10 player bans into memory
Are there any [WARN]
logs?
[15:44:28] [Server thread/INFO]: [BanManager] Enabling BanManager v5.12.0
[15:44:28] [Server thread/WARN]: 259 [Server thread] INFO me.confuser.banmanager.internal.hikari.HikariDataSource - bm-local - Started.
[15:44:28] [Server thread/WARN]: [AutoSaveWorld] Plugin BanManager attempted to establish connection socket://178.32.216.151:3306 in main server thread
[15:44:29] [Server thread/WARN]: 722 [Server thread] INFO me.confuser.banmanager.internal.hikari.pool.PoolBase - bm-local - Driver does not support get/set network timeout for connections. (com.mysql.jdbc.JDBC4Connection.getNetworkTimeout()I)
[15:44:29] [Server thread/INFO]: [BanManager] Loaded 279 bans into memory
[15:44:29] [Server thread/INFO]: [BanManager] Loaded 9 mutes into memory
[15:44:29] [Server thread/INFO]: [BanManager] Loaded 242 ip bans into memory
[15:44:29] [Server thread/INFO]: [BanManager] Loaded 0 ip mutes into memory
[15:44:29] [Server thread/INFO]: [BanManager] Loaded 0 ip range bans into memory
[15:44:29] [Thread-21/INFO]: UUID of player TheBrahianGaymer is 9e09fcce-2c63-3c4f-a3b2-c83c35b48f59
[15:44:29] [Server thread/WARN]: 1180 [Server thread] INFO me.confuser.banmanager.internal.hikari.HikariDataSource - bm-global - Started.
[15:44:29] [Server thread/WARN]: [AutoSaveWorld] Plugin BanManager attempted to establish connection socket://178.32.216.151:3306 in main server thread
[15:44:29] [Server thread/WARN]: 1200 [Server thread] INFO me.confuser.banmanager.internal.hikari.pool.PoolBase - bm-global - Driver does not support get/set network timeout for connections. (com.mysql.jdbc.JDBC4Connection.getNetworkTimeout()I)
[15:44:29] [Server thread/ERROR]: [BanManager] The time on your server and MySQL database are out by 424 seconds, this may cause syncing issues.
[15:44:29] [Server thread/ERROR]: [BanManager] The time on your server and MySQL database are out by 424 seconds, this may cause syncing issues.
There is your problem ^
You need to setup something called NTP on all your servers, including the server that runs your database.
What operating system are you using?
Wherever you are running the Minecraft Multiplayer Server, and the MySQL database