Stderr: Composer could not find a composer.json file in /var/www/localhost/current


TASK: [wordpress-install | Install Dependencies with Composer] **************** 
failed: [default] => (item={'key': 'localhost', 'value': {'site_install': True, 'admin_user': 'admin', 'local_path': '../site', 'system_cron': True, 'cache': {'duration': '30s', 'enabled': False}, 'repo': '', 'ssl': {'enabled': False}, 'multisite': {'enabled': True, 'subdomains': False}, 'site_title': 'DEV EN', 'admin_password': 'admin', 'env': {'db_name': 'marketplace_dev_db', 'wp_env': 'development', 'db_user': 'marketplace_dev_usr', 'db_password': 'marketplace_dev_pw', 'wp_home': 'http://localhost', 'wp_siteurl': 'http://localhost/wp'}, 'site_hosts': ['localhost'], 'admin_email': ''}}) => {"changed": true, "cmd": ["composer", "install"], "delta": "0:00:00.041336", "end": "2015-09-07 07:55:27.592594", "item": {"key": "localhost", "value": {"admin_email": "", "admin_password": "admin", "admin_user": "admin", "cache": {"duration": "30s", "enabled": false}, "env": {"db_name": "marketplace_dev_db", "db_password": "marketplace_dev_pw", "db_user": "marketplace_dev_usr", "wp_env": "development", "wp_home": "http://localhost", "wp_siteurl": "http://localhost/wp"}, "local_path": "../site", "multisite": {"enabled": true, "subdomains": false}, "repo": "", "site_hosts": ["localhost"], "site_install": true, "site_title": "DEV EN", "ssl": {"enabled": false}, "system_cron": true}}, "rc": 1, "start": "2015-09-07 07:55:27.551258", "stdout_lines": [], "warnings": []}
stderr: Composer could not find a composer.json file in /var/www/localhost/current
To initialize a project, please create a composer.json file as described in the "Getting Started" section

FATAL: all hosts have already failed -- aborting

PLAY RECAP ******************************************************************** 
           to retry, use: --limit @/Users/fabianhenzler/dev.retry

default                    : ok=87   changed=59   unreachable=0    failed=1   

Ansible failed to complete successfully. Any error output should be
visible above. Please fix these errors and try again.

I changed the root folder here

apt_cache_valid_time: 86400
default_timezone: Etc/UTC
www_root: /var/www/
hhvm:  false

Unfortunately if you change your www_root there’s another place you’d have to change in development in your Vagrantfile:

I might be able to make this part of the Vagrantfile dynamic so this isn’t required.

Ran into the same problem as @fabianhenzler using the latest version of Trellis and the default settings

www_root: /srv/www

I’ll update this comment if I figure out what’s wrong…


Not sure what caused this but it’s some change between release 0.9.0 and commit 6c8d891.

The problem was that provisioning didn’t find the files for the Bedrock project. An empty directory was deployed to the server at the correct path with an empty “current” directory.

I had strong hopes I’d found the issue when I saw that local_path: local_path: '../' now is written as local_path: local_path: ../ (without ').

But that didn’t help. So I ended up destroying the box and provisioning a new one and that worked.

Hi, Just trying to get trellis to configure itself. Running into a similar problem. Please advise on how to proceed.

TASK: [wordpress-install | Install Dependencies with Composer] ****************
failed: [default] => (item={‘key’: ‘’, ‘value’: {‘site_install’: True, ‘admin_user’: ‘admin’, ‘local_path’: ‘…/site’, ‘cache’: {‘duration’: ‘30s’, ‘enabled’: False}, ‘repo’: ‘’, ‘ssl’: {‘enabled’: False}, ‘multisite’: {‘enabled’: False, ‘subdomains’: False}, ‘site_title’: ‘Example Site’, ‘admin_password’: ‘admin’, ‘env’: {‘db_name’: ‘example_dev’, ‘db_user’: ‘example_dbuser’, ‘wp_env’: ‘development’, ‘db_password’: ‘example_dbpassword’, ‘disable_wp_cron’: True, ‘wp_home’: ‘’, ‘wp_siteurl’: ‘’}, ‘site_hosts’: [‘’], ‘admin_email’: ‘’}}) => {“changed”: true, “cmd”: [“composer”, “install”], “delta”: “0:00:00.054489”, “end”: “2015-11-04 05:42:20.677648”, “item”: {“key”: “”, “value”: {“admin_email”: “”, “admin_password”: “admin”, “admin_user”: “admin”, “cache”: {“duration”: “30s”, “enabled”: false}, “env”: {“db_name”: “example_dev”, “db_password”: “example_dbpassword”, “db_user”: “example_dbuser”, “disable_wp_cron”: true, “wp_env”: “development”, “wp_home”: “”, “wp_siteurl”: “”}, “local_path”: “…/site”, “multisite”: {“enabled”: false, “subdomains”: false}, “repo”: "", “site_hosts”: [“”], “site_install”: true, “site_title”: “Example Site”, “ssl”: {“enabled”: false}}}, “rc”: 1, “start”: “2015-11-04 05:42:20.623159”, “stdout_lines”: [], “warnings”: []}
stderr: Composer could not find a composer.json file in /srv/www/
To initialize a project, please create a composer.json file as described in the “Getting Started” section

Sorry if this is a entry level question.

What’s your question?

sorry, @kalenjohnson. I got the error messages above when running vagrant provision. I think all that i need to do is re- download the bedrock and sage git repositories into the /site folder and then run composer to get them new sage site with bedrock created. Am on on the right track?

Apologies for reviving an old thread but I appear to be having the same issues as @serveit. Empty current directory, inability to find the composer.json file. Destroying and reprovisioning doesn’t help. this same error has occurred both when trying to configure Trellis from the documentation as well as when trying to set up straight from github. I’m a newbie (sorry), but any suggestions as to how to fix this (or where I can home in on the issue) would be v. much appreciated! Thank you to anyone who can help!

I’m having the same problem!

@lukeabell let me know if you find out what the issue is, and I’ll do the same. @swalkinshaw any hints would be super-appreciated. I’ve seen that this issue has come up before but I don’t think anyone has posted any conclusive solutions/fixes yet …

There’s no single reason/bug that would cause this so without more information it’s impossible to say.

I’m also closing this thread since the original problem was because of someone wanting to customize www_root. This is not the thread to post if you get that error message for any other reason.

I rant into this issue too. The solution for me was to downgrade my Vagrant to version 1.8.1.

1 Like