When Drush just isn't working on your deployed site, make sure you've deployed your composer.json file

Is Drush status finding Drush but acting like it can’t find the website?

$ drush @test status
 PHP binary    : /usr/bin/php7.2                                                        
 PHP config    : /etc/php/7.2/cli/php.ini                                               
 PHP OS        : Linux                                                                  
 Drush script  : /home/members/example/sites/test.example.org/web/vendo
 Drush version : 9.7.2                                                                  
 Drush temp    : /tmp                                                                   
 Drush configs : /home/members/example/sites/test.example.org/web/vendo
drush @test uli

In Process.php line 235:

  The command "ssh -o PasswordAuthentication=no exampletest@jacobs.mayfirst.org 'env PAT  
  usr/local/bin:/usr/bin:/bin /home/members/example/sites/test.example.org/  
  web/vendor/bin/drush user-login  --uri=https://test.example.org --root=/home/memb  
  ers/example/sites/test.example.org/web/web'" failed.                       

  Exit Code: 1(General error)                                                                

  Working directory:                                                                         


  Error Output:                                                                              

  In BootstrapManager.php line 275:                                                          

    We could not find an applicable site for that command.                                   

  user:login [--name [NAME]] [--uid [UID]] [--mail [MAIL]] [--browser [BROWSER]] [--redirec  
  t-port REDIRECT-PORT] [--no-browser] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|-  
  -version] [--ansi] [--no-ansi] [-n|--no-interaction] [-d|--debug] [-y|--yes] [--no] [--re  
  mote-host REMOTE-HOST] [--remote-user REMOTE-USER] [-r|--root ROOT] [-l|--uri URI] [--sim  
  ulate] [--pipe] [-D|--define DEFINE] [--xh-link XH-LINK] [--druplicon] [--notify [NOTIFY]  
  ] [--] <command> [<path>]                        

All that can be fixed simply by making sure your composer.json is deployed with your site.

A separate problem you may run into:

[error] TypeError: Return value of Doctrine\Common\Annotations\AnnotationRegistry::reset() must be an instance of Doctrine\Common\Annotations\void, none returned in Doctrine\Common\Annotations\AnnotationRegistry::reset()

is caused by the command line version of PHP that Drush is using not matching the version the site was built for (and, one hopes, the web server is using).

Here’s a way to fix that, in your Drush aliases:

  host: example.mayfirst.org
    drush-script: /home/members/example/sites/example.org/web/vendor/bin/drush
  root: /home/members/example/sites/example.org/web/web
  uri: 'https://edit.example.org'
  user: example
    PATH: /home/members/example/sites/example.org/users/example/bin:/usr/local/bin:/usr/bin:/bin

The key addition is the env-vars path, which adds an environment variable to tell Drush which PHP to use from command line. This is using standard May First Movement Technology setup but you can put your own symlink to the correct version of PHP in any bin folder you choose to point to.