Copied from #1896132-18: Getting "No graphical display appears to be available, not starting browser." error with drush qd (core-quick-drupal)

The 'handle-remote-commands' flag can be set in a command record that tells drush to run drush @remote uli on the local machine instead of the remote machine. The local implementation of uli could then check to see if the alias was remote, and if so, use drush_invoke_process() to run uli remotely. It would then be easy enough to open a browser window to the url returned from backend invoke.

See the implementation of the ssh command for details. Patches welcome, but it should probably be a separate issue.

Comments

moshe weitzman’s picture

Status: Active » Fixed

Committed to 6.x in bb9bfd8. I'm gunshy about backporting to 5.x so I'm calling this Fixed.

greg.1.anderson’s picture

Status: Fixed » Needs review
StatusFileSize
new891 bytes

This is totally awesome! I think that the call to drush_get_option is spurrious, though; it worked when I ran with --browser, but failed trying to do a local dispatch with --browser undefined. I think that the attached patch is what was intended.

moshe weitzman’s picture

Status: Needs review » Reviewed & tested by the community

thanks.

greg.1.anderson’s picture

Status: Reviewed & tested by the community » Fixed

Pushed to 8.x-6.x.

moonray’s picture

Status: Fixed » Active

I'm not sure if this is on related to this issue, but with remote uli I get the following

(@somealias.dev) ~ $ drush uli
DRUSH_BACKEND:{"type":"bootstrap","message":"Bootstrap to phase 0.","timestamp":1371384783.047,"memory":8719056,"error":null,"packet":"log"}

DRUSH_BACKEND:{"type":"bootstrap","message":"Bootstrap to phase 6.","timestamp":1371384783.0734,"memory":8723392,"error":null,"packet":"log"}

DRUSH_BACKEND:{"type":"bootstrap","message":"Drush bootstrap phase : _drush_bootstrap_drupal_root()","timestamp":1371384783.0749,"memory":8725992,"error":null,"packet":"log"}

DRUSH_BACKEND:{"type":"notice","message":"Initialized Drupal 7.22 root directory at .","timestamp":1371384783.1241,"memory":11702552,"error":null,"packet":"log"}

DRUSH_BACKEND:{"type":"bootstrap","message":"Drush bootstrap phase : _drush_bootstrap_drupal_site()","timestamp":1371384783.1258,"memory":11704872,"error":null,"packet":"log"}

DRUSH_BACKEND:{"type":"notice","message":"Initialized Drupal site dev.sulweb.gotpantheon.com at sites\/default","timestamp":1371384783.1262,"memory":11706632,"error":null,"packet":"log"}

DRUSH_BACKEND:{"type":"debug","message":"Cache MISS cid: 5.1-commandfiles-2-c32acd775c18a90c5b41d0fc9accf5ab","timestamp":1371384783.1498,"memory":11709416,"error":null,"packet":"log"}

DRUSH_BACKEND:{"type":"debug","message":"Cache SET cid: <em class=\"placeholder\">5.1-commandfiles-2-c32acd775c18a90c5b41d0fc9accf5ab<\/em>","timestamp":1371384783.1529,"memory":11713472,"error":null,"packet":"log"}

DRUSH_BACKEND:{"type":"bootstrap","message":"Drush bootstrap phase : _drush_bootstrap_drupal_configuration()","timestamp":1371384783.1541,"memory":11710032,"error":null,"packet":"log"}

DRUSH_BACKEND:{"type":"bootstrap","message":"Drush bootstrap phase : _drush_bootstrap_drupal_database()","timestamp":1371384783.1603,"memory":11726560,"error":null,"packet":"log"}

DRUSH_BACKEND:{"type":"bootstrap","message":"Successfully connected to the Drupal database.","timestamp":1371384783.1606,"memory":11727688,"error":null,"packet":"log"}

DRUSH_BACKEND:{"type":"bootstrap","message":"Drush bootstrap phase : _drush_bootstrap_drupal_full()","timestamp":1371384783.1727,"memory":12471496,"error":null,"packet":"log"}

DRUSH_BACKEND:{"type":"debug","message":"Cache MISS cid: 5.1-commandfiles-5-ff272a5b6c415671bcf731a8eefc6f9d","timestamp":1371384783.5777,"memory":52852256,"error":null,"packet":"log"}

DRUSH_BACKEND:{"type":"debug","message":"Cache SET cid: <em class=\"placeholder\">5.1-commandfiles-5-ff272a5b6c415671bcf731a8eefc6f9d<\/em>","timestamp":1371384783.6703,"memory":52861792,"error":null,"packet":"log"}

DRUSH_BACKEND:{"type":"bootstrap","message":"Drush bootstrap phase : _drush_bootstrap_drupal_login()","timestamp":1371384783.6796,"memory":53657176,"error":null,"packet":"log"}

DRUSH_BACKEND:{"type":"bootstrap","message":"Successfully logged into Drupal as Anonymous (uid=0)","timestamp":1371384783.7042,"memory":55004208,"error":null,"packet":"log"}

DRUSH_BACKEND:{"type":"bootstrap","message":"Found command: user-login (commandfile=user)","timestamp":1371384783.7047,"memory":55003936,"error":null,"packet":"log"}

http://dev.somealias.com/user/reset/1/8321186782/ACweYyCXLHu1R5pKhQ6UE2yxC2Md_cam3wgw2jiipL4
DRUSH_BACKEND:{"type":"notice","message":"Command dispatch complete","timestamp":1371384783.7673,"memory":55475544,"error":null,"packet":"log"}

DRUSH_BACKEND:{"type":"memory","message":"Peak memory usage was 54.32 MB","timestamp":1371384783.7678,"memory":55473008,"error":null,"packet":"log"}http://dev.somealias.com/user/reset/1/8321186782/ACweYyCXLHu1R5pKhQ6UE2yxC2Md_cam3wgw2jiipL4

Should I be getting that kind of output?

greg.1.anderson’s picture

What version of Drush do you have on the remote side? You could try updating the remote Drush to the latest dev -- although I'm pretty sure that I've used this feature with an older Drush without trouble. Are you using the latest dev on your local machine? That's the most important thing; won't work otherwise.

moonray’s picture

I'm using latest dev on local.
I'm using an older (probably 5) on remote.

drush uli works (it opens the browser and everything), I just get a lot of extra data spit out by the CLI when running on a remote site, which I don't get when running it on a local site.

greg.1.anderson’s picture

Status: Active » Fixed

You should be able to get rid of the output from #5 if you update your remote host to the latest Drush-8.x-6.x-dev. For the uli command, this output should be innocuous.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.