Access to trellis as Roots Example Project on github

Having done 2 projects now with SAGE using MAMP I thought it was time to try the next step of using Trellis and bedrock.

I’m working my way through the docs to get my dev environment ready, and I have all the prerequisites in place now I think.

$ vagrant --version
Vagrant 2.2.19
$ node --version
v12.22.5
$ yarn --version
1.22.10
$ pip install ansible==2.4.0.
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: ansible==2.4.0. in /Users/**/Library/Python/3.8/lib/python/site-packages (2.4.0.0)
Requirement already satisfied: jinja2 in /Users/**/Library/Python/3.8/lib/python/site-packages (from ansible==2.4.0.) (3.0.3)
Requirement already satisfied: paramiko in /Users/**/Library/Python/3.8/lib/python/site-packages (from ansible==2.4.0.) (2.8.1)
Requirement already satisfied: setuptools in /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages (from ansible==2.4.0.) (41.2.0)
Requirement already satisfied: PyYAML in /Users/**/Library/Python/3.8/lib/python/site-packages (from ansible==2.4.0.) (6.0)
Requirement already satisfied: cryptography in /Users/**/Library/Python/3.8/lib/python/site-packages (from ansible==2.4.0.) (36.0.0)
Requirement already satisfied: cffi>=1.12 in /Users/**/Library/Python/3.8/lib/python/site-packages (from cryptography->ansible==2.4.0.) (1.15.0)
Requirement already satisfied: MarkupSafe>=2.0 in /Users/**/Library/Python/3.8/lib/python/site-packages (from jinja2->ansible==2.4.0.) (2.0.1)
Requirement already satisfied: bcrypt>=3.1.3 in /Users/**/Library/Python/3.8/lib/python/site-packages (from paramiko->ansible==2.4.0.) (3.2.0)
Requirement already satisfied: pynacl>=1.0.1 in /Users/**/Library/Python/3.8/lib/python/site-packages (from paramiko->ansible==2.4.0.) (1.4.0)
Requirement already satisfied: six>=1.4.1 in /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages (from bcrypt>=3.1.3->paramiko->ansible==2.4.0.) (1.15.0)
Requirement already satisfied: pycparser in /Users/**/Library/Python/3.8/lib/python/site-packages (from cffi>=1.12->cryptography->ansible==2.4.0.) (2.21)

In the documentation, it’s unclear how to actually install trellis. It leaps from prerequisites to trellis commands without the middle bit I would have hoped for telling me how to get there. Trellis: Installation | Roots Documentation

I suspected installing the example project might help to see how it all fits together: GitHub - roots/roots-example-project.com: Example Roots stack project (Trellis, Bedrock, Sage)

The instructions here look like they’ll really help, but unfortunately, I get this error on step 2:

git clone --depth=1 git@github.com:roots/trellis.git && rm -rf trellis/.git
Cloning into 'trellis'...
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

Just wondering what I have to do to get access or if this is down or something?

Hey @meemal - it looks like you might still need to setup SSH keys on your local machine

Our roots-example-project.com setup and instructions are a bit stale and is needing some updates, so I’d also recommend giving trellis-cli a shot and using trellis new to start a new Trellis project!

@meemal – don’t forget to check out the docs to help you get setup for your particular os → Getting Started: macOS | Roots Documentation

2 Likes

Thank you @ben and @joshb. That definitely helped me, I’m further in the process now.

I now have the folder structure constructed, then made the theme. So now I’ve navigated to the trellis folder to try and get vagrant going. I’ve had to downgrade the vagrant version, then “fix” the plugins but now when I run Vagrant Up I get an error message:

There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.

Command: ["hostonlyif", "ipconfig", "vboxnet0", "--ip", "192.168.50.1", "--netmask", "255.255.255.0"]

Stderr: VBoxManage: error: Code E_ACCESSDENIED (0x80070005) - Access denied (extended info not available)
VBoxManage: error: Context: "EnableStaticIPConfig(Bstr(pszIp).raw(), Bstr(pszNetmask).raw())" at line 242 of file VBoxManageHostonly.cpp

I’ve googled this but not really getting any answers that seem helpful. Bit out of my depth here!

