Jetpack Upgrade fails with WP CLI

Been trying to upgrade Jetpack from the admin for a few times on my site on a shared package with my hosted Dreamhost. It failed too often. I emailed on issues upgrading before and they suggested I use WP CLI so I did. But now I got this error:

wp plugin update jetpack
Downloading update from https://downloads.wordpress.org/plugin/jetpack.2.9.3.zip...
Unpacking the update...
Installing the latest version...
Removing the old version of the plugin...
Warning: Could not remove the old plugin.
Plugin update failed.

Sounded like there could perhaps be a permission issue even though I never had this before. So I checked permissions for the plugins folder I have:

Read More
drwxrwxr-x 10 me pgxxxxxx 4096 Apr 10 17:53 plugins

which is OK.

But when I checked the plugin itself I saw that the plugin now has root as owner.

drwxrwxr-x 7 root    root       4096 Apr  7 19:38 jetpack

So that is a permission issue as my user is not root and sudo is not possible on shared servers with Dreamhost.

Does WP CLI do this conversion to root on upgrades? Is there a way to make sure it does not change the user and group during an upgrade? Is there perhaps also a verbose option to get a more specific error message? the --debug option did not help so I guess that is for php errors only.

Related posts

Leave a Reply

1 comment

  1. Well apparently WP CLI was run as root by someone else and caused all the permissions to be overwritten. Normally WP CLI does not run as root automatically. Dreamhost has acknowledged this and restored permissions so I can update things again.