Local Pressbooks development, errors during provisioning

Hey there,

I’m trying to set up a local pressbooks-dev instance using the instructions found here. All is well until I run vagrant up to provision the environment.

The first error I’m getting is:

...
- downloading role from https://github.com/pressbooks/ansible-role-princexml/archive/11.3.tar.gz
 [ERROR]: failed to download the file: HTTP Error 404: Not Found

 [WARNING]: - princexml was NOT installed successfully.

To side-step this, I tried just removing all mentions of princexml in the server.yml, dev.yml, and requirements.yml, and that worked fine.

The issue that I’m stuck on now is this error:

TASK [common : Verify dict format for apt package component variables] *********
 [WARNING]: Failure using method (v2_runner_on_failed) in callback plugin
(<ansible.plugins.callback.output.CallbackModule object at 0x105321208>): name
'unicode' is not defined

	to retry, use: --limit @/Users/bryan/code/pressbooks-dev/trellis/dev.retry

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

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

A cursory Google search makes it kind of look like a Python version issue? I’m not entirely sure. Will continue poking at this, but wanted to drop a line here in case someone’s run into this before and knows offhand how to solve.

Cheers!

Bryan

Hey @bryan, as it so happens I was just working on the PrinceXML role yesterday. If you restore it to the requirements.yml and use version 11.4.0 it will work as expected.

For the second error it looks like you are using Python 3 on your local machine but the version of Trellis you are working with doesn’t support it: https://discourse.roots.io/t/name-unicode-is-not-defined/14230

This PR (which I’ve finished testing) updates our fork to align with the latest version of Trellis, which includes:

  • Python 3 support
  • PHP 7.3
  • Ubuntu 18.04 Bionic LTS

We will be developing against this soon, so if you want to try it out you might be able to skirt both of the issues you ran into.

1 Like

Still didn’t get this working, but it’s not a crisis. From what I can tell, I’m still running into a python/ansible compatibility issue. I’ll keep tinkering about, and if I can get it working I’ll post here again.

If you want to share whatever you’ve run into that’s certainly something I might be able to help with as I’ve been working on this for a while :slight_smile:

Here’s a screen grab of the error I’m getting. I’m running Python 3.7.2.

Can you paste in the contents of your group_vars/development/wordpress_sites.yml and group_vars/development/vault.yml?

It’s the standard config from the repo (unchanged):

# `wordpress_sites` options: https://roots.io/trellis/docs/wordpress-sites
# Define accompanying passwords/secrets in group_vars/development/vault.yml

wordpress_sites:
  pressbooks.test:
    site_hosts:
      - canonical: pressbooks.test
        redirects:
          - www.pressbooks.test
    local_path: ../site # path targeting local Bedrock site directory (relative to Ansible root)
    admin_email: ops@pressbooks.test
    multisite:
      enabled: true
      subdomains: false
    ssl:
      enabled: true
      provider: self-signed
    cache:
      enabled: false

and

vault_mysql_root_password: devpw

# Variables to accompany `group_vars/development/wordpress_sites.yml`
# Note: the site name (`example.com`) must match up with the site name in the above file.
vault_wordpress_sites:
  pressbooks.test:
    admin_password: admin
    env:
      db_password: example_dbpassword

Interesting. If you are running this in the same location as you were before pulling the latest version, can you try deleting the the trellis/vendor directory, then running vagrant halt && vagrant up --provision?

1 Like

That was totally the issue. I would do:

$ vagrant halt && vagrant destroy -f && rm -rf .vagrant/ but I was forgetting to delete the vendor/ directory as well. Totally works now. Thank you!

Cheers!

Bryan

1 Like

FYI @dac.chartrand ran into this too, and suggested a change in upstream Trellis which we’ll get shortly that should prevent this issue in future! https://github.com/roots/trellis/pull/1064

1 Like