Trellis Breaks After latest Mac OSX Update?

I ran today’s OSX update and now vagrant up and vagrant provision no longer works:

==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2222
    default: SSH username: vagrant
    default: SSH auth method: private key
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
    default: The guest additions on this VM do not match the installed version of
    default: VirtualBox! In most cases this is fine, but in rare cases it can
    default: prevent things such as shared folders from working properly. If you see
    default: shared folder errors, please make sure the guest additions within the
    default: virtual machine match the version of VirtualBox you have installed on
    default: your host and reload your VM.
    default:
    default: Guest Additions Version: 5.0.26
    default: VirtualBox Version: 5.1
==> default: Setting hostname...
==> default: Configuring and enabling network interfaces...
==> default: Exporting NFS shared folders...
==> default: Preparing to edit /etc/exports. Administrator privileges will be required...
Password:
==> default: Mounting NFS shared folders...
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

mount -o vers=3,udp 192.168.50.1:/Users/Mark/Sites/Hi/hi/site /vagrant-nfs-hybridinteractive.io

Stdout from the command:



Stderr from the command:

mount.nfs: requested NFS version or transport protocol is not supported

I’ve even destroyed a box and started fresh although that didn’t change anything. I even ran a composer update && composer install as I was receiving another error regarding a missing composer.json file.

I even tried updating trellis/roles/users/templates/sudoers.d.j2 to:

# {{ ansible_managed }}

{% for service in web_sudoers %}
{{ web_user }} ALL=(root) NOPASSWD: {{ service }}
{% endfor %}

vagrant ALL=(ALL) NOPASSWD:ALL
Defaults:vagrant !requiretty

Per this post https://github.com/mitchellh/vagrant/issues/1659

Running vagrant up --provision

Gives me these errors:

TASK [wordpress-install : Install Dependencies with Composer] ******************
System info:
  Ansible 2.3.0.0; Vagrant 1.9.4; Darwin
  Trellis at "Auto-install Vagrant plugins"
