[wp-trac] [WordPress Trac] #54800: Nonce creation causes DB access errors when initializing multisite networks

WordPress Trac noreply at wordpress.org
Tue Jan 18 03:53:01 UTC 2022


#54800: Nonce creation causes DB access errors when initializing multisite networks
-------------------------------------------------+-------------------------
 Reporter:  schlessera                           |       Owner:  (none)
     Type:  defect (bug)                         |      Status:  new
 Priority:  high                                 |   Milestone:  5.9
Component:  Script Loader                        |     Version:  5.8
 Severity:  major                                |  Resolution:
 Keywords:  has-patch reporter-feedback needs-   |     Focuses:
  testing-info                                   |
-------------------------------------------------+-------------------------

Comment (by peterwilsoncc):

 Testing this with @costdev today, we came to the conclusion these database
 errors were added later and during the WP 5.9 cycle.

 The [https://github.com/WordPress/wordpress-develop/pull/2147 linked pull
 request] appears to fix the error.

 --- Reproduction notes ---

 The easiest method to reproduce is via WP CLI.

 `wp-config.php`
 * Ensure the file includes `define( 'MULTISITE', true );`
 * Ensure the file does not include any of the `*_KEY` or `*_SALT`
 definitions
 * Ensure debug logging is enabled

 Run the following commands via WP CLI (changing the host name as
 appropriate)

 {{{
 wp db --yes reset
 wp core multisite-install --title='wpdevms' --admin_user=admin
 --admin_email=admin at example.com --admin_password=password --url=http://wp-
 dev.local/
 }}}

 --- Without the patch applied ---

 Multiple errors are logged during the installation process as the
 `wp_create_nonce()` is called. Each error is similar to the log entry
 below but the `meta_key` value can vary:

 {{{
 WordPress database error Table 'wordpress.wp_sitemeta' doesn't exist for
 query SELECT meta_value FROM wp_sitemeta WHERE meta_key = 'nonce_key' AND
 site_id = 1 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,
 register_block_core_file, register_block_type_from_metadata,
 register_block_script_handle, wp_register_script, wp_scripts,
 WP_Scripts->__construct, WP_Scripts->init,
 do_action_ref_array('wp_default_scripts'), WP_Hook->do_action,
 WP_Hook->apply_filters, wp_default_scripts, wp_create_nonce, wp_hash,
 wp_salt, get_site_option, get_network_option
 }}}

 --- With the patch applied ---

 No nonce related errors are thrown during the installation process.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/54800#comment:13>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list