@meemal - do you have virtualbox installed?
If/if not, regardless, I would install v6.1.26 → Download_Old_Builds_6_1 – Oracle VM VirtualBox

1 Like

I did have a later version installed so now have downloaded the version you have recommended thank you. Now it hangs with a connection refused warning.

naomispirit@Naomis-MBP trellis % vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'bento/ubuntu-20.04' version '202107.28.0' is up to date...
==> default: Resuming suspended VM...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:22
    default: SSH username: vagrant
    default: SSH auth method: private key
    default: Warning: Connection refused. Retrying...
    default: Warning: Connection refused. Retrying...

I tried the advice on there which was to run ‘vagrant reload’ and now I’m back to the original error message,

I’ve tried opening the VirtualBox app manually and it seems to have data in there from my config. It reminds me that I wasn’t sure what the URL should be of the ‘local’ site. I used www.myurl.test was this correct?

The name of your site should be what you’ve set from group_vars/development/wordpress_sites.yml

I searched your connection refused error and came across lots of other topics, have you tried some of the solutions out there?

The name matches that thanks. I’ve been through lots and lots of searches for help, I’m not just posting at the first hurdle.

I’ve just gone right back to the start and gone through all the instructions again. It seemed I needed to roll back my vagrant version - which was surprisingly tricky to do! I’ve suggested an edit to the documentation about that so that it’s easier for the next person.

So, I’m back to trying to install the example project on Github. I’ve followed the instructions and it seems that vagrant is now up (though with some hurdles on the way, having to vagrant halt, and vagrant reload?!

==> default: Your Trellis Vagrant box is ready to use!

Going to http://roots-example-project.test/ refuses to connect though.

Since you mentioned those instructions were stale, I also tried making a test project using trellis new example3.com. But the Bedrock .env.example file still just has default information in it on both the example project from github and a new trellis project. I guess I expected that to be filled in?

As I started looking into the database side of things to do that it just looks, it looks like it’s starting to look way too complicated. I’m not even sure that the server I have would be suitable for trellis? I have no idea if I’m 90% there or 10% there!

After a whole week of 2 steps forward 1 step back I think I have to concede I’ve bitten off more than I can chew. I simply don’t have the time to try and piece this together, especially if I find at the end it won’t even work with my server config. Unfortunately, I’ve got a project I need to deliver next week and did not account for a week messing with this stuff.

So I think for now I’ll just try and integrate bedrock for this project which is already a step forward and leave trellis for another day. It would be amazing to have some video walkthroughs of trellis and how it all hangs together.

1 Like

After your initial trellis up, there should be an .env file that’s populated with the correct values

Then there are two additional requirements for the remote server itself:

  1. You need a server running a bare/stock version of Ubuntu 20.04 LTS (Focal). If you’re using a host such as DigitalOcean, then just select their Ubuntu 20.04 option.
    You cannot run Trellis on a shared host.
  2. You need to be able to connect to your server from your local computer via SSH. We highly suggest doing this via SSH keys so you don’t have to specify a password every time. Many hosts like DigitalOcean offer to automatically add your SSH key when creating a server so take advantage of that. Or follow a guide such as this one.

via Trellis remote server setup docs

For sure something we’d love to get created, thank you for the suggestion!

Sorry you’re having a battle trying to get Trellis running — I’ve often ran into blockers based on whatever combo of macOS + Ansible version + Python version + Virtualbox version + Vagrant version isn’t playing nice :frowning: Once that hurdle is overcome, it’s a really stable setup and workflow.

@swalkinshaw is actively making improvements to our error messages and version checking/requirements as well

1 Like

Thank you for your reply.

There IS no .env file in any of the examples that I’ve created. The only one which has a .env file is the one I created using the bedrock command having since given up on trellis! Could there be something missing in the trellis workflow?

Actually, I do use shared hosting for my smaller sites. So very good to know that trellis isn’t an option anyway for the particular site I was using as a test case for trellis :grimacing:

At least I’m nearly there with Bedrock so it’s not been a total washout. The next time I’m doing a redevelopment on another server perhaps I’ll revisit, if I’m more used to bedrock there will be less new stuff to take on board. Maybe there will be a video by then!

This topic was automatically closed after 42 days. New replies are no longer allowed.