WordPress Multisite: Table Doesn’t Exist Database Errors
-
We run a large multisite installation where individuals can create new sites at any time. Recently we noticed our logs were filling with errors during site creation. After looking into this some more, it appears to be related to the
maybe_activate_ssl_in_new_blog()
method within the plugin. We were able to replicate this locally and with a brand new multisite installation. Here are the steps to replicate the problem:- Create a new multisite installation.
- Turn on debug logging using
define( 'WP_DEBUG', true );
,define( 'WP_DEBUG_LOG', true );
anddefine( 'WP_DEBUG_DISPLAY', false );
within wp-config.php. - Install the Really Simple SSL plugin and set it to run network-wide.
- Visit
/wp-admin/network/site-new.php
and create a new site. - Check the debug.log file within wp-content and you’ll find the database errors.
Here is an example of the errors we’re seeing:
[05-Aug-2020 22:03:27 UTC] WordPress database error Table 'local.wp_2_options' doesn't exist for query SHOW FULL COLUMNS FROM <code>wp_2_options</code> made by wpmu_create_blog, wp_insert_site, do_action('wp_insert_site'), WP_Hook->do_action, WP_Hook->apply_filters, rsssl_multisite->maybe_activate_ssl_in_new_blog, rsssl_admin->activate_ssl, rsssl_admin->set_siteurl_to_ssl, update_option, sanitize_option [05-Aug-2020 22:03:27 UTC] WordPress database error Table 'local.wp_2_options' doesn't exist for query INSERT INTO <code>wp_2_options</code> (<code>option_name</code>, <code>option_value</code>, <code>autoload</code>) VALUES ('siteurl', 'O:8:\"WP_Error\":2:{s:6:\"errors\";a:1:{s:30:\"wpdb_get_table_charset_failure\";a:1:{i:0;s:0:\"\";}}s:10:\"error_data\";a:0:{}}', 'yes') ON DUPLICATE KEY UPDATE <code>option_name</code> = VALUES(<code>option_name</code>), <code>option_value</code> = VALUES(<code>option_value</code>), <code>autoload</code> = VALUES(<code>autoload</code>) made by wpmu_create_blog, wp_insert_site, do_action('wp_insert_site'), WP_Hook->do_action, WP_Hook->apply_filters, rsssl_multisite->maybe_activate_ssl_in_new_blog, rsssl_admin->activate_ssl, rsssl_admin->set_siteurl_to_ssl, update_option, add_option [05-Aug-2020 22:03:27 UTC] WordPress database error Table 'local.wp_2_options' doesn't exist for query SHOW FULL COLUMNS FROM <code>wp_2_options</code> made by wpmu_create_blog, wp_insert_site, do_action('wp_insert_site'), WP_Hook->do_action, WP_Hook->apply_filters, rsssl_multisite->maybe_activate_ssl_in_new_blog, rsssl_admin->activate_ssl, rsssl_admin->set_siteurl_to_ssl, update_option, sanitize_option [05-Aug-2020 22:03:27 UTC] WordPress database error Table 'local.wp_2_options' doesn't exist for query INSERT INTO <code>wp_2_options</code> (<code>option_name</code>, <code>option_value</code>, <code>autoload</code>) VALUES ('home', 'O:8:\"WP_Error\":2:{s:6:\"errors\";a:1:{s:30:\"wpdb_get_table_charset_failure\";a:1:{i:0;s:0:\"\";}}s:10:\"error_data\";a:0:{}}', 'yes') ON DUPLICATE KEY UPDATE <code>option_name</code> = VALUES(<code>option_name</code>), <code>option_value</code> = VALUES(<code>option_value</code>), <code>autoload</code> = VALUES(<code>autoload</code>) made by wpmu_create_blog, wp_insert_site, do_action('wp_insert_site'), WP_Hook->do_action, WP_Hook->apply_filters, rsssl_multisite->maybe_activate_ssl_in_new_blog, rsssl_admin->activate_ssl, rsssl_admin->set_siteurl_to_ssl, update_option, add_option [05-Aug-2020 22:03:27 UTC] WordPress database error Table 'local.wp_2_options' doesn't exist for query SELECT autoload FROM wp_2_options WHERE option_name = '_transient_rsssl_plusone_count' made by wpmu_create_blog, wp_insert_site, do_action('wp_insert_site'), WP_Hook->do_action, WP_Hook->apply_filters, rsssl_multisite->maybe_activate_ssl_in_new_blog, rsssl_admin->activate_ssl, rsssl_admin->save_options, delete_transient, delete_option [05-Aug-2020 22:03:27 UTC] WordPress database error Table 'local.wp_2_options' doesn't exist for query INSERT INTO <code>wp_2_options</code> (<code>option_name</code>, <code>option_value</code>, <code>autoload</code>) VALUES ('rlrsssl_options', 'a:17:{s:12:\"site_has_ssl\";b:1;s:25:\"ssl_success_message_shown\";b:0;s:22:\"htaccess_warning_shown\";b:0;s:19:\"review_notice_shown\";b:0;s:17:\"plugin_db_version\";s:5:\"3.3.4\";s:11:\"ssl_enabled\";b:1;s:9:\"debug_log\";s:0:\"\";s:21:\"dismiss_review_notice\";b:0;s:4:\"hsts\";b:0;s:19:\"javascript_redirect\";b:0;s:11:\"wp_redirect\";b:1;s:26:\"autoreplace_insecure_links\";b:1;s:5:\"debug\";b:0;s:20:\"do_not_edit_htaccess\";b:0;s:31:\"switch_mixed_content_fixer_hook\";b:0;s:19:\"dismiss_all_notices\";b:0;s:17:\"htaccess_redirect\";b:0;}', 'yes') ON DUPLICATE KEY UPDATE <code>option_name</code> = VALUES(<code>option_name</code>), <code>option_value</code> = VALUES(<code>option_value</code>), <code>autoload</code> = VALUES(<code>autoload</code>) made by wpmu_create_blog, wp_insert_site, do_action('wp_insert_site'), WP_Hook->do_action, WP_Hook->apply_filters, rsssl_multisite->maybe_activate_ssl_in_new_blog, rsssl_admin->activate_ssl, rsssl_admin->save_options, update_option, add_option
Let me know if I can provide any other information that would be helpful. And most importantly, thanks for making a great plugin.
- The topic ‘WordPress Multisite: Table Doesn’t Exist Database Errors’ is closed to new replies.