XF Bot Guard

XF Bot Guard 1.4.1

No permission to download
I haven’t checked the database yet. But wanted to ask, when choosing the light DB, what happens to already filled tables in DB?

Nothing happens to them. They stay filled, but stop being filled from that point onward. I provided earlier some truncate commands you could use to empty them, if you want. The tables still need to be present, but can be emptied safely, when running in Light-DB mode.
 
OK done that. Only have 2 warnings now...

Screenshot 2026-06-29 021825.webp

I assume top warning is ok and last warning will disappear in time ?
 
With those two features off, light-db on, and more proactive survival mode settings, hopefully it won't get to crisis mode even at 80k bots. Although, again no context of before, while it had slowed, it was not to the point of "this website is down" slow. So that's something, IMO. Anyway, bring on the next wave!

For now, I would just reduce Origin pressure minimum active time (seconds) to 120 and Origin survival mode Retry-After seconds to 60.

They are the defaults for those two. Basically its entering survival mode far earlier - probably not a bad thing as it allows good bots and known members access. But the durations we changed are a bit lengthy. I would just shorten them and enjoy the relative stability for a while.
It's been a pretty uneventful day for bot traffic ever since these tweaks were made. Thanks again!
 
It's been a pretty uneventful day for bot traffic ever since these tweaks were made. Thanks again!

That's fantastic to hear! I am rolling out better defaults for origin survival in the next release, along with more tweaks to improve feature performance. Glad it's already getting the job done, though!

p.s., for anyone who enjoys Bot Guard but has not yet had the moment to review - reviews help build trust so other admins can believe in Bot Guard and protect their forum from bots. So please, consider adding your review/rating here (https://xenforo.com/community/resources/xf-bot-guard.10508/) - just under the download button.

Thank you!
 
Nothing happens to them. They stay filled, but stop being filled from that point onward. I provided earlier some truncate commands you could use to empty them, if you want. The tables still need to be present, but can be emptied safely, when running in Light-DB mode.

Thanks, where I can see those commands please to empty those tables ?
 
Thanks, where I can see those commands please to empty those tables ?

Here you go :)

For those enabling Light-DB on existing installations - you may wish to safely truncate the following tables to immediately reclaim data storage used by normal DB mode that are not populated in Light-DB mode.

SQL:
TRUNCATE TABLE xf_zee_botguard_event_reason;
TRUNCATE TABLE xf_zee_botguard_event_detail;
TRUNCATE TABLE xf_zee_botguard_event;
TRUNCATE TABLE xf_zee_botguard_counter;
TRUNCATE TABLE xf_zee_botguard_fp_ip;
TRUNCATE TABLE xf_zee_botguard_ip;
TRUNCATE TABLE xf_zee_botguard_session;
TRUNCATE TABLE xf_zee_botguard_visitor;
 
Running latest version for about a day now. Weird things are happening. First, the dashboard shows all kinds of stats in the overview but the Country Pressure map still wasn't showing.

Now, even the stats are all 0 (zero):
1782734001551.webp

Health check, all okay with a few warnings:
Light-DB runtime mode -> enabled
Light-DB public telemetry suppression -> Enabled
Reverse DNS hosting scoring -> 23 recent resolver errors / 0 stale pending


CF health check all okay with one warning:
Raw IP storage -> Enabled

@zeeb0t Any idea what is wrong ?
 
Running latest version for about a day now. Weird things are happening. First, the dashboard shows all kinds of stats in the overview but the Country Pressure map still wasn't showing.

Now, even the stats are all 0 (zero):
View attachment 340730

Health check, all okay with a few warnings:
Light-DB runtime mode -> enabled
Light-DB public telemetry suppression -> Enabled
Reverse DNS hosting scoring -> 23 recent resolver errors / 0 stale pending


CF health check all okay with one warning:
Raw IP storage -> Enabled

@zeeb0t Any idea what is wrong ?

Currently, the dashboard shows little to no useful data in light-db mode. The next release will introduce some useful telemetry data there. However, it will still be little compared to full db mode.
 
Got a new error logged today:

Code:
XF\Db\DeadlockException: XF Bot Guard cleanup (self_server_ip) failed: MySQL query error [1213]: Deadlock found when trying to get lock; try restarting transaction src/XF/Db/AbstractStatement.php:225

