Bug report - silent failure when pulling and cloning site using wpengine without keys

Bug Summary

When pulling a copy of an environment or cloning a new site, if the ssh key used by local has been removed from WPEngine the pull/clone fails but local says everything is successful.

Steps to reproduce

Fresh setup (no existing sites or connections):

  1. Log into WPEngine and generate an API key & secret (https://my.wpengine.com/profile/api_access).
  2. Install & configure Local.
  3. In Local connect to wpengine. Provide the api key & secret. Local will create a new key for it’s use in https://my.wpengine.com/profile/ssh_keys
  4. In Local click cloud/connect and pull a site. Everything should be working at this point.
  5. Follow the existing site instructions below to replicate the issue.

Existing setup:

  1. Sync your Local instance.
  2. Log into WPEngine.
  3. In WPEngine go to https://my.wpengine.com/profile/ssh_keys and delete the key Local created. Leave the API ID and secret intact/alone in https://my.wpengine.com/profile/api_access.
  4. Make some change in your WP website for testing purposes.
  5. In Local pull from your environment.

The expected behavior is that Local should report the lack of communication capability with WPEngine and error out.

The actual behavior is that Local will say it’s successful but your test change will not appear. If you delete your public contents in local and pull again nothing will appear. If you delete your entire site and recreate it, Local will say the clone is successful but there will be no files and most folders won’t exist. The only folders that appear are “.wpe-devkit” and “_wpeprivate”.

Environment Info

Windows 10, fully patched, UAC fully disabled (not required for reproducing the issue)
Nginx (latest)
PHP 7.4.x (latest) or PHP 8.x (latest)
Mysql (latest)
Local 6.5.2+6204 (latest)

Supporting info

I’m not providing the log since I’ve just spent 2 hrs finding the issue, fixing it, and documenting it. Get your own logs by following the reproduction steps.