Redirection tries to write to non-existent table?? Maybe?
-
I’m not quite sure how to file this particular anomaly I discovered today while reviewing our php-error logs. But FWIW I do think it has something to do with the Redirection plugin, thus I’m posting the issue here with the disclaimer of ‘its not a bug (yet)’. Johns feedback would be appreciated however.
We have been using the Redirection plugin for a few years now on 3 of the 6 sites that exist within our WP multisite. The plugin is not ‘network enabled’ and can only be activated by each sites administrator. So far only 4 of our sites have ever activated the plugin. 3 of those 4 actively use the redirect features. For whatever reason, the 4th site has activated the plugin but never followed through with its initial setup. Subsequently, the Redirection db tables typically created (e.g. _404, _items, _groups, _logs) were never initialized and therefore non-existent within the db).
As of this morning in noticed our aggregated php-error server log was chock full of entries reporting database table write failures all targeting the same wp_4_redirection_items table. The failures were occurring naturally for the reason that the wp_4 site being the one that never set up any redirects doesn’t have any Redirection tables to write to. The only way I was able to tame the log (for now) was to deactivate the plugin on the site that the non-existent table writes were falling over on.
Here are just a few examples cherrypicked from the 1000’s of log entries. As you can see the only variance are the urls themselves.[11-Jul-2024 23:54:22 UTC] WordPress database error Table 'wp_3_redirection_items' doesn't exist for query SELECT * FROM wp_3_redirection_items WHERE match_url IN ('/.well-known/traffic-advice', '/.well-known/traffic-advice', 'regex') AND status='enabled' LIMIT 20000 made by require('wp-blog-header.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), do_action('init'), WP_Hook->do_action, WP_Hook->apply_filters, WordPress_Module->init, Red_Item::get_for_url, Red_Item::get_for_matched_url
[11-Jul-2024 23:56:48 UTC] WordPress database error Table 'wp_3_redirection_items' doesn't exist for query SELECT * FROM wp_3_redirection_items WHERE match_url IN ('/wp-cron.php', '/wp-cron.php?doing_wp_cron=1720742207.7938721179962158203125', 'regex') AND status='enabled' LIMIT 20000 made by require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), do_action('init'), WP_Hook->do_action, WP_Hook->apply_filters, WordPress_Module->init, Red_Item::get_for_url, Red_Item::get_for_matched_url
[12-Jul-2024 00:06:38 UTC] WordPress database error Table 'wp_3_redirection_items' doesn't exist for query SELECT * FROM wp_3_redirection_items WHERE match_url IN ('/2019/05/10/fusce-dapibus-ac-cursus-commodo', '/2019/05/10/fusce-dapibus-ac-cursus-commodo', 'regex') AND status='enabled' LIMIT 20000 made by require('wp-blog-header.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), do_action('init'), WP_Hook->do_action, WP_Hook->apply_filters, WordPress_Module->init, Red_Item::get_for_url, Red_Item::get_for_matched_url
After looking further into the issue with the logs, I noticed that as of July 4th, the number of 404 entries written to the wp_[x]_redirection_404 tables that correspond to the other 3 sites that actively use the plugin have significantly increased on the order of thousands. In fact, zero records exist prior to July 4th despite having the plugin activated for years on those same 3 sites. The most significant increase in entries is in total of over 3’000 and appear to be urls that bad acting bots try and target (e.g. core wordpress files). Our hosting environment and security setup obviously blocks all of those attempts but when did Redirection start logging everything bots are doing?
I will report back if/when I find out anything else that might be causing this weirdness.
- You must be logged in to reply to this topic.