Base table or view not found

Created on 2 February 2022, almost 3 years ago
Updated 8 February 2023, almost 2 years ago

I'm receiving this kind of errors in the logs:

Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[42S02]: Base table or view not found: 1146 Table '{{ database }}.cleantalk_sfw' doesn't exist: SELECT network, mask, status, source FROM cleantalk_sfw WHERE network IN (3422552064,3456106496,3472883712,3474980864,3475505152,3475767296,3475898368,3475900416,3475901440,3475901696,3475901760,3475901792,3475901808,3475901816) AND network = 3475901816 & mask AND 11403 <> 0 ORDER BY status DESC; Array ( ) in Cleantalk\ApbctDrupal\DB->fetch_all() (regel 78 van /web/modules/contrib/cleantalk/src/lib/Cleantalk/ApbctDrupal/DB.php).

The table does exist in the database so it's unclear to me why it would fail.

I definitely recommend to replace the direct queries with the Drupal query builder:

$db_results = $this->db->fetch_all("SELECT
network, mask, status, source
FROM " . $this->db_data_table_name . "
WHERE network IN (". implode( ',', $needles ) .")
AND	network = " . $current_ip_v4 . " & mask
AND " . rand( 1, 100000 ) . " <> 0
ORDER BY status DESC");
🐛 Bug report
Status

Active

Version

9.1

Component

Code

Created by

🇧🇪Belgium bceyssens Genk 🇧🇪

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024