[wp-trac] [WordPress Trac] #62294: Automatic updates no longer work with via SSH2 from WP 6.6
WordPress Trac
noreply at wordpress.org
Thu Oct 24 13:38:37 UTC 2024
#62294: Automatic updates no longer work with via SSH2 from WP 6.6
----------------------------+-----------------------------
Reporter: srfg | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Filesystem API | Version: 6.6
Severity: normal | Keywords:
Focuses: |
----------------------------+-----------------------------
Since WordPress 6.6, automatic updates (core, plugins) no longer work via
an SSH connection. All updates work normally if you trigger them manually.
Environment:
- PHP 8.2
- WordPress 6.6 and later (including 6.6.2)
Affected instances
- Clean installation of WordPress and 70 other websites that we run. So we
can reproduce the problem.
We do not receive any information in the log file. To get more
information, we used the "Easy Updates Manager plugin. It does not work
either and we received the following error:
{{{
[16-Oct-2024 13:39:21 UTC] PHP Fatal error: Uncaught TypeError:
ftp_nlist(): Argument #1 ($ftp) must be of type FTP\Connection, null given
in /var/www/https/***.***.at/wp/wp-admin/includes/class-wp-filesystem-
ftpext.php:438
Stack trace:
#0 /var/www/https/***.***.at/wp/wp-admin/includes/class-wp-filesystem-
ftpext.php(438): ftp_nlist()
#1 /var/www/https/***.***.at/wp/wp-admin/includes/class-wp-filesystem-
base.php(231): WP_Filesystem_FTPext->exists()
#2 /var/www/https/***.***.at/wp/wp-admin/includes/class-wp-filesystem-
base.php(58): WP_Filesystem_Base->find_folder()
#3 /var/www/https/***.***.at/wp/wp-admin/includes/class-wp-
upgrader.php(997): WP_Filesystem_Base->abspath()
#4 /var/www/https/***.***.at/wp/wp-admin/includes/class-wp-automatic-
updater.php(474): WP_Upgrader->maintenance_mode()
#5 /var/www/https/***.***.at/wp/wp-admin/includes/class-wp-automatic-
updater.php(676): WP_Automatic_Updater->update()
#6 /var/www/https/***.***.at/wp/wp-includes/update.php(855):
WP_Automatic_Updater->run()
#7 /var/www/https/***.***.at/wp/wp-content/plugins/stops-core-theme-and-
plugin-updates/includes/MPSUM_Admin_Ajax.php(1057): wp_maybe_auto_update()
#8 /var/www/https/***.***.at/wp/wp-content/plugins/stops-core-theme-and-
plugin-updates/includes/MPSUM_Admin_Ajax.php(144):
MPSUM_Admin_Ajax->force_updates()
#9 /var/www/https/***.***.at/wp/wp-includes/class-wp-hook.php(324):
MPSUM_Admin_Ajax->ajax_handler()
#10 /var/www/https/***.***.at/wp/wp-includes/class-wp-hook.php(348):
WP_Hook->apply_filters() 11 /var/www/https/***.***.at/wp/wp-
includes/plugin.php(517): WP_Hook->do_action()
#12 /var/www/https/***.***.at/wp/wp-admin/admin-ajax.php(192): do_action()
#13 {main} thrown in /var/www/https/***.***.at/wp/wp-admin/includes/class-
wp-filesystem-ftpext.php on line 438
}}}
A value is obviously missing. If we use the setting define('FS_METHOD',
'ssh2');, there is another fatal error:
{{{
[16-Oct-2024 15:41:54 UTC] Automatic updates starting...
[16-Oct-2024 15:41:54 UTC] Automatic plugin updates starting...
[16-Oct-2024 15:41:54 UTC] Upgrading plugin 'better-search-replace'...
[16-Oct-2024 15:41:54 UTC] PHP Fatal error: Uncaught TypeError:
ssh2_sftp_realpath(): Argument #1 ($sftp) must be of type resource, null
given in /var/www/https/***.***.at/wp/wp-admin/includes/class-wp-
filesystem-ssh2.php:304
Stack trace:
#0 /var/www/https/***.***.at/wp/wp-admin/includes/class-wp-filesystem-
ssh2.php(304): ssh2_sftp_realpath()
#1 /var/www/https/***.***.at/wp/wp-admin/includes/class-wp-filesystem-
base.php(261): WP_Filesystem_SSH2->cwd()
#2 /var/www/https/***.***.at/wp/wp-admin/includes/class-wp-filesystem-
base.php(238): WP_Filesystem_Base->search_for_folder()
#3 /var/www/https/***.***.at/wp/wp-admin/includes/class-wp-filesystem-
base.php(58): WP_Filesystem_Base->find_folder()
#4 /var/www/https/***.***.at/wp/wp-admin/includes/class-wp-
upgrader.php(997): WP_Filesystem_Base->abspath()
#5 /var/www/https/***.***.at/wp/wp-admin/includes/class-wp-automatic-
updater.php(474): WP_Upgrader->maintenance_mode()
#6 /var/www/https/***.***.at/wp/wp-admin/includes/class-wp-automatic-
updater.php(676): WP_Automatic_Updater->update()
#7 /var/www/https/***.***.at/wp/wp-includes/update.php(855):
WP_Automatic_Updater->run()
#8 /var/www/https/***.***.at/wp/wp-content/plugins/stops-core-theme-and-
plugin-updates/includes/MPSUM_Admin_Ajax.php(1057): wp_maybe_auto_update()
#9 /var/www/https/***.***.at/wp/wp-content/plugins/stops-core-theme-and-
plugin-updates/includes/MPSUM_Admin_Ajax.php(144):
MPSUM_Admin_Ajax->force_updates()
#10 /var/www/https/***.***.at/wp/wp-includes/class-wp-hook.php(324):
MPSUM_Admin_Ajax->ajax_handler()
#11 /var/www/https/***.***.at/wp/wp-includes/class-wp-hook.php(348):
WP_Hook->apply_filters()
#12 /var/www/https/***.***.at/wp/wp-includes/plugin.php(517):
WP_Hook->do_action()
#13 /var/www/https/***.***.at/wp/wp-admin/admin-ajax.php(192): do_action()
#14 {main}
thrown in /var/www/https/***.***.at/wp/wp-admin/includes/class-wp-
filesystem-ssh2.php on line 304
}}}
Configuration:
{{{
define(‘FTP_METHOD’,’ssh2′);
define(‘FTP_PUBKEY’,’/xxx/xxx/xxx.xx’);
define(‘FTP_PRIKEY’,’/xxx/xxx/xxx.xx’);
define(‘FTP_USER’,’xxxxxxxx’);
define(‘FTP_PASS’,”);
define(‘FTP_HOST’,’127.0.0.1:22′);
}}}
There is no problem with the direct method.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/62294>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list