Closed (fixed)
Project:
Drush
Version:
All-versions-4.x-dev
Component:
Core Commands
Priority:
Major
Category:
Bug report
Assigned:
Reporter:
Created:
7 Jun 2011 at 20:57 UTC
Updated:
16 Jun 2012 at 21:11 UTC
drush rsync @mysite.stage:%files sites/default/files
Results in
You will destroy data from /mysite/sites/default/files and replace with data from @mysite.stage:/mysite/%files
Which is obviously fails as @mysite.stage is not a valid host.
Flipping the command to
drush rsync sites/default/files @mysite.stage:%files
Works just fine.
Tried to debug a bit, but I'm not familiar with Drush internals and got lost. I think the problem is occurring in _drush_sitealias_get_record().
Comments
Comment #1
levelos commentedAm I the only one out there seeing this? Seems rather significant to not have the core rsync command working when using site aliases.
Comment #2
moshe weitzman commentedThe issue submission guidelines ask you to provide paste in the output of your command when run with --debug. That shows what drush is calling internally. In the case of rsync, you can alternatively run with --simulate and you see the bash without actually running it.
Comment #3
levelos commentedSure thing Moshe, here you go:
Comment #4
greg.1.anderson commentedWorks for me on drush-5.x-dev. Try with today's master; if it does not work, then post your 'mysite' aliases file.
Comment #5
levelos commentedGetting the same output with the latest 5.x-dev. Must be something I'm missing in my aliases file. Snippet:
Comment #6
greg.1.anderson commentedDid you update your drush on the remote side as well? Drush will contact the remote side to fill in path aliases that do not exist in the site alias record. One bug I did find when investigating #5 is that drush is ignoring %files inside path aliases. The only time I saw "@alias:%files" was when the backend invoke to the remote drush failed. Maybe a combo of these two bugs is getting you, although if that is the case, then I cannot explain why it would work when the alias is in the target position.
Comment #7
levelos commentedThanks for the follow up Greg. The remote host in this case doesn't actually have Drush installed, it's an old legacy shared host. Do you need Drush on the remote host in order to run rsync?
What paths need to be included in the alias to avoid engaging Drush on the remote host? Although if %files is ignored, then the problem will still exist ...
Comment #8
greg.1.anderson commentedCorrect; you have your alias file set up correctly, but for some reason drush tries to contact the remote site to determine what the value of %files should be. Since you don't have drush there, you get hit by the bug in #6. Once that bug is fixed, you won't need drush on the remote side.
Comment #9
greg.1.anderson commentedFixed in master; commit http://drupalcode.org/project/drush.git/commit/8a29871
Could be back-ported to drush-4.x if desired.
Comment #10
msonnabaum commentedBackported.