drupal-vm icon indicating copy to clipboard operation
drupal-vm copied to clipboard

Execution of the target buildfile failed (BLT)

Open jestinijames opened this issue 9 years ago • 4 comments

Bug Report / Support Request

Your Environment

Vagrant 1.9.5
Vbox 5.1.22r115126
ansible 2.3.0.0

Your OS

Windows 10 Enterprise edition

Full console output

blt > local:sync:db: 'drush' cache was cleared. [success] Do you really want to drop all tables in the database drupal? (y/n): y Error: no alias record could be found for source @cgi.test [error] [phingcall] /var/www/cgi/./vendor/acquia/blt/phing/tasks/local-sync.xml:54:8: /var/www/cgi/./vendor/acquia/blt/phing/tasks/local-sync.xml:57:29: Drush exited with code 1

BUILD FAILED/var/www/cgi/./vendor/acquia/blt/phing/tasks/local-sync.xml:20:22: Execution of the target buildfile failed. Aborting. ; 2 minutes 58.33 seconds

Summary

After I have built my vm on my system, I did a 'blt local:setup' to get the database installed. After a while of installation, i got the above error and the setup stopped. Do you know what could be the cause?

jestinijames avatar Jun 05 '17 09:06 jestinijames

The actual error seems to be through Drush:

Error: no alias record could be found for source @cgi.test [error]

Do you have Drush aliases added to your site's codebase, inside drush/site-aliases/aliases.drushrc.php?

In most of my BLT sites, I have an alias like:

if (!isset($drush_major_version)) {
  $drush_version_components = explode('.', DRUSH_VERSION);
  $drush_major_version = $drush_version_components[0];
}
// Site CLIENTNAME, environment test
$aliases['CLIENTNAME.test'] = array(
  'root' => '/var/www/html/CLIENTNAME.test/docroot',
  'ac-site' => 'CLIENTNAME',
  'ac-env' => 'test',
  'ac-realm' => 'prod',
  'uri' => 'stage.CLIENTNAME.com',
  'remote-host' => 'staging-12345.prod.hosting.acquia.com',
  'remote-user' => 'CLIENTNAME.test',
  'path-aliases' => array(
    '%drush-script' => 'drush' . $drush_major_version,
    '%content-sync' => '/mnt/www/html/CLIENTNAME.stg/acquia-files/content'

  )
);

geerlingguy avatar Jun 05 '17 15:06 geerlingguy

I tried that. It didn't fix it. The same error outputs. When I do a blt local:setup. the error i get is Unexpected error during import with operation create for search_api.index.content: Field field_domain_access is unknown. Error while sending QUERY packet. PID=8771 Statement.php:59

jestinijames avatar Jun 07 '17 07:06 jestinijames

From a couple of other threads I searched, I used the command drush @cgi.test status and I got the below result:

vagrant@local:/var/www/cgi/docroot$ drush @cgi.test status Warning: Identity file /home/vagrant/.vagrant.d/insecure_private_key not accessible: No such file or directory. Permission denied (publickey,password).

Do you think that could be the reason?

jestinijames avatar Jun 07 '17 14:06 jestinijames

@jestinijames - Usually that means the Drush alias file you're using is configured to only be used outside of Drupal VM. I know BLT in more recent versions changed the way it builds Drush aliases so they'll work correctly either inside or outside the VM:

https://github.com/acquia/blt/blob/8.x/scripts/drupal-vm/drupal-vm.aliases.drushrc.php

I think everything else seems to be working on Drupal VM's side. It sounds like the rest of the issues you're encountering may be coming from your project's BLT integration. Can you follow-up in that issue queue with any further questions? See: https://github.com/acquia/blt/issues

geerlingguy avatar Jun 07 '17 21:06 geerlingguy