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

Unable to boot VM after following instructions in CONTRIBUTING.md for local BLT development setup #2890

Closed
ba66e77 opened this issue Jun 20, 2018 · 6 comments
Labels
Bug Something isn't working

Comments

@ba66e77
Copy link
Contributor

ba66e77 commented Jun 20, 2018

My system information:

  • Operating system type: OSX
  • Operating system version: 10.13.5
  • BLT version: 9.x

When I follow the directions in CONTRIBUTING.md to set up an environment for developing BLT locally, when running vagrant up in the resulting environment, booting the VM fails with the following errors:

failed: [blted8] (item=../../../acquia/blt/scripts/drupal-vm/configure-solr.sh) => {"changed": false, "item": "../../../acquia/blt/scripts/drupal-vm/configure-solr.sh", "msg": "Could not find or access '../../../acquia/blt/scripts/drupal-vm/configure-solr.sh'\nSearched in:\n\t/vagrant/vendor/geerlingguy/drupal-vm/provisioning/files/../../../acquia/blt/scripts/drupal-vm/configure-solr.sh\n\t/vagrant/vendor/geerlingguy/drupal-vm/provisioning/../../../acquia/blt/scripts/drupal-vm/configure-solr.sh\n\t/vagrant/vendor/geerlingguy/drupal-vm/provisioning/files/../../../acquia/blt/scripts/drupal-vm/configure-solr.sh\n\t/vagrant/vendor/geerlingguy/drupal-vm/provisioning/../../../acquia/blt/scripts/drupal-vm/configure-solr.sh"}
failed: [blted8] (item=../../../acquia/blt/scripts/drupal-vm/post-provision.php) => {"changed": false, "item": "../../../acquia/blt/scripts/drupal-vm/post-provision.php", "msg": "Could not find or access '../../../acquia/blt/scripts/drupal-vm/post-provision.php'\nSearched in:\n\t/vagrant/vendor/geerlingguy/drupal-vm/provisioning/files/../../../acquia/blt/scripts/drupal-vm/post-provision.php\n\t/vagrant/vendor/geerlingguy/drupal-vm/provisioning/../../../acquia/blt/scripts/drupal-vm/post-provision.php\n\t/vagrant/vendor/geerlingguy/drupal-vm/provisioning/files/../../../acquia/blt/scripts/drupal-vm/post-provision.php\n\t/vagrant/vendor/geerlingguy/drupal-vm/provisioning/../../../acquia/blt/scripts/drupal-vm/post-provision.php"}

It appears there are two factors causing this:

  1. No NFS mount is provisioned for the symlinked blt directory, so the VM is unable to access the blt directory at all.
  2. When I edit the box/config.yml to include a mount beside the path where blted8 is mounted, vagrant gets the symlinked path of '../../../blt' and still ends up looking in the wrong place.
@ba66e77 ba66e77 added Bug Something isn't working 9.1.x labels Jun 20, 2018
@ba66e77
Copy link
Contributor Author

ba66e77 commented Jun 22, 2018

Well, I've got a work around at least. I had to add the blt directory in two separate places in the VM. Adding the below to the vagrant_synced_folders array in box/config.yml did the job.

  -
    local_path: ../blt
    destination: /var/www/blt
    type: nfs
  -
    local_path: ../blt
    destination: /blt
    type: nfs

@ba66e77
Copy link
Contributor Author

ba66e77 commented Jun 22, 2018

The work around I described above is encoded in PR #2900. I don't love it, but don't have a better solution at the moment.

@ba66e77
Copy link
Contributor Author

ba66e77 commented Jun 24, 2018

At least one other user has told me they do not have the same issue, even after confirming we're using the same versions of BLT, vagrant, and virtualbox.

Can anyone replicate the problems I'm seeing?

@danepowell
Copy link
Contributor

danepowell commented Jun 26, 2018

Yes, I get the same error when following the same steps. For what it's worth, I don't see where CONTRIBUTING.md* implies that this should work, although it obviously would be nice if it did.

It looks like BLT is fairly clever and tries to mount itself in Vagrant in a way that you can traverse the symlink both on the host and in the VM. But for the purposes of the post-provision script, the mount doesn't work, because the post-provision scripts execute from the /vagrant directory instead of /var/www/blted8.

Note that /vagrant and /var/www/blted8 have the exact same contents (the project root directory on the host), but it appears they are mounted separately for whatever reason. It's problematic because BLT is mounted as a sibling of /var/www/blted8 at /var/www/blt but not as a sibling of /vagrant at /blt, so the symlink fails.

It seems like the solution is force DrupalVM to run the scripts from /var/www/blted8, either by specifying the full path of the post-provision scripts in box/config.yml, or by changing DrupalVM's default behavior (not sure where it comes from).

*For anyone else following along at home, the new location for CONTRIBUTING.md is https://github.com/acquia/blt/blob/9.x/docs/CONTRIBUTING.md

ba66e77 added a commit that referenced this issue Jul 28, 2018
@ba66e77 ba66e77 closed this as completed Jul 28, 2018
@AshwinParmar
Copy link

AshwinParmar commented Oct 19, 2021

If you are using BLT Version 12.x or Higher the path of the directory got changed to acquia/blt-drupal-vm/scripts/drupal-vm

  • BLT 12.x onwards all the plugins are separated.

So you need to chnage the PATH of file inside box/config.yml

post_provision_scripts:
  - "../../../acquia/blt-drupal-vm/scripts/drupal-vm/configure-solr.sh"
  - "../../../acquia/blt-drupal-vm/scripts/drupal-vm/post-provision.php"

@cballenar
Copy link

Correction, third line is also to a .sh file. It should be:

post_provision_scripts:
  - "../../../acquia/blt-drupal-vm/scripts/drupal-vm/configure-solr.sh"
  - "../../../acquia/blt-drupal-vm/scripts/drupal-vm/post-provision.sh"

At least that was my case with BLT 12.8.2.

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

4 participants