[wp-trac] [WordPress Trac] #54849: Site transients cause DB errors when installing

WordPress Trac noreply at wordpress.org
Tue Jan 18 05:14:10 UTC 2022


#54849: Site transients cause DB errors when installing
--------------------------------+--------------------
 Reporter:  peterwilsoncc       |      Owner:  (none)
     Type:  defect (bug)        |     Status:  new
 Priority:  normal              |  Milestone:  5.9.1
Component:  Options, Meta APIs  |    Version:  trunk
 Severity:  normal              |   Keywords:
  Focuses:                      |
--------------------------------+--------------------
 Discovered while looking in to #54800 and #54801.

 In WordPress 5.9 the `*_site_transient()` functions can be called during
 the installation process prior to the database tables been created. This
 only happens on WordPress configurations with multiple theme directory
 roots set via the `$wp_theme_directories` global.

 `create_initial_post_types()`, `_add_default_theme_supports()` and
 `wp_enable_block_templates()` all call `wp_is_block_theme()` which
 ultimately calls `get_theme_roots()` and may try to retrieve/set a site
 wide transient.

 Sample log entries:

 {{{
 [18-Jan-2022 03:20:24 UTC] WordPress database error Table
 'wordpress.wp_sitemeta' doesn't exist for query SHOW FULL COLUMNS FROM
 `wp_sitemeta` made by include('phar:///usr/local/src/wp-cli/bin/wp/php
 /boot-phar.php'), include('phar:///usr/local/src/wp-cli/bin/wp/vendor/wp-
 cli/wp-cli/php/wp-cli.php'), WP_CLI\bootstrap,
 WP_CLI\Bootstrap\LaunchRunner->process, WP_CLI\Runner->start,
 WP_CLI\Runner->load_wordpress, require('wp-settings.php'),
 do_action('setup_theme'), WP_Hook->do_action, WP_Hook->apply_filters,
 _add_default_theme_supports, wp_is_block_theme, wp_get_theme,
 get_raw_theme_root, get_theme_roots, search_theme_directories,
 set_site_transient, add_site_option, add_network_option

 [18-Jan-2022 03:20:24 UTC] WordPress database error Table
 'wordpress.wp_sitemeta' doesn't exist for query SHOW FULL COLUMNS FROM
 `wp_sitemeta` made by include('phar:///usr/local/src/wp-cli/bin/wp/php
 /boot-phar.php'), include('phar:///usr/local/src/wp-cli/bin/wp/vendor/wp-
 cli/wp-cli/php/wp-cli.php'), WP_CLI\bootstrap,
 WP_CLI\Bootstrap\LaunchRunner->process, WP_CLI\Runner->start,
 WP_CLI\Runner->load_wordpress, require('wp-settings.php'),
 do_action('setup_theme'), WP_Hook->do_action, WP_Hook->apply_filters,
 wp_enable_block_templates, wp_is_block_theme, wp_get_theme,
 get_raw_theme_root, get_theme_roots, search_theme_directories,
 set_site_transient, add_site_option, add_network_option


 [18-Jan-2022 03:20:24 UTC] WordPress database error Table
 'wordpress.wp_sitemeta' doesn't exist for query SHOW FULL COLUMNS FROM
 `wp_sitemeta` made by include('phar:///usr/local/src/wp-cli/bin/wp/php
 /boot-phar.php'), include('phar:///usr/local/src/wp-cli/bin/wp/vendor/wp-
 cli/wp-cli/php/wp-cli.php'), WP_CLI\bootstrap,
 WP_CLI\Bootstrap\LaunchRunner->process, WP_CLI\Runner->start,
 WP_CLI\Runner->load_wordpress, require('wp-settings.php'),
 do_action('init'), WP_Hook->do_action, WP_Hook->apply_filters,
 create_initial_post_types, wp_is_block_theme, wp_get_theme,
 get_raw_theme_root, get_theme_roots, search_theme_directories,
 set_site_transient, add_site_option, add_network_option
 }}}

 The single site specific `get_transient()` and related functions include
 checks for `wp_installing()` that are lacking in the network wide
 `get_site_transient()` and related functions.

 ----

 As this is super niche and requires multiple theme routes be set up, I've
 put this on 5.9.1 for consideration even though the bugs were introduced
 in the 5.9 cycle as part of full site editing.

 cc @noisysocks, @hellofromtonya

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/54849>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list