Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

site-install fails when site alias doesn't have defined root #4059

Open
danepowell opened this issue May 3, 2019 · 8 comments
Open

site-install fails when site alias doesn't have defined root #4059

danepowell opened this issue May 3, 2019 · 8 comments

Comments

@danepowell
Copy link
Contributor

Describe the bug
When running drush si with an alias that has no root defined in Drush 9.6.2, you get an exception as described below. This seems to be related to a change in consolidation/site-alias, although I'm not clear on the full history: acquia/blt#3204

To Reproduce
Start from a vanilla Drupal codebase. Create a file drush/sites/foo.site.yml:

local:
  uri: foo

Now run drush @foo.local si.

(You don't actually need to set up sites.php or anything, since the site-install fails long before that.)

Expected behavior
Site to install.

Actual behavior

In SiteAliasTrait.php line 30:
Site alias @foo.local does not specify a root.

Workaround
Define a root in the alias file (which is specific to the local machine and not useful across teams). Use the workarounds described in acquia/blt#3204 (comment)

System Configuration

Q A
Drush version? 9.6.2
Drupal version? 8.7.0
PHP version 7.2
OS? Mac/Linux

Additional information
Using site aliases without a defined root is useful when you want to share local multisite aliases across teams for the purposes of installing a particular site (i.e. mostly just defining a uri).

@dpagini
Copy link

dpagini commented Jul 31, 2019

Sort of random note, but I found that in BLT's case (which passes site URI via drush config file), the VALUE of the root can be set to anything and the command will still work. It just needs it set to something. I found that a little odd.

@greg-1-anderson greg-1-anderson removed their assignment Jul 31, 2019
@greg-1-anderson
Copy link
Member

Pull requests welcome - I probably won't have time to get to this for a while.

@dpagini
Copy link

dpagini commented Jul 31, 2019

I'd love to help @greg-1-anderson but I now get a "talking to" at my employer for contributing code to the community.

¯_(ツ)_/¯ 🤦‍♂

@geek-merlin
Copy link
Contributor

geek-merlin commented Oct 7, 2019

We also want this as we have aliases without root.

EDIT: We want to ssh to aliases without root.

@geek-merlin
Copy link
Contributor

geek-merlin commented Oct 7, 2019

Trivial PR flying in: consolidation/site-alias#37

I can now do drush @foo ssh on such an alias.

EDIT: Said PR has a wrong approach.

@geek-merlin
Copy link
Contributor

As clarified in the abandoned PR, the ssh use case has a different fix that this. So opened #4211.

@geek-merlin
Copy link
Contributor

On site-install: TBH, i do not see where drush should install when no root is given.

@greg-1-anderson
Copy link
Member

Presumably at the cwd.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants