PHP / SQL errors raised causing Error 500

Created on 22 July 2025, about 1 month ago

Problem/Motivation

Website Error 500 raised intermittently from this particular PHP error and other SQL Cleantalk / MySql ones.

Steps to reproduce

Normal functioning of live site

  • Cleantalk 9.6.1
  • Drupal core 10.5.1
  • MySQL 8.0.42-0ubuntu0.22.04.2
  • PHP 8.3.23

Drupal log

PHP Error raised

InvalidArgumentException: ; is not supported in SQL strings. Use only one statement at a time. in Drupal\Core\Database\Connection->preprocessStatement() (line 625 of /var/www/drupal/web/core/lib/Drupal/Core/Database/Connection.php)
#0 /var/www/drupal/web/core/lib/Drupal/Core/Database/Connection.php(581): Drupal\Core\Database\Connection->preprocessStatement('INSERT INTO cle...', Array)
#1 /var/www/drupal/web/core/lib/Drupal/Core/Database/Connection.php(848): Drupal\Core\Database\Connection->prepareStatement('INSERT INTO cle...', Array)
#2 /var/www/drupal/web/modules/contrib/cleantalk/lib/Cleantalk/Custom/Db/Db.php(51): Drupal\Core\Database\Connection->query('INSERT INTO cle...')
#3 /var/www/drupal/web/modules/contrib/cleantalk/lib/Cleantalk/Common/Firewall/Modules/AntiCrawler.php(128): Cleantalk\Custom\Db\Db->execute('INSERT INTO cle...')
#4 /var/www/drupal/web/modules/contrib/cleantalk/lib/Cleantalk/Common/Firewall/FirewallUpdater.php(868): Cleantalk\Common\Firewall\Modules\AntiCrawler::directUpdate(Array)
#5 /var/www/drupal/web/modules/contrib/cleantalk/lib/Cleantalk/Common/Firewall/FirewallUpdater.php(135): Cleantalk\Common\Firewall\FirewallUpdater->directUpdate()
#6 /var/www/drupal/web/modules/contrib/cleantalk/lib/Cleantalk/Common/Firewall/FirewallUpdater.php(67): Cleantalk\Common\Firewall\FirewallUpdater->updateInit()
#7 /var/www/drupal/web/modules/contrib/cleantalk/src/CleantalkFuncs.php(878): Cleantalk\Common\Firewall\FirewallUpdater->update()
#8 [internal function]: Drupal\cleantalk\CleantalkFuncs::apbct_sfw_update()
#9 /var/www/drupal/web/modules/contrib/cleantalk/lib/Cleantalk/Common/Cron/Cron.php(347): call_user_func_array('\\Drupal\\cleanta...', Array)
#10 /var/www/drupal/web/modules/contrib/cleantalk/src/EventSubscriber/BootSubscriber.php(201): Cleantalk\Common\Cron\Cron->runTasks(Array)
#11 /var/www/drupal/web/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(48): Drupal\cleantalk\EventSubscriber\BootSubscriber->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#12 /var/www/drupal/web/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(51): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#13 /var/www/drupal/web/core/lib/Drupal/Core/StackMiddleware/AjaxPageState.php(36): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#14 /var/www/drupal/web/core/lib/Drupal/Core/StackMiddleware/StackedHttpKernel.php(51): Drupal\Core\StackMiddleware\AjaxPageState->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#15 /var/www/drupal/web/core/lib/Drupal/Core/DrupalKernel.php(741): Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#16 /var/www/drupal/web/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#17 {main}

πŸ› Bug report
Status

Active

Version

9.6

Component

Code

Created by

πŸ‡¬πŸ‡§United Kingdom iainH

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @iainH
  • πŸ‡¬πŸ‡§United Kingdom iainH

    I rather think this is something to do with the spam firewall feature and its firewall blacklist automated updates as I see a warning message on the Cleantalk configuration page.
    For now I have turned OFF this feature and am awaiting an hourly SFW update
    If I try to set the spam firewall feature ON I get the Error 500 again

    If it’s of any use I will attach Cleantalk debugging file.

  • πŸ‡¬πŸ‡§United Kingdom iainH

    Warning message mentioned above:

    Warning message
    CleanTalk SFW update error: updateWorker: Wrong update ID. Please, save settings to run new SFW update and wait for an hour.
    CleanTalk SFW update error: getMultifiles: Bad HTTP response (501) from file location: https://apix1.cleantalk.org/store/bl_list_fb9f1fc65f62cdc2ca427daf79d1bb1d.multifiles.csv.gz. Please, save settings to run new SFW update and wait for an hour.
    CleanTalk SFW update error: endOfUpdateCheckingData: The discrepancy between the amount of data received for the update and in the final table: cleantalk_sfw. RECEIVED: 27527. ADDED: 42527. Please, save settings to run new SFW update and wait for an hour.
    
  • πŸ‡·πŸ‡ΊRussia znaeff

    Hello @iainh
    I've transferred this to our developers. We will respond with the results as soon as possible.

  • πŸ‡·πŸ‡ΊRussia znaeff

    Hello iainh
    The issue was in an incorrectly added record in the user agent list. We have removed the problematic entry from the database. The error should no longer occur. Please let us know if you still experience any issues.

Production build 0.71.5 2024