Local by Flywheel overriding Trellis in /etc/exports file

TASK [wordpress-install : Install Dependencies with Composer] ******************
System info:
  Ansible 2.4.1.0; Vagrant 2.0.1; Darwin
  Trellis at "Fix `raw_vars` functionality for Ansible 2.4.1"
---------------------------------------------------
Composer could not find a composer.json file in
/srv/www/alexvalenz.com/current To initialize a project, please create a
composer.json file as described in the https://getcomposer.org/ "Getting
Started" section
failed: [default] (item=alexvalenz.com) => {"changed": false, "failed": true, "item": "alexvalenz.com", "stdout": "Composer could not find a composer.json file in /srv/www/alexvalenz.com/current\nTo initialize a project, please create a composer.json file as described in the https://getcomposer.org/ \"Getting Started\" section\n", "stdout_lines": ["Composer could not find a composer.json file in /srv/www/alexvalenz.com/current", "To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ \"Getting Started\" section"]}
        to retry, use: --limit @/Users/adrianvalenzuela/Sites/alexvalenz.com/trellis/dev.retry

PLAY RECAP *********************************************************************
default                    : ok=91   changed=1    unreachable=0    failed=1

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

This is the error message I get. I’m not sure what do do here.

https://discourse.roots.io/search?q=Composer%20could%20not%20find%20a%20composer.json%20file

Thanks @ben, I read over these already and nothing is really helping. I did every step and different steps…

  • etc/hosts address has been uncommented
  • vagrant plugin update, vagrant destroy, vagrant up…
  • fixed conflicting files in etc/exports…
  • i have a composer.phar file already…

I don’t know…

If someone knows what is going on and give me an idea from their mind to what could be happening in addition to links that would be great. Links I can find on my own. I feel people assume all questions are made by people that don’t search, when I search a lot…days with this issue, I’m trying to learn Roots workflow b/c it is intriguing to me and I want to have a better experience with WordPress, but this isn’t helping.

Do the following please:

  1. vagrant ssh
  2. cd /srv/www/alexvalenz.com/current

Tell us/paste the contents of that directory and the folder structure.

Also describe the directory structure on your local (host) machine. Does it follow the example in our docs? https://roots.io/trellis/docs/installing-trellis/

2 Likes

We’re happy to hear it. When people post on the forum with just an error and say “This is the error message I get. I’m not sure what do do here.”, we don’t know any of that. We also don’t have much to go on to help you.

2 Likes

Hey @swalkinshaw, Yes it follows the directory and the system requirements are installed. Under the current directory there was just an empty directory called web and a .env file with the correct variables for the db_password, site, login and all that…but that was it. No composer file…am I to manually install or create one there too, b/c the docs make no mention of that.

I understand @kalenjohnson that you don’t have much to go to help me, which is why I would expect follow up questions from people who do know what they are doing to help me figure it out. I am learning this Roots toolset, I’m following the docs to a “t”, and when I or others post an error and only saying “I don’t know what to do here”, it’s b/c it’s all I got back from the computer too. I don’t know what else more I can say or what other information I can give, much less what to look for, unless I’m asked so I can provide it. An alternative I can think of is just writing a huge page full of what could be unrelated info like the machine I’m on or editor or whatever. I like what @swalkinshaw did and gave me something to look for so I can help me help me, I much prefer that than people seeing my simple error code and question and just moving on. I don’t know…I’m just really frustrated. ha

This means that Vagrant shared folder feature hasn’t worked apparently. Vagrant “shares” (syncs) the root directory on your host machine to the virtual machine. If that isn’t working, nothing will.

Please do the following in your trellis project directory:

  • vagrant destroy
  • rm -rf .vagrant
  • vagrant up

Then copy and paste the entire Vagrant log in here.

I tried those commands but now nothing at all shows up beneath the /srv/ directory

I’m getting the vagrant log

Where would I find the log you need at? I’m still unfamiliar with this Vagrant software, having second thoughts :confused:

Just to triple check, and I think the answer is yes, but does your mac (the “host” machine; not the VM) have the bedrock files in example.com/site directory, including the composer.json file? See discussion (and how local_path variable functions). If the files are not there, you need to clone bedrock to that site directory and vagrant reload --provision

If the files (including composer.json) are present in the site directory on your mac (host machine), it indeed suggests a problem with the syncing of site into the VM at current. You mentioned that the “etc/hosts address has been uncommented.” I hope that means you do have a 127.0.0.1 localhost entry in your /etc/hosts, which would affect whether the nfs sync dirs work (details). If you had to uncomment or add this entry, you may then need to repeat some steps you’ve tried such as vagrant destroy, double-check /etc/exports, etc., maybe even uninstall and reinstall vagrant.

As for vagrant log, you could just post the output that appears in your console when you run vagrant up. In rare cases of investigating tricky vagrant issues, you can boost the verbosity of the vagrant output, e.g., with vagrant up --debug (vagrant debugging details), which also mention option to output to log file: vagrant up --debug &> vagrant.log).

I do not see the same composer.json issue when I do a fresh vagrant up with the same specs:

System info:
  Ansible 2.4.1.0; Vagrant 2.0.1; Darwin
  Trellis at "Fix `raw_vars` functionality for Ansible 2.4.1"

Here is a link to a gist of the vagrant log/output on my console right before the error: https://gist.github.com/adrianvalenz/c71b9e41626cedebece1c264d3e3c3e6

I tried making a new site and I really don’t know what is going on.

@fullyint I’m about to read your latest reply now

Hope its ok to share this.

So it is uncommented, but always has been.

The composer.json file is in example.com/site in my “host” machine, not VM.
The local_path does point to ../site

I’ve tried vagrant destroy and double-checking /etc/exports and all… :confused: I’m really stumped :*(

Oh and here is the vagrant.log with the --debug option
https://gist.github.com/adrianvalenz/49a0e341f90ae69906df1c067502ff15

@swalkinshaw @fullyint

I just now uninstalled and reinstalled vagrant via homebrew, and only reinstalled virtualbox…

If I can’t figure this out in the next hour, this is too much stress and I’m not even sure if I will like the workflow, such a bummer. I am still interested in using Bedrock and I have enjoyed Sage for months now, but I just really want a nice workflow that I can enjoy in a similar way when developing Rails applications. I see the value of WordPress for end users/clients, but dev workflow for years has been disgustingly sloppy, which is why I really want this Trellis to work…even if I get it working, I still have to figure out if I can use it with Dokku or just plain DigitalOcean. I know I have more headaches to come.

You need a server running a bare/stock version of Ubuntu 16.04 Xenial. If you’re using a host such as DigitalOcean, then just select their Ubuntu 16.04 option.

2 Likes