a8cteam51 / team51-cli

1 stars 1 forks source link

`wpcom:run-site-wp-cli-command` fails on large number of our Atomic sites #50

Open NickGreen opened 1 week ago

NickGreen commented 1 week ago

Synopsis

When running team51 wpcom:run-site-wp-cli-command on a high percentage of our Atomic sites (40%?), it fails with this error:

❌ API error (500 https://opsoasis.wpspecialprojects.com/wp-json/wpcomsp/wpcom/v1/site-ssh-users/XXXXXXXX): {"code":403,"message":"Forbidden","data":null}
❌ Could not find the WordPress.com site SSH username.
Could not connect to the SSH server

To duplicate

  1. Run team51 wpcom:run-site-wp-cli-command redacted.com 'wp plugin list' on a site for which our user doesn't have the "Hosting" menu item in wp-admin.
  2. See error in terminal

Details

When running a support session with our team user, and logging into wp-admin, we have a large number of sites for which our user doesn't have the "Hosting" nav menu item. These are the sites where we aren't able to get SSH access, and for which the command fails.

Sites that have that menu item allow SSH access, and the command works as expected.

Please contact @NickGreen if you need a list of our Atomic sites for which this command isn't working.

NickGreen commented 1 day ago

Noting here that the Atomic sites for which this command fails seem to have two characteristics:

  1. Our user is not the owner of the blog
  2. SSH creds are still accessible through https://wordpress.com/hosting-config/yourwebsite.com