geerlingguy / drupal-vm

A VM for Drupal development
https://www.drupalvm.com/
MIT License
1.37k stars 646 forks source link

example.drupal.composer.json installer paths don't match default drupal_composer_install_dir #1351

Closed ctrladel closed 7 years ago

ctrladel commented 7 years ago

Issue Type

Your Environment

Vagrant 1.8.6
VirtualBox 5.1.6_Ubuntur110634
ansible 2.3.0.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = Default w/o overrides
  python version = 2.7.12+ (default, Sep 17 2016, 12:08:02) [GCC 6.2.0 20160914]

Your OS

Full console output

https://gist.github.com/ctrladel/3efde4e2f676fc8251257f68335f959e

Summary

Was trying to provision a new vm using the example.drupal.composer.json and ran into the below error. Looks like the installer paths in example.drupal.composer.json don't match up with the path provided in the default config file for drupal_composer_install_dir.

Error from the gist:


fatal: [d8com]: FAILED! => {"changed": false, "failed": true, "failed_when_result": true, "module_stderr": "Shared connection to 127.0.0.1 closed.\r\n", "module_stdout": "Traceback (most recent call last):\r\n  File \"/tmp/ansible_50_kGc/ansible_module_command.py\", line 220, in <module>\r\n    main()\r\n  File \"/tmp/ansible_50_kGc/ansible_module_command.py\", line 163, in main\r\n    os.chdir(chdir)\r\nOSError: [Errno 2] No such file or directory: '/var/www/drupalvm/drupal/web'\r\n", "msg": "MODULE FAILURE", "rc": 0}```
geerlingguy commented 7 years ago

@ctrladel - Thanks for filing the issue! I'll try to take a look in a little bit after I wrap up a couple other things here at the DrupalCon sprints.

ctrladel commented 7 years ago

Changing the paths in example.drupal.composer.json to use web instead of docroot fixed my issue

    "extra": {
        "installer-paths": {
            "web/core": ["type:drupal-core"],
            "web/modules/contrib/{$name}": ["type:drupal-module"],
            "web/profiles/contrib/{$name}": ["type:drupal-profile"],
            "web/themes/contrib/{$name}": ["type:drupal-theme"],
            "drush/contrib/{$name}": ["type:drupal-drush"]
        }
    },
joestewart commented 7 years ago

Yes the documentation does mention changing drupal_core_path to use docroot instead of web. It might be more simple to change the example.drupal.composer.json as above and update documentation.

http://docs.drupalvm.com/en/latest/deployment/composer/

ctrladel commented 7 years ago

I'd agree with changing the json file since I was able to get to that error by just reading what was in the config file. Having that second step hidden in the docs is not very obvious.

geerlingguy commented 7 years ago

@joestewart / @ctrladel - Thanks for confirming! I'll try to get to this today, or if someone else wants to take a stab at a PR before me, please feel free to do so. I'm working on the Docker issue currently.