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

Manual setup required for sync:refresh #1875

Closed
danepowell opened this issue Aug 2, 2017 · 2 comments
Closed

Manual setup required for sync:refresh #1875

danepowell opened this issue Aug 2, 2017 · 2 comments
Labels
Enhancement A feature or feature request

Comments

@danepowell
Copy link
Contributor

My system information:

  • Operating system type: Ubuntu
  • Operating system version: 17.04
  • BLT version: 8.9

Output of blt doctor:
all green

When I run this command:

sync:refresh

I get the following output:

Executing command blt sync:refresh --define drush.alias=self inside of Drupal VM...
> sync
> sync:db
> setup:settings
[Acquia\Blt\Robo\Tasks\DrushTask] Running /var/www/foo/vendor/bin/drush cache-clear drush --uri=default && /var/www/foo/vendor/bin/drush sql-drop --uri=default && /var/www/foo/vendor/bin/drush sql-sync @foo.test @foo.local --structure-tables-key=lightweight --create-db --sanitize --uri=default && /var/www/foo/vendor/bin/drush cache-clear drush --uri=default in /var/www/foo/docroot
'drush' cache was cleared.                                             [success]
Do you really want to drop all tables in the database drupal? (y/n): y
The external command could not be executed due to an application         [error]
error.
The command could not be executed successfully (returned: Host key       [error]
verification failed.
, code: 255)
Error: no database record could be found for source @foo.test          [error]
[Acquia\Blt\Robo\Tasks\DrushTask]  Exit code 1  Time 2.331s
[error]   
[error]  Command `sync:db ` exited with code 1. 
[error]  Command `sync ` exited with code 1. 

And I expected this to happen:
Sync to complete without error

Basically, BLT is executing the sync command from within the VM, which generally doesn't have access to the host machine's private SSH keys, so the attempt to connect to the remote server (ACE) fails.

To work around this, I enabled SSH key forwarding on my host machine by adding this to ~/.ssh/config:

host 192.168.16.245
  ForwardAgent yes

However, this isn't a very sustainable solution. Ideally blt sync:refresh would just work OOTB without any additional setup required. This could be achieved by simply running the command outside the VM. If manual setup is required, it should be documented.

@grasmash grasmash added the Enhancement A feature or feature request label Aug 3, 2017
@gabe-connolly
Copy link
Contributor

@grasmash I think there are still some issues to work out with blt sync. When I try to run it locally, I get the following error:

Permission denied (publickey). , code: 255)
[error] Error: no database record could be found for source @dev
[Acquia\Blt\Robo\Tasks\DrushTask]  Exit code 1  Time 7.334s
[error]  Command `sync:db ` exited with code 1. 
[error]  Command `sync ` exited with code 1. 

When I was dumping out the $annotation_data in executeInDrupalVm(), I kept getting true even after trying the edit in #1877 . To get blt sync to do a full database copy from the remote server, I also had to remove @executeInDrupalVm from the rest of the Sync tasks:

  • SyncCommand.php
  • DbCommand.php

@danepowell danepowell reopened this Aug 7, 2017
@danepowell
Copy link
Contributor Author

Developers on our project are also reporting that even with the above commit/patch, they are still getting the error.

Following the steps described by @gabe-connolly (i.e. executing everything related to sync on the host machine rather than vm) solves it.

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

No branches or pull requests

3 participants