Generated by: Unknown account Jul 1, 2026 at 1:07 PM


Stack trace

DELETE FROM xf_zee_botguard_self_server_ip WHERE allow_until <= ? ORDER BY allow_until LIMIT 1000
------------

#0 src/XF/Db/Mysqli/Statement.php(207): XF\Db\AbstractStatement->getException('MySQL query err...', 1213, '40001')
#1 src/XF/Db/Mysqli/Statement.php(83): XF\Db\Mysqli\Statement->getException('MySQL query err...', 1213, '40001')
#2 src/XF/Db/AbstractAdapter.php(96): XF\Db\Mysqli\Statement->execute()
#3 src/addons/Zee/BotGuard/Repository/BotGuard/Cleanup.php(942): XF\Db\AbstractAdapter->query('DELETE FROM xf_...', Array)
#4 src/addons/Zee/BotGuard/Repository/BotGuard/Cleanup.php(916): Zee\BotGuard\Repository\BotGuard\Cleanup->runBatchedDelete('DELETE FROM xf_...', Array, 1000, 50000, 1.78293E+9, 5, 'self_server_ip')
#5 src/addons/Zee/BotGuard/Repository/BotGuard.php(93): Zee\BotGuard\Repository\BotGuard\Cleanup->runBatchedCleanupDelete('DELETE FROM xf_...', Array, 1000, 50000, 1.78293E+9, 5, 'self_server_ip')
#6 src/addons/Zee/BotGuard/Service/SelfServerIpResolver.php(370): Zee\BotGuard\Repository\BotGuard->runBatchedCleanupDelete('DELETE FROM xf_...', Array, 1000, 50000, 1.78293E+9, 5, 'self_server_ip')
#7 src/addons/Zee/BotGuard/Service/SelfServerIpResolver.php(122): Zee\BotGuard\Service\SelfServerIpResolver->pruneExpired(1782932871)
#8 src/addons/Zee/BotGuard/Service/SelfServerIpResolver.php(72): Zee\BotGuard\Service\SelfServerIpResolver->refresh(1782932871)
#9 src/addons/Zee/BotGuard/Service/RequestRuntimeCache.php(42): Zee\BotGuard\Service\SelfServerIpResolver->Zee\BotGuard\Service\{closure}()
#10 src/addons/Zee/BotGuard/Service/SelfServerIpResolver.php(55): Zee\BotGuard\Service\RequestRuntimeCache::remember('self_server_ip....', 'acd7388ec46fe2f...', Object(Closure))
#11 src/addons/Zee/BotGuard/Service/ProtectionPolicy.php(177): Zee\BotGuard\Service\SelfServerIpResolver->matchesIncomingIp('45.41.132.239')
#12 src/addons/Zee/BotGuard/Service/ProtectionPolicy.php(129): Zee\BotGuard\Service\ProtectionPolicy->computeIsExcluded(Array)
#13 src/addons/Zee/BotGuard/Service/RequestRuntimeCache.php(42): Zee\BotGuard\Service\ProtectionPolicy->Zee\BotGuard\Service\{closure}()
#14 src/addons/Zee/BotGuard/Service/ProtectionPolicy.php(606): Zee\BotGuard\Service\RequestRuntimeCache::remember('protection_poli...', '7098a0be918ddde...', Object(Closure))
#15 src/addons/Zee/BotGuard/Service/ProtectionPolicy.php(112): Zee\BotGuard\Service\ProtectionPolicy->memoizedPolicyFact('is_excluded', Array, Array, Object(Closure))
#16 src/addons/Zee/BotGuard/Service/ProtectionPolicy.php(538): Zee\BotGuard\Service\ProtectionPolicy->isExcluded(Array)
#17 src/addons/Zee/BotGuard/Service/ProtectionPolicy.php(519): Zee\BotGuard\Service\ProtectionPolicy->computeShouldApplyCacheShield(Array)
#18 src/addons/Zee/BotGuard/Service/RequestRuntimeCache.php(42): Zee\BotGuard\Service\ProtectionPolicy->Zee\BotGuard\Service\{closure}()
#19 src/addons/Zee/BotGuard/Service/ProtectionPolicy.php(606): Zee\BotGuard\Service\RequestRuntimeCache::remember('protection_poli...', 'e161bdf470023e2...', Object(Closure))
#20 src/addons/Zee/BotGuard/Service/ProtectionPolicy.php(471): Zee\BotGuard\Service\ProtectionPolicy->memoizedPolicyFact('should_apply_ca...', Array, Array, Object(Closure))
#21 src/addons/Zee/BotGuard/Listener.php(172): Zee\BotGuard\Service\ProtectionPolicy->shouldApplyCacheShield(Array)
#22 src/XF/Extension.php(86): Zee\BotGuard\Listener::dispatcherPreDispatch(Object(XF\Mvc\Dispatcher), Object(XF\Mvc\RouteMatch))
#23 src/XF/App.php(3366): XF\Extension->fire('dispatcher_pre_...', Array, NULL)
#24 src/XF/Mvc/Dispatcher.php(96): XF\App->fire('dispatcher_pre_...', Array)
#25 src/XF/Mvc/Dispatcher.php(57): XF\Mvc\Dispatcher->beforeDispatch(Object(XF\Mvc\RouteMatch))
#26 src/XF/App.php(2824): XF\Mvc\Dispatcher->run()
#27 src/XF.php(814): XF\App->run()
#28 index.php(23): XF::runApp('XF\\Pub\\App')
#29 {main}