---------------------------------------------------
Composer could not find a composer.json file in
/srv/www/hybridinteractive.io/current To initialize a project, please create
a composer.json file as described in the https://getcomposer.org/ "Getting
Started" section
failed: [default] (item=hybridinteractive.io) => {"failed": true, "item": "hybridinteractive.io", "stdout": "Composer could not find a composer.json file in /srv/www/hybridinteractive.io/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/hybridinteractive.io/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/Mark/Sites/Hi/hi/trellis/dev.retry

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

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

Any thoughts?

I just vagrant up on another box and didn’t get any errors but get a 500 Internal Server Error now. Upon vagrant provision I get this on the other box:

System info:
  Ansible 2.3.0.0; Vagrant 1.9.4; Darwin
  Trellis at "Auto-install Vagrant plugins"
---------------------------------------------------
Composer could not find a composer.json file in
/srv/www/hybridinteractive.io/current To initialize a project, please create
a composer.json file as described in the https://getcomposer.org/ "Getting
Started" section
failed: [default] (item=hybridinteractive.io) => {"failed": true, "item": "hybridinteractive.io", "stdout": "Composer could not find a composer.json file in /srv/www/hybridinteractive.io/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/hybridinteractive.io/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/Mark/Sites/Hi/hi/trellis/dev.retry

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

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

I’m not finding anything on Google which isn’t surprising since the OSX update is so new. This is the last time I run an update so new. It didn’t seem like such a big jump so I didn’t even think about it. #LessonLearned

Sorry to hear you’re having troubles. Are you on 10.12.6?

I’m not having any problems, I’m on 10.12.6, Ansible 2.2.0, Vagrant 1.8.6

I’m curious, do you have file vault turned on? I haven’t heard of this happening on macOS for whatever reason, but your issue sounds similar to this one. That user is on Ubuntu, and I also have a Linux laptop and have experienced it as well, on Fedora I think.

Maybe it does happen on macOS, I don’t know, I don’t have file vault turned on on my mac, but if you do maybe try moving your project outside of your home directory.

Good luck!

Is the composer.json file in place? Typically it would be in example.com/site on your local/host machine and the Vagrant process syncs it into place on the VM at /srv/www/example.com/current.

Do you have this directory structure, with a Bedrock-based project at example.com/site?

example.com/
├── trellis/
    ├── group_vars/development/wordpress_sites.yml  # defines `local_path: ../site`
    └── dev.yml        # `vagrant provision` runs this
└── site/
    └── composer.json  # this is in `../site` relative to `dev.yml`

That local_path variable in group_vars/development/wordpress_sites.yml tells Vagrant where to find the Bedrock files to sync into the VM. If your local_path value isn’t correct, or you don’t have a Bedrock project (with composer.json) at the local_path specified, you’ll encounter the Composer could not find a composer.json file error.

If you have to adjust the local_path value, you probably will need to vagrant reload the sync directories.

To elaborate both machines worked fine before this fiasco.

I’m disabling this now. We’ll see what happens! Hmm it won’t let me turn it off. It was on previously before though, so I don’t think that would be it.

It’s in the local setup but nothing was found under /current. I think that’s the problem. On my working computer all the needed files are there! How do I get those back?

Great catch, but I’m curious how those files got wiped in the first place!

I re-cloned trellis, setup my config files then went to vagrant up and still getting this:

==> default: Mounting NFS shared folders...
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

mount -o vers=3,udp 192.168.50.1:/Users/Mark/Sites/Hi/hi/site /vagrant-nfs-hybridinteractive.io

Stdout from the command:



Stderr from the command:

mount.nfs: requested NFS version or transport protocol is not supported

I fixed the NFS via uncommenting 127.0.0.1 localhost in my etc/hosts I’m not sure how that happened but now am getting this error:

TASK [wordpress-install : Install Dependencies with Composer] ******************
System info:
  Ansible 2.3.0.0; Vagrant 1.9.7; Darwin
  Trellis at "Accommodate child themes: Update WP `stylesheet_root` separately"
---------------------------------------------------
Composer could not find a composer.json file in
/srv/www/hybridinteractive.io/current To initialize a project, please create
a composer.json file as described in the https://getcomposer.org/ "Getting
Started" section
failed: [default] (item=hybridinteractive.io) => {"failed": true, "item": "hybridinteractive.io", "stdout": "Composer could not find a composer.json file in /srv/www/hybridinteractive.io/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/hybridinteractive.io/current", "To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ \"Getting Started\" section"]}

So I’m back to my other issue again. I’ll try reinstalling trellis again.

2 Likes

That fixed it! What PITA :slight_smile:

Thanks for the help!

Good job figuring it out! I’ve always avoided touching the 127.0.0.1 localhost entry in my /etc/hosts. I’m glad to learn one of the consequences if that is missing.

Thanks for reporting your solution. Now we’ll have one more suggestion for people who encounter issues with NFS mounts, Vagrant sync dirs, and the Composer could not find a composer.json file issue.

I think it had to do with MAMP Pro too but will be something to keep an eye on!

Do you know what causes having to constantly provision the server? I run gulp --production, deploy the site, then my local doesn’t work until i provision it. Just seems like a clunky way of gulping/deploying, etc.

Steps to reproduce:

  • Make SCSS changes
  • gulp --production
  • ./bin/deploy.sh production hybridinteractive.io
  • vagrant up – local doesn’t work
  • vagrant provision – local does work

Why is this?

Let’s terminate this thread, not pursuing here an additional topic of SCSS, gulp, etc. I’ll respond here, but if you’d like to continue this new topic, please start a new thread.

I’ve never heard of it being required to vagrant up or vagrant provision after running gulp or after deploying to production. I don’t contest that doing so appears to resolve some issue for your setup, but I’m confident you can prevent the problem or at least resolve it in any easier manner.

First, perhaps you already knew that when deploying, you do not need to manually run gulp if you have set up a deploy hook to run it for you as part of your deploy. Trellis includes a default build-before.yml hook to run yarn for Sage 9, but you can use this prior version to run gulp if you use Sage 8.5. You would need to uncomment the tasks and potentially edit paths (e.g., to include proper theme name).

Second, you probably already know that gulp builds different filenames than gulp --production:

# examples of CSS file names
gulp                 --->  main.css
gulp --production    --->  main-52ca131438.css

I’m not sure the specifics you’re encountering when you say “local doesn’t work,” but perhaps it has to do with CSS styles not being read or not changing. You could check for browser caching issues, CSS filename changes that aren’t being picked up in your browser, etc. Perhaps it would help to simply run plain gulp (without --production) to rebuild the main.css file and to refresh filenames in dist/assets.json.

There is a lot of searchable info on the topics above. I’d encourage you to dig in to understand the various pieces and steps involved and the problem you’re encountering will likely become apparent.