A Modern WordPress Example

My first time working with roots tools and I got your Modern Wordpress Example example working locally as is, but haven’t had success yet when going through the whole process from start to finish as outlined in the readme. Various errors pop up - usually when installing some of the requirements.

One in particular: I’m having a bit of a problem in the scenario of starting a different project folder besides the first folder I started in. The error occurs when running ‘vagrant up’ at the point where it tries exporting NFS shared folders. The error says they are non-existant because it is looking for them in the path of the previous projects folder.

Do I need to manually change a line in Vagrantfile? Do I need to uninstall/reinstall vagrant-bindfs?

Thanks!

Not exactly sure what you’re doing but vagrant reload should redo the synced folders. Or you can always destroy and re-up.

Working now - reload/destroy didn’t work but reinstalling bindfs did and that makes me think I originally installed it in the wrong place.

That and fixing a couple of other things I did wrong and I’ve got my local dev all up and running! I’m definitely the “If I can do it anybody can” guy.

1 Like

HI, I am not using Digital Ocean, Is deploying a project to Siteground (for example) is as easy as using Digital Ocean as host?

Thanks.

Hi there!

I’m trying to set up local instance of roots-example-project. My environment is macOS, homebrew, virtualbox.

When doing vagrant up for the first time there were some errors related to logrotate component, however VM starts OK, vagrant ssh works just fine.

When I check /etc/nginx/nginx.conf, I see that does include sites-enables/* (which is expected), however in sites-enabled I’m seeing only no-default.conf - which is configured to immediately return 444, and no traces of references to WP installation (which is as I understand is under /srv/www/…)

Am I missing something?

Thanks for great work, I’m looking for development environment for WP, and Roots stack looks excellent (or rather amazing I would say), it’s just learning curve seems quite steep for me.

Thanks in advance,
Vladimir

If you got an error it might mean not everything ran. Can you try running vagrant provision again? Or destroy it and re-up. Seeing the error messages would help.

swalkinshaw, hi!

I’m getting this error (tried to destroy VM and re-up again, problem reproduced):

TASK [logrotate : nickhammond.logrotate | Install logrotate] *******************
ok: [default]

TASK [logrotate : nickhammond.logrotate | Setup logrotate.d scripts] ***********
System info:
  Ansible 2.2.2.0; Vagrant 1.9.3; Darwin
  Trellis at "WP 4.6 Compat: set WP_HOME/SITEURL directly"
---------------------------------------------------
the field 'args' has an invalid value, which appears to include a variable
that is undefined. The error was:
'ansible.vars.unsafe_proxy.AnsibleUnsafeText object' has no attribute 'name'

The error appears to have been in '/Users/vegorov/roots.io/roots-example-
project.com/trellis/vendor/roles/logrotate/tasks/main.yml': line 5, column 3,
but may
be elsewhere in the file depending on the exact syntax problem.

The offending line appears to be:


- name: nickhammond.logrotate | Setup logrotate.d scripts
  ^ here

fatal: [default]: FAILED! => {"failed": true}

RUNNING HANDLER [common : restart memcached] ***********************************
changed: [default]

and finally:

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

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

VM goes up, I can ssh to it, nginx and mysql are running.

On a diffenet note - I’ve noticed also that php7.0-fpm is not running: systemctl status php7.0-fpm.service tells that it’s failed, in tail /var/log/php7.0-fpm.log I’m seeing "No pool defined"error - but again, it may be because both issues have same root cause.

Tried vagrant provision and got php-fpm related error:

TASK [php : Start php7.0-fpm service] ******************************************
System info:
  Ansible 2.2.2.0; Vagrant 1.9.3; Darwin
  Trellis at "WP 4.6 Compat: set WP_HOME/SITEURL directly"
---------------------------------------------------
Unable to start service php7.0-fpm: Job for php7.0-fpm.service failed because
the control process exited with error code. See "systemctl status
php7.0-fpm.service" and "journalctl -xe" for details.

fatal: [default]: FAILED! => {"changed": false, "failed": true}
        to retry, use: --limit @/Users/vegorov/roots.io/roots-example-project.com/trellis/dev.retry

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

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

Thanks

That’s a really strange error. My first suggestion is to try another version of Ansible. Did you install via pip or Homebrew?

Maybe try version 2.2.0.0.

edit: to be clear, the other issues you’re experiencing are expected because the playbook stops after that error so it’s not finished yet.

You could also temporarily remove the logrotate role if you want to just get past this for now:

diff --git a/dev.yml b/dev.yml
index 156e7fe..18282a7 100644
--- a/dev.yml
+++ b/dev.yml
@@ -16,7 +16,7 @@
     - { role: xdebug, tags: [php, xdebug] }
     - { role: memcached, tags: [memcached] }
     - { role: nginx, tags: [nginx] }
-    - { role: logrotate, tags: [logrotate] }
+    #- { role: logrotate, tags: [logrotate] }
     - { role: composer, tags: [composer] }
     - { role: wp-cli, tags: [wp-cli] }
     - { role: wordpress-setup, tags: [wordpress, wordpress-setup] }
diff --git a/requirements.yml b/requirements.yml
index 15c9e89..45c12f9 100644
--- a/requirements.yml
+++ b/requirements.yml
@@ -6,9 +6,9 @@
   src: geerlingguy.ntp
   version: 1.3.0
 
-- name: logrotate
-  src: nickhammond.logrotate
-  version: e7a498d
+#- name: logrotate
+  #src: nickhammond.logrotate
+  #version: e7a498d
 
 - name: swapfile
   src: kamaln7.swapfile

@vegorov When I search discourse for the logrotate error you posted…

Regarding your version of Trellis at "WP 4.6 Compat: set WP_HOME/SITEURL directly", it looks like it is probably from Sept 2016. You may want to update your Trellis, which would likely also prevent the no pool defined error.

I’m finally figured out what was wrong - I’ve git-cloned example project repository instead of cloning trellis and bedrock from corresponding repos. Example repo has trellis and bedrock installations, but not latest, obviously.

Newly created project with up to date trellis and bedrock provisioned successfully and all runs as expected.

A lot of stuff is very new to me - I’m kinda in copy-paste mode with regard to stuff like ansible, npm, yarn, etc etc, but it’s a different story.

I’ve installed (seemingly) sage and built it, so I’ve reached good starting point.

Thanks!

2 Likes