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

Running BLT VM did not generate Drush Alias File After Drush 9 Update #2466

Closed
mikemadison13 opened this issue Jan 20, 2018 · 9 comments
Closed
Labels
Bug Something isn't working

Comments

@mikemadison13
Copy link
Contributor

My system information:

  • Operating system type: Mac OS
  • Operating system version: 10.11.6
  • BLT version: 9.0.0-alpha2

Output of blt doctor:

blt doctor
Drupal VM was detected. Running blt doctor inside of VM...
Executing command cd /var/www/<project>/docroot/.. && /var/www/<project>/docroot/../vendor/bin/drush cc drush && /var/www/<project>/docroot/../vendor/bin/drush --include=/var/www/<project>/docroot/../vendor/acquia/blt/drush blt-doctor -r /var/www/<project>/docroot/../docroot inside of Drupal VM...
 [success] 'drush' cache was cleared.

                     
  [Exception]        
  Bootstrap failed.  
                     

blt:doctor [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-d|--debug] [-y|--yes] [--no] [--remote-host REMOTE-HOST] [--remote-user REMOTE-USER] [-r|--root ROOT] [-l|--uri URI] [--simulate] [--pipe] [-D|--define DEFINE] [--druplicon] [--notify] [--xh-link XH-LINK] [--] <command>

Connection to 127.0.0.1 closed.
Attempting to run doctor on host machine...

When I run this command:

blt vm

And I expected this to happen:
I expected that the Drush 9 alias file would be generated for the new local / vm, but it was not.

@mikemadison13 mikemadison13 changed the title Running BLT VM did not generate Drush Alias File Running BLT VM did not generate Drush Alias File After Drush 9 Update Jan 20, 2018
@mikemadison13
Copy link
Contributor Author

digging into this, i believe the issue is that I had drush_server_home() in my old site alias file.

I think we need to expand our documentation in drush/sites/README.md to help people troubleshoot this. It is unclear to me if BLT VM was necessary in this instance, or if blt update should have addressed this (re: #2437). However, as far as I can tell, I had to manually remove drush_server_home() from the alias file, then move the file, then run the drush command to get a local alias.

see: https://github.com/acquia/blt/pull/2241/files

@mikemadison13
Copy link
Contributor Author

mikemadison13 commented Jan 20, 2018

note that once i have the valid alias file, i am not getting:
Permission denied (publickey,password).

This may be related to geerlingguy/drupal-vm#1595 ?

any thoughts @geerlingguy ?

@grasmash
Copy link
Contributor

The upgrade hook should have actually created new Drush alias files in a Yaml format. Did that happen?

@mikemadison13
Copy link
Contributor Author

no, i had to manually run the drush command, and that didn't generate anything for the local. the documentation sounds like running drupal vm will (and that didn't either)

@grasmash grasmash added the Bug Something isn't working label Jan 22, 2018
@grasmash
Copy link
Contributor

#2471

@grasmash
Copy link
Contributor

Needs real world testing, but should address issue.

@mikemadison13
Copy link
Contributor Author

@grasmash i'll re-run the upgrade and see what happens. will report back.

@mikemadison13
Copy link
Contributor Author

mikemadison13 commented Jan 23, 2018

@grasmash good news, the update ran. bad news, the alias files were still not generated automatically. the legacy file was created though. Here are the additional steps I had to take...

  1. chmod my legacy file (it failed)
Copying files from BLT's template into your project...
Merging BLT's project.yml template with your project's blt/project.yml...
The following BLT updates are outstanding:
 - update_9000000: Convert Drush 8 files to Drush 9.

 Would you like to perform the listed updates? (y/n) y
Executing updates...
-> update_9000000: Convert Drush 8 files to Drush 9.
[error]  Failed to chmod file "legacy.aliases.drushrc.php". 
Removing deprecated files and directories...
> install-alias
[warning] Your BLT schema is out of date.
  1. manually re-run blt update (this didn't error out, but it also didn't crate my drush aliases)

  2. manually run drush site:alias-convert (it failed)
    Error: Call to undefined function drush_server_home() in <project>/drush/site-aliases/legacy.aliases.drushrc.php on line 373

  3. manually remove drush_server_home in favor of $HOME

  4. manually run drush site:alias-convert (it succeeded)

shall i push some documentation that covers these steps? or do we need to open a new issue and further refine the automated update?

@grasmash grasmash reopened this Jan 23, 2018
@mikemadison13
Copy link
Contributor Author

it would appear that the root cause of this issue is the drush_server_home() variable in the legacy file. I'm going to push a PR that strips this inline during the update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants