#60461 closed defect (bug) (fixed)
Running the install script shows database error after plugin dependencies changeset
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 6.5 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Upgrade/Install | Keywords: | has-patch commit |
Focuses: | Cc: |
Description
Follow up to #22316.
After [57545], there's a new error being shown when running npm run env:install
. It doesn't appear in the logs for the changeset prior.
<div id="error"><p class="wpdberror"><strong>WordPress database error:</strong> [Table 'wordpress_develop.wp_options' doesn't exist]<br /><code>INSERT INTO `wp_options` (`option_name`, `option_value`, `autoload`) VALUES ('plugin_data', 'a:1:{s:9:\"hello.php\";a:15:{s:4:\"Name\";s:11:\"Hello Dolly\";s:9:\"PluginURI\";s:41:\"http://wordpress.org/plugins/hello-dolly/\";s:7:\"Version\";s:5:\"1.7.2\";s:11:\"Description\";s:295:\"This is not just a plugin, it symbolizes the hope and enthusiasm of an entire generation summed up in two words sung most famously by Louis Armstrong: Hello, Dolly. When activated you will randomly see a lyric from <cite>Hello, Dolly</cite> in the upper right of your admin screen on every page.\";s:6:\"Author\";s:14:\"Matt Mullenweg\";s:9:\"AuthorURI\";s:13:\"http://ma.tt/\";s:10:\"TextDomain\";s:0:\"\";s:10:\"DomainPath\";s:0:\"\";s:7:\"Network\";b:0;s:10:\"RequiresWP\";s:0:\"\";s:11:\"RequiresPHP\";s:0:\"\";s:9:\"UpdateURI\";s:0:\"\";s:15:\"RequiresPlugins\";s:0:\"\";s:5:\"Title\";s:11:\"Hello Dolly\";s:10:\"AuthorName\";s:14:\"Matt Mullenweg\";}}', 'yes') ON DUPLICATE KEY UPDATE `option_name` = VALUES(`option_name`), `option_value` = VALUES(`option_value`), `autoload` = VALUES(`autoload`)</code></p></div>Success: WordPress installed successfully.
Despite this warning, it seems like all the tests pass successfully. There are more tests and assertions performed, but wondering if some are being skipped as a result.
Change History (18)
#2
@
13 months ago
Or actually, Colin suggests keeping this one open for visibility, which makes sense.
This ticket was mentioned in PR #6071 on WordPress/wordpress-develop by @costdev.
13 months ago
#3
- Keywords has-patch added
This PR:
- removes two
update_option()
calls during bootstrapping. - only updates the
plugin_data
option inget_plugins()
when not installing WordPress.
#4
@
13 months ago
- Keywords needs-testing added
@desrosj @swissspidy PR 6071 removes some update_option()
calls during bootstrapping and guards an update_option()
call in get_plugins()
during installation.
Please test if you can 🙂
#7
@
12 months ago
Test Report
Description
This report validates whether the indicated patch works as expected.
Patch tested: https://github.com/WordPress/wordpress-develop/pull/6071
Environment
- WordPress: 6.5-alpha-56966-src
- PHP: 8.2.15
- Server: nginx/1.25.3
- Database: mysqli (Server: 8.0.36 / Client: mysqlnd 8.2.15)
- Browser: Safari 17.2.1
- OS: macOS
- Theme: Twenty Twenty-Four 1.0
- MU Plugins:
- WP-CLI: Force Auto-Updates 1.0.0
- Plugins:
- Test Reports 1.1.0
Actual Results
- ✅ Issue resolved with patch.
Additional Notes
- Any additional details worth mentioning.
Supplemental Artifacts
Success: Database reset. [+] Creating 2/0 ✔ Container public-mysql-1 Running 0.0s ✔ Container public-php-1 Running 0.0s <div id="error"><p class="wpdberror"><strong>WordPress database error:</strong> [Table 'wordpress_develop.wp_options' doesn't exist]<br /><code>SHOW FULL COLUMNS FROM `wp_options`</code></p></div>Success: WordPress installed successfully. ➜ AJF-M1-MBA arm64: ~/Local_Sites/wpdevelop/app/public git:(trunk) ✗ npm run env:install
Success: Database reset. [+] Creating 2/0 ✔ Container public-php-1 Running 0.0s ✔ Container public-mysql-1 Running 0.0s Success: WordPress installed successfully. ➜ AJF-M1-MBA arm64: ~/Local_Sites/wpdevelop/app/public git:(plugin_dependencies_remove_plugin_data_update_in_bootstrap) ✗
@youknowriad commented on PR #6071:
12 months ago
#9
Unfortunately, according to codevitals, this was not enough to recover the performance loss. There's probably something else at play.
12 months ago
#10
@youknowriad Thanks for looking into this! It's likely that we'll need to strip back/ remove and relocate a lot of the bootstrapping logic, not unlike a problematic callback hooked on init
. We'll also need to address automatic deactivation - something I'm discussing with the feature team for thoughts and ideas
12 months ago
#11
I forgot to close the PR after this was committed. Let's continue discussion on the related tickets.
Committed in r57592.
This ticket was mentioned in Slack in #cli by costdev. View the logs.
12 months ago
#13
@
12 months ago
- Keywords needs-patch added; has-patch needs-testing removed
- Resolution fixed deleted
- Status changed from closed to reopened
Reopening to address something missed in the commit:
If a plugin isn't in the plugin_data
option, it will throw an error for a missing array key.
Originally reported by @swissspidy on Slack.
This ticket was mentioned in PR #6103 on WordPress/wordpress-develop by @costdev.
12 months ago
#14
- Keywords has-patch added; needs-patch removed
In r57592, some update_option()
calls were removed from bootstrapping. However, this also removed a check to ensure an array key existed, and populated it if not.
Scaffolding tests by WP-CLI revealed that a plugin in the active_plugins
option may not have data already stored within the plugin_data
option, causing a PHP warning for an undefined array key.
This adds a condition to ensure the requirements checks are only performed on plugins whose data is already stored in the plugin_data
option.
#15
@
12 months ago
- Keywords commit added
Patch: https://github.com/WordPress/wordpress-develop/pull/6103
With the inline explanation comment is ready for commit.
We noticed this in WP-CLI tests as well and @costdev mentioned he is working on this in #60457 already. So I suggest closing this as a duplicate.
See https://wordpress.slack.com/archives/C02RP4T41/p1707298003074869
Running some of the WP-CLI tests in the core test suite would help uncover this kind of issues sooner. Let's discuss this!