Request state

array(4) {
  ["url"] => string(116) "/threads/jabbas-survivor-round-2-immunity-is-the-key.2696521/members/salacious_crummy.298774/link-forums/faqs.10874/"
  ["referrer"] => bool(false)
  ["_GET"] => array(1) {
    ["/threads/jabbas-survivor-round-2-immunity-is-the-key_2696521/members/salacious_crummy_298774/link-forums/faqs_10874/"] => string(0) ""
  }
  ["_POST"] => array(0) {
  }
}

We're also currently seeing the number of bots hovering between 15-25k. This is the first time I've seen it above 3k since making those tweaks a few days ago.
 
Got a new error logged today:

Code:
XF\Db\DeadlockException: XF Bot Guard cleanup (self_server_ip) failed: MySQL query error [1213]: Deadlock found when trying to get lock; try restarting transaction src/XF/Db/AbstractStatement.php:225

Generated by: Unknown account Jul 1, 2026 at 1:07 PM


Stack trace

DELETE FROM xf_zee_botguard_self_server_ip WHERE allow_until <= ? ORDER BY allow_until LIMIT 1000
------------

#0 src/XF/Db/Mysqli/Statement.php(207): XF\Db\AbstractStatement->getException('MySQL query err...', 1213, '40001')
#1 src/XF/Db/Mysqli/Statement.php(83): XF\Db\Mysqli\Statement->getException('MySQL query err...', 1213, '40001')
#2 src/XF/Db/AbstractAdapter.php(96): XF\Db\Mysqli\Statement->execute()
#3 src/addons/Zee/BotGuard/Repository/BotGuard/Cleanup.php(942): XF\Db\AbstractAdapter->query('DELETE FROM xf_...', Array)
#4 src/addons/Zee/BotGuard/Repository/BotGuard/Cleanup.php(916): Zee\BotGuard\Repository\BotGuard\Cleanup->runBatchedDelete('DELETE FROM xf_...', Array, 1000, 50000, 1.78293E+9, 5, 'self_server_ip')
#5 src/addons/Zee/BotGuard/Repository/BotGuard.php(93): Zee\BotGuard\Repository\BotGuard\Cleanup->runBatchedCleanupDelete('DELETE FROM xf_...', Array, 1000, 50000, 1.78293E+9, 5, 'self_server_ip')
#6 src/addons/Zee/BotGuard/Service/SelfServerIpResolver.php(370): Zee\BotGuard\Repository\BotGuard->runBatchedCleanupDelete('DELETE FROM xf_...', Array, 1000, 50000, 1.78293E+9, 5, 'self_server_ip')
#7 src/addons/Zee/BotGuard/Service/SelfServerIpResolver.php(122): Zee\BotGuard\Service\SelfServerIpResolver->pruneExpired(1782932871)
#8 src/addons/Zee/BotGuard/Service/SelfServerIpResolver.php(72): Zee\BotGuard\Service\SelfServerIpResolver->refresh(1782932871)
#9 src/addons/Zee/BotGuard/Service/RequestRuntimeCache.php(42): Zee\BotGuard\Service\SelfServerIpResolver->Zee\BotGuard\Service\{closure}()
#10 src/addons/Zee/BotGuard/Service/SelfServerIpResolver.php(55): Zee\BotGuard\Service\RequestRuntimeCache::remember('self_server_ip....', 'acd7388ec46fe2f...', Object(Closure))
#11 src/addons/Zee/BotGuard/Service/ProtectionPolicy.php(177): Zee\BotGuard\Service\SelfServerIpResolver->matchesIncomingIp('45.41.132.239')
#12 src/addons/Zee/BotGuard/Service/ProtectionPolicy.php(129): Zee\BotGuard\Service\ProtectionPolicy->computeIsExcluded(Array)
#13 src/addons/Zee/BotGuard/Service/RequestRuntimeCache.php(42): Zee\BotGuard\Service\ProtectionPolicy->Zee\BotGuard\Service\{closure}()
#14 src/addons/Zee/BotGuard/Service/ProtectionPolicy.php(606): Zee\BotGuard\Service\RequestRuntimeCache::remember('protection_poli...', '7098a0be918ddde...', Object(Closure))
#15 src/addons/Zee/BotGuard/Service/ProtectionPolicy.php(112): Zee\BotGuard\Service\ProtectionPolicy->memoizedPolicyFact('is_excluded', Array, Array, Object(Closure))
#16 src/addons/Zee/BotGuard/Service/ProtectionPolicy.php(538): Zee\BotGuard\Service\ProtectionPolicy->isExcluded(Array)
#17 src/addons/Zee/BotGuard/Service/ProtectionPolicy.php(519): Zee\BotGuard\Service\ProtectionPolicy->computeShouldApplyCacheShield(Array)
#18 src/addons/Zee/BotGuard/Service/RequestRuntimeCache.php(42): Zee\BotGuard\Service\ProtectionPolicy->Zee\BotGuard\Service\{closure}()
#19 src/addons/Zee/BotGuard/Service/ProtectionPolicy.php(606): Zee\BotGuard\Service\RequestRuntimeCache::remember('protection_poli...', 'e161bdf470023e2...', Object(Closure))
#20 src/addons/Zee/BotGuard/Service/ProtectionPolicy.php(471): Zee\BotGuard\Service\ProtectionPolicy->memoizedPolicyFact('should_apply_ca...', Array, Array, Object(Closure))
#21 src/addons/Zee/BotGuard/Listener.php(172): Zee\BotGuard\Service\ProtectionPolicy->shouldApplyCacheShield(Array)
#22 src/XF/Extension.php(86): Zee\BotGuard\Listener::dispatcherPreDispatch(Object(XF\Mvc\Dispatcher), Object(XF\Mvc\RouteMatch))
#23 src/XF/App.php(3366): XF\Extension->fire('dispatcher_pre_...', Array, NULL)
#24 src/XF/Mvc/Dispatcher.php(96): XF\App->fire('dispatcher_pre_...', Array)
#25 src/XF/Mvc/Dispatcher.php(57): XF\Mvc\Dispatcher->beforeDispatch(Object(XF\Mvc\RouteMatch))
#26 src/XF/App.php(2824): XF\Mvc\Dispatcher->run()
#27 src/XF.php(814): XF\App->run()
#28 index.php(23): XF::runApp('XF\\Pub\\App')
#29 {main}

Request state

array(4) {
  ["url"] => string(116) "/threads/jabbas-survivor-round-2-immunity-is-the-key.2696521/members/salacious_crummy.298774/link-forums/faqs.10874/"
  ["referrer"] => bool(false)
  ["_GET"] => array(1) {
    ["/threads/jabbas-survivor-round-2-immunity-is-the-key_2696521/members/salacious_crummy_298774/link-forums/faqs_10874/"] => string(0) ""
  }
  ["_POST"] => array(0) {
  }
}

We're also currently seeing the number of bots hovering between 15-25k. This is the first time I've seen it above 3k since making those tweaks a few days ago.

Thanks for the error report. Did it show up the once, or is this routine?
 
Back
Top Bottom