This is probably trivial, but googling brought nothing.

I moved my aliases for a particular site from the drush/aliases dir to the site root. I am passing this project on and need all resources packaged and functional as a (practically) standalone dist. However, Drush commands all fail now. I tried an rsync, but Drush is having trouble with the aliases. I performed a site-alias and everything look legit.

$ drush site-alias
@self
@base
@dev
@stage
@remote
@prod
default

$ drush -v rsync @dev @stage
Load alias @stage
Load alias @dev
Load alias @stage
Could not evaluate source path @dev.
An error occurred at function : drush_core_rsync
Command dispatch complete

Please advise,
T

Comments

greg.1.anderson’s picture

Status: Active » Postponed (maintainer needs more info)
JoeAndrieu’s picture

Title: Alias Not Working » Alias Not Working (for drush rsync)
Status: Postponed (maintainer needs more info) » Needs work

I'm having this same problem. I can get rsync to work by itself, but drush rsync is failing miserably. I'm trying to track down where it's failing in the code, with partial success. For some reason site_settings isn't getting set when evaluating the path.

"Could not evaluate source path @dev." That's only one place in the entire codebase and it fails because something in the alias parsing comes back null, despite a lack of parsing errors.

Here's the alias file I'm using :

$aliases['dev'] = array(
    'uri' => 'local.example.com',
    'root' => '/home/user/repository/web',
    'path-aliases' => array(
                   '%dump-dir' => '/home/user/repository/db.bak',
                   ),
);

$aliases['live'] = array(
    'root' => '/home/user/repository/web',
    'uri' => 'example.com',
    'remote-host' => 'example.com',
    'remote-user' => 'user',
  );

fwiw, both drush @dev status and drush @live status work great.

also, it is definitely failing preflight, but I haven't figured out if that's where the problems at yet.

greg.1.anderson’s picture

Version: All-versions-3.3 »
Status: Needs work » Postponed (maintainer needs more info)

Try with today's master; just checked in code yesterday that changes this code path. Don't see anything in #2 that looks wrong; not enough info to help here.

JoeAndrieu’s picture

Status: Postponed (maintainer needs more info) » Needs work

I'm still having the same problem, even with a fresh git pull.

I'll dive back into the code and see if I can isolate why it is failing.

greg.1.anderson’s picture

Status: Needs work » Postponed (maintainer needs more info)

Resetting status; there is no patch here, so 'needs work' not appropriate.

JoeAndrieu’s picture

Status: Postponed (maintainer needs more info) » Active

Ok. I haven't been able to find where the problem is, but I do have more information.

With the latest HEAD (9f79815),
drush rsync @dev @live
Fails with
Could not evaluate source path @dev.

Using the previously posted alias file.

However, the following non-aliased rsync works:
drush rsync /home/user/repository/web/ user@example.com:/home/user/repository/web

In the process I did find and fix a number of permissions errors, most likely from me using sudo when I didn't need to and apparently shouldn't have. With those fixed, the non-aliased version works. But perhaps there are other permissions errors that might be causing this? That's the only lead I have at the moment...

p.s.
apologies about the status mistake. Is "active" the right status when I've provided more information?

greg.1.anderson’s picture

Status: Active » Postponed (maintainer needs more info)

Yes, it is correct to set the status to 'active' when you have provided more information. Unfortunately, there's still not enough information to help. Where are you storing your alias file, and what is its filename called? Can you run drush sa @dev and drush sa @live successfully? I infer that sa must work, since status does. Are you using today's master, or at least Drush-5RC2?

JoeAndrieu’s picture

Status: Postponed (maintainer needs more info) » Active

The file is in sites/all/drushand is named sitealiases.drushrc.php.

Both drush sa @dev and drush sa @live return the expected arrays.

I'm using the latest head from git,

From http://git.drupal.org/project/drush
   540af76..04cd9ae  7.x-4.x    -> origin/7.x-4.x
   9f79815..e48b9ab  master     -> origin/master
Updating 9f79815..e48b9ab
Fast-forward
 examples/example.bashrc |    2 +-
JoeAndrieu’s picture

Status: Active » Postponed

Ok. I got it working.

I'll add some notes for others with this problem in a few minutes. I just want to check a few things to make sure I understand why it works now.

JoeAndrieu’s picture

Status: Postponed » Closed (works as designed)

These were mostly newbie issues, but I'll post a few of the problems I ran into so others can find this if they get that error in the future.

First, I definitely had permissions errors trying to rsync. I didn't realize that until I got rsync working on its own, independent of drush. So get the equivalent rsync working first.

Second, getting it to work without the aliases also helped a lot. Do that.

Third, use drush sa often. I was sure I had sa working, but it turns out that for some period of time, it was not. I believe this was because I had the aliases file in a location that worked for drush 4.4 and not for the latest version.

Fourth, get the latest drush. In this case, the HEAD is fairly stable (I asked around), but it won't always be. I confirmed by testing my live server that the old drush (4.4) failed when the new drush (HEAD from git) worked.

Finally, be careful when testing to not confuse the live and dev servers. This may be obvioius, but I definitely lost some time thinking I was testing with the latest drush on @dev when in fact, I was still on @live which didn't even have the sitealiases file. Newbie mistake. =)

Much thanks to greg.1.anderson! Your timely help on this was not only on spot, but it also helped keep me motivated to push through rather than getting frustrated that I wasn't getting anywhere. Thanks!

I closed this, as I think the latest rev works as designed.