Error deploying new development environment

Cloned the roots-example-project.com repo and trying to spin up a new development environment in Vagrant. Got a weird error during the playbook run:

==> default: TASK: [wordpress-install | Change site owner to user] *************
************
==> default: failed: [127.0.0.1] => (item={'key': 'dimensionsixdesign.com', 'val
ue': {'site_install': True, 'admin_user': '[REDACTED]', 'local_path': '../site', 'sys
tem_cron': True, 'repo': 'git@github.com:roots/bedrock.git', 'ssl': {'enabled':
False}, 'multisite': {'enabled': False, 'subdomains': False}, 'site_title': 'Dim
ension Six Design', 'admin_password': '[REDACTED]', 'env': {'db_name': 'd6d_dev', 'wp
_env': 'development', 'db_user': 'd6d_dbuser', 'db_password': 'd6d_dbpassword',
'wp_home': 'http://d6d.dev', 'wp_siteurl': 'http://d6d.dev/wp'}, 'site_hosts': [
'd6d.dev'], 'admin_email': 'romero@dimensionsixdesign.com'}}) => {"failed": true
, "item": {"key": "dimensionsixdesign.com", "value": {"admin_email": "romero@dim
ensionsixdesign.com", "admin_password": "[REDACTED]", "admin_user": "[REDACTED]", "env": {
"db_name": "d6d_dev", "db_password": "d6d_dbpassword", "db_user": "d6d_dbuser",
"wp_env": "development", "wp_home": "http://d6d.dev", "wp_siteurl": "http://d6d.
dev/wp"}, "local_path": "../site", "multisite": {"enabled": false, "subdomains":
 false}, "repo": "git@github.com:roots/bedrock.git", "site_hosts": ["d6d.dev"],
"site_install": true, "site_title": "Dimension Six Design", "ssl": {"enabled": f
alse}, "system_cron": true}}, "parsed": false}
==> default: BECOME-SUCCESS-yafabbhzwdjlpndqvzzvakuigmhaxagw
==> default: Traceback (most recent call last):
==> default:   File "/root/.ansible/tmp/ansible-tmp-1435596089.36-49684638982748
/file", line 2005, in <module>
==> default:     main()
==> default:   File "/root/.ansible/tmp/ansible-tmp-1435596089.36-49684638982748
/file", line 291, in main
==> default:     changed |= recursive_set_attributes(module, file_args['path'],
follow, file_args)
==> default:   File "/root/.ansible/tmp/ansible-tmp-1435596089.36-49684638982748
/file", line 132, in recursive_set_attributes
==> default:     changed |= module.set_fs_attributes_if_different(tmp_file_args,
 changed)
==> default:   File "/root/.ansible/tmp/ansible-tmp-1435596089.36-49684638982748
/file", line 1194, in set_fs_attributes_if_different
==> default:     file_args['path'], file_args['owner'], changed
==> default:   File "/root/.ansible/tmp/ansible-tmp-1435596089.36-49684638982748
/file", line 996, in set_owner_if_different
==> default:     orig_uid, orig_gid = self.user_and_group(path)
==> default:   File "/root/.ansible/tmp/ansible-tmp-1435596089.36-49684638982748
/file", line 919, in user_and_group
==> default:     st = os.lstat(filename)
==> default: OSError: [Errno 2] No such file or directory: '/srv/www/dimensionsi
xdesign.com
==> default: /current/web/app/themes/d6d/node_modules/gulp-imagemin/node_modules
/imagemin/node_modules/imagemin-gifsicle/node_modules/gifsicle/node_modules/bin-
build/node_modules/decompress/node_modules/decompress-tar/node_modules/strip-dir
s/node_modules/is-absolute'
==> default:
==> default:
==> default: FATAL: all hosts have already failed -- aborting
==> default:
==> default: PLAY RECAP ********************************************************
************
==> default:            to retry, use: --limit @/root/dev.retry
==> default:
==> default: 127.0.0.1                  : ok=67   changed=37   unreachable=0
failed=1

Looking at the stack trace, is it because the playbook created /srv/www/d6d.dev (for the dev environment) but was looking for /srv/www/(actual site)? I left the site name as the finished site in the variable file so it would be consistent across all stages, was this not correct?

What does your group_vars/development look like?

mysql_root_password: devpw

web_user: vagrant

wordpress_sites:
  dimensionsixdesign.com:
    site_hosts:
      - d6d.dev
    local_path: '../site' # path targeting local Bedrock project directory (relative to Ansible root)
    repo: git@github.com:roots/bedrock.git
    site_install: true
    site_title: Dimension Six Design
    admin_user: [REDACTED]
    admin_password: [REDACTED]
    admin_email: romero@dimensionsixdesign.com
    multisite:
      enabled: false
      subdomains: false
    ssl:
      enabled: false
    system_cron: true
    env:
      wp_home: http://d6d.dev
      wp_siteurl: http://d6d.dev/wp
      wp_env: development
      db_name: d6d_dev
      db_user: d6d_dbuser
      db_password: d6d_dbpassword

php_error_reporting: 'E_ALL'
php_display_errors: 'On'
php_display_startup_errors: 'On'
php_track_errors: 'On'
php_mysqlnd_collect_memory_statistics: 'On'
php_opcache_enable: 0

xdebug_install: false
php_xdebug_remote_enable: true
php_xdebug_remote_connect_back: true
php_xdebug_remote_host: localhost
php_xdebug_remote_port: 9000
php_xdebug_remote_log: /tmp/xdebug.log
php_xdebug_idekey: XDEBUG
php_max_nesting_level: 200

It’s trying to find a file named /srv/www/dimensionsi xdesign.com ==> default: /current/web/app/themes/d6d/node_modules/gulp-imagemin/node_modules /imagemin/node_modules/imagemin-gifsicle/node_modules/gifsicle/node_modules/bin- build/node_modules/decompress/node_modules/decompress-tar/node_modules/strip-dir s/node_modules/is-absolute

That sounds like race condition city or something. Since it’s so weird can you try vagrant destroy and vagrant up?

I’ve seen an error like that if npm install didn’t finish or didn’t finish successfully. Generally it’s in one of those image packages.

This brings up an interesting point, how are you having npm run during vagrant up?

I’m on a Windows machine, so I’m using the windows.sh script to run the playbooks from within the Vagrant VM.

What happens if you vagrant destroy, remove node_modules, then vagrant up?
(running npm install only after the vagrant vm is set up)

Same error happened. When I modified the wordpress_sites key to be the d6d.dev url and the playbook ran without a problem, but now I have a different problem. When I go to the wp-admin URL for the dev environment, it won’t take the password I set in the answer file.