Articles in this section

WP-CLI fails for CageFS users after WP Toolkit update in Plesk: wpt-wp-cli.php is missing inside CageFS

kb: technical ext: wptk kb: ai-created

Applicable to:

  • Plesk for Linux

Symptoms

  • The server runs CloudLinux OS with CageFS enabled.
  • After WP Toolkit is updated, the /usr/local/bin/wp wrapper cannot load WP-CLI for users with CageFS enabled.
  • The /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/wpt-wp-cli.php file exists on the server but is not visible inside the user's cage:

    # cagefs_enter_user USER /bin/sh -c '[ -f /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/wpt-wp-cli.php ] && echo VISIBLE || echo MISSING' 
    > MISSING

  • The /var/log/plesk/panel.log file may contain a failed removal of the old WP Toolkit directory during the update:

    CONFIG_TEXT: removing wp-toolkit-old-2026-10-15-03-13-39/vendor/wp-cli failed: Device or resource busy

Cause

This is a WP Toolkit bug with ID PPPM-15580.
When WP Toolkit is updated, its module directory is replaced and the old one is deleted, but the CageFS skeleton bind mount of the vendor/wp-cli directory stays attached to the deleted directory.

Resolution

The bug will be fixed in one of the future Plesk updates and the bug number will be published to changelogs once it is released.

As a workaround, remount CageFS after the WP Toolkit update has finished:

  1. Connect to the server via SSH.
  2. Check whether the CageFS mount is stale:

    # MP=/usr/share/cagefs-skeleton/usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli

    # findmnt -T "$MP" -o TARGET,SOURCE

    Note: The mount is stale if the SOURCE column contains wp-toolkit-old- or ends with //deleted. Continue only in this case.

  3. Check that the file is missing inside a cage:

    Note: Replace USER with any user that has CageFS enabled. 

    # cagefs_enter_user USER /bin/sh -c '[ -f /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/wpt-wp-cli.php ] && echo VISIBLE || echo MISSING'

  4. If Steps 2 & 3 shows issues then remount CageFS:

    Warning: The following command stops all processes running inside existing cages, including shell sessions and long-running scripts of CageFS users, and resets LVE limits to their configured values. Run it in a low-traffic period.

    Note: The cagefsctl --update command does not repair this state. Editing /etc/cagefs/cagefs.mp or running cagefsctl --force-update is not required.

    # cagefsctl --do-not-ask --remount-all

  5. Verify that the mount follows the current directory and the file is visible again:

    # findmnt -T "$MP" -o TARGET,SOURCE

     

    # cagefs_enter_user USER /bin/sh -c '[ -f /usr/local/psa/admin/plib/modules/wp-toolkit/vendor/wp-cli/wpt-wp-cli.php ] && echo VISIBLE || echo MISSING'

    The SOURCE column must show wp-toolkit/vendor/wp-cli without wp-toolkit-old- or //deleted, and the second command must print VISIBLE.

  • Source: Zendesk ticket 96096063, escalated in PPS-19432. Bug PPPM-15580 is in status New, with no fix version or ETA.
  • Reproduced in a lab on CloudLinux 9.8, Plesk 18.0.81, cagefs 7.6.49, upgrading WP Toolkit 6.11.4 to 6.11.5. A manual swap of the directory (copy, rename, move, delete) gives the same result.
  • After the upgrade the skeleton mount points to wp-toolkit-old-<timestamp>/vendor/wp-cli//deleted and the skeleton inode differs from the host inode. cagefsctl --update --do-not-ask --silent leaves it stale, cagefsctl --remount-all repairs it even with a cage process running. WP Toolkit maintenance and --force-update are not needed.
  • The ! line in /etc/cagefs/cagefs.mp is added by WP Toolkit maintenance (a read-only bind mount of vendor/wp-cli into the skeleton), not an exclusion. It is not the cause of this issue.
  • The "Device or resource busy" error on removal of the old directory was seen on the customer servers but not reproduced in the lab.
  • The remount was verified only in the lab, not on customer servers.
Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.