I’m not sure what has happened and I have looked ta several other threads regarding failed deployments and have spent hours trying to debug. I’m running this command:
TASK [deploy : Update git remote URL] ********************************************************************************************************************************************************************************************************************
skipping: [staging.MYSITE.com]
TASK [deploy : Clone project files] **********************************************************************************************************************************************************************************************************************
System info:
Ansible 2.7.4; Darwin
Trellis version (per changelog): "Update xdebug tunnel configuration"
---------------------------------------------------
fatal: [staging.MYSITE.com]: FAILED! => {"censored": "the output has been hidden due to the fact that 'no_log: true' was specified for this result", "changed": false}
...ignoring
TASK [deploy : Failed connection to remote repo] *********************************************************************************************************************************************************************************************************
System info:
Ansible 2.7.4; Darwin
Trellis version (per changelog): "Update xdebug tunnel configuration"
---------------------------------------------------
Git repo git@github.com:ACCOUNT/MYSITE.com-wordpress.git cannot be
accessed. Please verify the repository exists and you have SSH forwarding set
up correctly.
More info:
> https://roots.io/trellis/docs/deploys/#ssh-keys
> https://roots.io/trellis/docs/ssh-keys/#cloning-remote-repo-using-ssh-
agent-forwarding
fatal: [staging.MYSITE.com]: FAILED! => {"changed": false}
PLAY RECAP ***********************************************************************************************************************************************************************************************************************************************
localhost : ok=0 changed=0 unreachable=0 failed=0
staging.MYSITE.com : ok=7 changed=0 unreachable=0 failed=1
Here’s my .ssh/config:
User web
HostName staging.MYSITE.com
ForwardAgent yes
The error you’re getting indicates that Ansible can’t clone your GitHub repository. Have you forwarded your SSH key (see documentation)? Is the GitHub repo named correctly in your staging wordpress_sites.yml?
That I have. What doesn’t make sense is that I can deploy to production which utilizes the same repo. What else could it be? Does my config look right?
I’ve had issues similar to this before where the only way I was able to solve it was by spooling up a new instance of a server and reprovisioning and deploying. It’s not the most fun way to get back up and running and rather annoying but it’s been the case a few times.
Also when I $git log -- trellis I don’t show anything being changed there since before deployments to staging stopped working. I realize that not all files were checked into git but trying to determine what had changed and if that change broke staging deployments.
I’ve seen people with the same issue before and it was because they were deploying a non-existent branch. Have you checked which branch you’re deploying and that it exists on your remote repo?
Thanks for the reply. The branch is staging and hasn’t changed. I think it’s likely something with my local. I checked SSH Forwarding, SSH Agent, modified my ssh config, and more.
Sorry, just saw that you said production uses the same branch - so sanity check here: Are you deploying your staging branch to production with no problems?
Have you ever been able to deploy to this staging environment? Did provisioning run smoothly?
I meant to say that we have been using the staging for our staging server. While master is used for production. We were able to deploy just fine the other day. I think something on the server got messed up somehow, but I’m not sure what else to try.
Trellis deploys by (in part) git cloneing your repository on your remote server (see: https://roots.io/trellis/docs/remote-server-setup/#deploy). If you don’t have git on your remote server, it would be impossible for it to do that.
Thanks for the response. I should have said that git itself isn’t installed, but I do understand that trellis utilizes that to deploy the updates. The same can be said of production too, where deployments work just fine.
Is there anything that I can check that may have been foobarred on the server?
I can successfully provision with $ ansible-playbook server.yml -e "site=SITENAME.com env=staging" but not deploy $ ansible-playbook deploy.yml -e "site=SITENAME.com env=staging"
Any other ideas besides provisioning another fresh server?