- Issue created by @sidgrafix
I have the same problem:
Dblog message:
Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'log.messagelog.type' in 'group statement': SELECT "log"."message" AS "message", "log"."type" AS "type", COUNT(*) AS "cnt" FROM "watchdog" "log" WHERE "log"."type" NOT IN (:db_condition_placeholder_0, :db_condition_placeholder_1, :db_condition_placeholder_2, :db_condition_placeholder_3, :db_condition_placeholder_4, :db_condition_placeholder_5, :db_condition_placeholder_6, :db_condition_placeholder_7, :db_condition_placeholder_8, :db_condition_placeholder_9, :db_condition_placeholder_10) GROUP BY "log"."messagelog"."type" HAVING (COUNT(*) >= :threshold) ORDER BY "cnt" DESC; Array ( [:db_condition_placeholder_0] => autoban [:db_condition_placeholder_1] => cron [:db_condition_placeholder_2] => php [:db_condition_placeholder_3] => system [:db_condition_placeholder_4] => user [:db_condition_placeholder_5] => locale [:db_condition_placeholder_6] => smtp [:db_condition_placeholder_7] => content [:db_condition_placeholder_8] => menu [:db_condition_placeholder_9] => xmlsitemap [:db_condition_placeholder_10] => advanced ban [:threshold] => 2 ) in Drupal\autoban\Form\AutobanAnalyzeForm->getAnalyzeResult() (line 286 of /___/public_html/modules/autoban/src/Form/AutobanAnalyzeForm.php).Getting the same error when I click on Log analyze tab.
I am using Autoban with the Core ban module. Drupal 9.5.5 and PHP 8.0.27
Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'log.messagelog.type' in 'group statement': SELECT "log"."message" AS "message", "log"."type" AS "type", COUNT(*) AS "cnt" FROM "watchdog" "log" WHERE "log"."type" NOT IN (:db_condition_placeholder_0, :db_condition_placeholder_1, :db_condition_placeholder_2, :db_condition_placeholder_3, :db_condition_placeholder_4, :db_condition_placeholder_5, :db_condition_placeholder_6, :db_condition_placeholder_7, :db_condition_placeholder_8, :db_condition_placeholder_9, :db_condition_placeholder_10, :db_condition_placeholder_11, :db_condition_placeholder_12, :db_condition_placeholder_13, :db_condition_placeholder_14, :db_condition_placeholder_15, :db_condition_placeholder_16, :db_condition_placeholder_17, :db_condition_placeholder_18) GROUP BY "log"."messagelog"."type" HAVING (COUNT(*) >= :threshold) ORDER BY "cnt" DESC; Array ( [:db_condition_placeholder_0] => autoban [:db_condition_placeholder_1] => cron [:db_condition_placeholder_2] => php [:db_condition_placeholder_3] => system [:db_condition_placeholder_4] => user [:db_condition_placeholder_5] => content [:db_condition_placeholder_6] => serial_launcher [:db_condition_placeholder_7] => ultimate_cron_lock [:db_condition_placeholder_8] => database_logger [:db_condition_placeholder_9] => feeds [:db_condition_placeholder_10] => image [:db_condition_placeholder_11] => content_lock_timeout [:db_condition_placeholder_12] => advanced ban [:db_condition_placeholder_13] => search_api [:db_condition_placeholder_14] => search_api_pantheon [:db_condition_placeholder_15] => access denied [:db_condition_placeholder_16] => menu [:db_condition_placeholder_17] => redirect [:db_condition_placeholder_18] => simple_sitemap [:threshold] => 3 ) in Drupal\autoban\Form\AutobanAnalyzeForm->getAnalyzeResult() (line 286 of /code/web/modules/contrib/autoban/src/Form/AutobanAnalyzeForm.php).
In order to use multiple
groupBy
's in a query they must be separated into separate calls instead of listing them together.When I updated
$query->groupBy('log.message, log.type');
to
$query->groupBy('log.message'); $query->groupBy('log.type');
Analyze logs admin section started working again. I'll see if I can make a patch in a little bit so that it can be committed and fixed.
- @catapipper opened merge request.
- Status changed to Needs review
over 1 year ago 5:57pm 4 April 2023 - Status changed to RTBC
over 1 year ago 7:28am 7 April 2023 - π¬π§United Kingdom MrDaleSmith
Had this issue: used the change in the MR and the issue was resolved.
- Status changed to Fixed
over 1 year ago 6:19pm 25 April 2023 Automatically closed - issue fixed for 2 weeks with no activity.
- πͺπΈSpain lapurddrupal
I got the same Error: 1054 Unknown column 'log.messagelog.type....... after installing autoban 8.1 recently via composer.
Where is a patch I may use? Drupal 9.5.8, PHP 8.1.16 . - π¬π§United Kingdom MrDaleSmith
You can use the dev version of the module, or get a patch from the MR by adding .patcxh to its URL: so https://git.drupalcode.org/project/autoban/-/merge_requests/7.patch
- πͺπΈSpain lapurddrupal
Thanks a lot MrDaleSmith, it cured the problem.