[wp-trac] [WordPress Trac] #62718: Automatic updater of WordPress always fails if FS_METHOD is ftpext since 6.6 with PHP 8.0+
WordPress Trac
noreply at wordpress.org
Sat Mar 29 17:58:13 UTC 2025
#62718: Automatic updater of WordPress always fails if FS_METHOD is ftpext since
6.6 with PHP 8.0+
-------------------------------------------------+-------------------------
Reporter: hideishi | Owner:
| SergeyBiryukov
Type: defect (bug) | Status: reopened
Priority: normal | Milestone: 6.9
Component: Upgrade/Install | Version: 6.6
Severity: major | Resolution:
Keywords: needs-unit-tests has-testing-info | Focuses:
dev-feedback has-patch |
-------------------------------------------------+-------------------------
Changes (by SirLouen):
* keywords: needs-unit-tests has-testing-info changes-requested => needs-
unit-tests has-testing-info dev-feedback has-patch
Comment:
== Combined Reproduction Report & Patch Testing
=== Description
This report validates that the indicated patch works as expected.
Patch tested: [https://github.com/WordPress/wordpress-develop/pull/8579
https://github.com/WordPress/wordpress-develop/pull/8579.diff]
=== Environment
- WordPress: 6.7.1-src
- PHP: 8.2.28
- Server: nginx/1.27.4
- Database: mysqli (Server: 8.0.41 / Client: mysqlnd 8.2.28)
- Browser: Chrome 134.0.0.0
- OS: Windows 10/11
- Theme: Twenty Twenty-Five 1.0
- MU Plugins:
* Auto Updates Enforcer 1.0.0
- Plugins:
* Test Reports 1.2.0
=== Steps to Reproduce
1. Get on 6.7.1 branch `git checkout tags/6.7.1`, we need to trigger an
automatic update, and it will be done from 6.7.1 to 6.7.2
2. Get FTP patch `npm run grunt patch:https://github.com/WordPress
/wordpress-develop/pull/8589`
The original patch doesn't patch cleanly because there are some minor
differences among branches, so I needed to apply some changes manually in
`tools/local-env/scripts/start.js`
3. Get the `exists` method patch `npm run grunt
patch:https://github.com/WordPress/wordpress-develop/pull/8599`
4. Get the sanitizes patch `npm run grunt
patch:https://github.com/WordPress/wordpress-develop/pull/8618`
Alternatively, I've created this branch with all this in place:
https://github.com/SirLouen/wordpress-develop/tree/patch/6.7.1/62718 to
fast-forward all the 4 first steps
5. Run all the initialization commands (`build:dev`, `env:start`,
`env:install`)
6. Adding this to `wp-config.php`:
{{{
define( 'FS_METHOD', 'ftpext' );
define( 'FTP_USER', 'admin' );
define( 'FTP_PASS', 'password' );
define( 'FTP_HOST', 'ftp' );
define( 'FTP_SSL', false );
}}}
7. Now I can wait for the automatic update to take place or, we can
accelerate this by adding this simple plugin or just the function to
`functions.php`:
{{{#!php
<?php
/*
Plugin Name: Auto Updates Enforcer
Description: Ultra-Fast Auto Updates
Version: 1.0.0
Author: SirLouen
*/
function trigger_auto_update_debug() {
if (isset($_GET['trigger_auto_update']) &&
current_user_can('update_core')) {
do_action('wp_maybe_auto_update');
echo "Auto-update check triggered";
exit;
}
}
add_action('admin_init', 'trigger_auto_update_debug');
}}}
8. We can trigger the auto-update with this URL: http://localhost:8889/wp-
admin/?trigger_auto_update=1
9. 🐞 Bug occurs.
**Little extra note**: To keep reproducing this, you might need to remove
the `auto_updater` lock is a record in `wp_options` table.
=== Expected Results
- System autoupdating without any troubles
=== Actual Results after Patch
1. ✅ Patch solves the issue.
=== Additional Notes
After several days of research, I've discovered that some FTP clients are
very delicate to commands, and for example, `ftp_nlist` fails with core
updates because of very long paths. This added up to the fact that some
`ftpext` filesystem methods had some minor bugs, it was impossible to
reproduce it under certain conditions.
For this reason, this Report, is strongly dependent on these two reports:
#63173 #63197
Also, I encourage pinging the main Build Tool maintainers: @desrosj or
@SergeyBiryukov to take control over this report #63172 and consider
implementation, which has made my life better for debugging all this and
probably will make future devs to debug anything FTP.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/62718#comment:23>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list