BoldGrid / boldgrid-backup

The Total Upkeep plugin.
GNU General Public License v2.0
11 stars 9 forks source link

core wp-cli command fails with boldgrid-backup plugin active #497

Open timelsass opened 2 years ago

timelsass commented 2 years ago
  1. Environment was setup using inmotionhosting/wordpress-ultrastack-ansible playbook

  2. running wp-cli plugin is-installed wp plugin is-installed w3-total-cache --allow-root (was in root) caused the following stack trace:

    Fatal error: Uncaught TypeError: ftp_nlist(): Argument #1 ($ftp) must be of type resource, null given in /home/wordpress/doc_root/wp-admin/includes/class-wp-filesystem-ftpext.php:420
    Stack trace:
    #0 /home/wordpress/doc_root/wp-admin/includes/class-wp-filesystem-ftpext.php(420): ftp_nlist(NULL, '/home/wordpress...')
    #1 /home/wordpress/doc_root/wp-content/plugins/boldgrid-backup/vendor/boldgrid/library/src/Util/Load.php(288): WP_Filesystem_FTPext->exists('/home/wordpress...')
    #2 /home/wordpress/doc_root/wp-content/plugins/boldgrid-backup/vendor/boldgrid/library/src/Util/Load.php(183): Boldgrid\Library\Util\Load->isValidPath('/home/wordpress...')
    #3 /home/wordpress/doc_root/wp-content/plugins/boldgrid-backup/vendor/boldgrid/library/src/Util/Load.php(72): Boldgrid\Library\Util\Load->setLoad(Array)
    #4 /home/wordpress/doc_root/wp-content/plugins/boldgrid-backup/boldgrid-backup.php(113): Boldgrid\Library\Util\Load->__construct(Array)
    #5 /home/wordpress/doc_root/wp-content/plugins/boldgrid-backup/boldgrid-backup.php(145): load_boldgrid_backup()
    #6 /home/wordpress/doc_root/wp-settings.php(409): include_once('/home/wordpress...')
    #7 phar:///usr/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(1271): require('/home/wordpress...')
    #8 phar:///usr/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(1192): WP_CLI\Runner->load_wordpress()
    #9 phar:///usr/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/LaunchRunner.php(23): WP_CLI\Runner->start()
    #10 phar:///usr/bin/wp/vendor/wp-cli/wp-cli/php/bootstrap.php(77): WP_CLI\Bootstrap\LaunchRunner->process(Object(WP_CLI\Bootstrap\BootstrapState))
    #11 phar:///usr/bin/wp/vendor/wp-cli/wp-cli/php/wp-cli.php(27): WP_CLI\bootstrap()
    #12 phar:///usr/bin/wp/php/boot-phar.php(11): include('phar:///usr/bin...')
    #13 /usr/bin/wp(4): include('phar:///usr/bin...')
    #14 {main}
    thrown in /home/wordpress/doc_root/wp-admin/includes/class-wp-filesystem-ftpext.php on line 420
    Error: There has been a critical error on this website.Learn more about troubleshooting WordPress. There has been a critical error on this website.
    [root@vps73849 doc_root]# wp plugin is-installed w3-total-cache --allow-root
    Fatal error: Uncaught TypeError: ftp_nlist(): Argument #1 ($ftp) must be of type resource, null given in /home/wordpress/doc_root/wp-admin/includes/class-wp-filesystem-ftpext.php:420
    Stack trace:
    #0 /home/wordpress/doc_root/wp-admin/includes/class-wp-filesystem-ftpext.php(420): ftp_nlist(NULL, '/home/wordpress...')
    #1 /home/wordpress/doc_root/wp-content/plugins/boldgrid-backup/vendor/boldgrid/library/src/Util/Load.php(288): WP_Filesystem_FTPext->exists('/home/wordpress...')
    #2 /home/wordpress/doc_root/wp-content/plugins/boldgrid-backup/vendor/boldgrid/library/src/Util/Load.php(183): Boldgrid\Library\Util\Load->isValidPath('/home/wordpress...')
    #3 /home/wordpress/doc_root/wp-content/plugins/boldgrid-backup/vendor/boldgrid/library/src/Util/Load.php(72): Boldgrid\Library\Util\Load->setLoad(Array)
    #4 /home/wordpress/doc_root/wp-content/plugins/boldgrid-backup/boldgrid-backup.php(113): Boldgrid\Library\Util\Load->__construct(Array)
    #5 /home/wordpress/doc_root/wp-content/plugins/boldgrid-backup/boldgrid-backup.php(145): load_boldgrid_backup()
    #6 /home/wordpress/doc_root/wp-settings.php(409): include_once('/home/wordpress...')
    #7 phar:///usr/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(1271): require('/home/wordpress...')
    #8 phar:///usr/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php(1192): WP_CLI\Runner->load_wordpress()
    #9 phar:///usr/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/LaunchRunner.php(23): WP_CLI\Runner->start()
    #10 phar:///usr/bin/wp/vendor/wp-cli/wp-cli/php/bootstrap.php(77): WP_CLI\Bootstrap\LaunchRunner->process(Object(WP_CLI\Bootstrap\BootstrapState))
    #11 phar:///usr/bin/wp/vendor/wp-cli/wp-cli/php/wp-cli.php(27): WP_CLI\bootstrap()
    #12 phar:///usr/bin/wp/php/boot-phar.php(11): include('phar:///usr/bin...')
    #13 /usr/bin/wp(4): include('phar:///usr/bin...')
    #14 {main}
    thrown in /home/wordpress/doc_root/wp-admin/includes/class-wp-filesystem-ftpext.php on line 420
    Error: There has been a critical error on this website.Learn more about troubleshooting WordPress. There has been a critical error on this website.
  3. deleting boldgrid-backup folder, command then gave expected output of exit status 0 or 1 as needed

timelsass commented 2 years ago

can confirm this is happening with other wp-cli commands like wp user list --allow-root

bwmarkle commented 2 years ago

Addressed in https://github.com/BoldGrid/library/commit/b3ef338f49badbe4510a741cddff9e24801096bc