Hmm… I’m guessing you created the comp-dev-ar/trellis-test repo/project using the GitHub GUI but haven’t pushed your actual repo from your local machine. Try this in your local machine Trellis directory:
# add github repo as a remote
git remote add github git@github.com:comp-dev-ar/trellis-test.git
# push the latest repo changes up to GitHub
git push github master
# test whether cloned repo is no longer empty
ssh web@mysite.com 'cd /tmp && git clone git@github.com:comp-dev-ar/trellis-test.git test2'
If that last command just responds Cloning into 'test2'... I think that means success and you can try your deploy again.
If that doesn’t resolve it, could you please do this:
Otherwise, I think the critical debug info is being censored, as per your error message: FAILED! => {"censored": "the output has been hidden due to the fact that 'no_log: true' was specified for this result"}
Yes, thank you for checking @pushstudio, and for clarifying @swalkinshaw, you’ll be pushing up your mysite.com repo/project. I was wrong when I suggested pushing from your Trellis directory. You’ll be deploying mysite.com so that is what you need to push to a git host.
Thanks to all… It was only that. I can’t believe I didn’t see it
Thanks. It deploy. The database is empty, so I will read more about that. Thanks to all!
This is what I somehow needed today to deploy my site changes. Committing and adding all changes using git was fine, but when I wanted to deploy I got an error that the repo could perhaps not be reached or that I had to setup proper SSH forwarding. Just adding the key to the keychain seemed to make all work again.
I been following this thread, tested the suggestions too.
But I can’t still not deploy to my staging, but my colleague does it and we have tried to solve this now but we are stuck. Getting bored to ask him to deploy for me all the time.
Keep getting this error message at the end:
TASK [deploy : Clone project files] **********************************************************************************
System info:
Ansible 2.4.0.0; Darwin
Trellis at "Normalize `apt` tasks"
---------------------------------------------------
Failed to download remote objects and refs: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
fatal: [34.240.210.25]: FAILED! => {"censored": "the output has been hidden due to the fact that 'no_log: true' was specified for this result"}
...ignoring
TASK [deploy : Failed connection to remote repo] *********************************************************************
System info:
Ansible 2.4.0.0; Darwin
Trellis at "Normalize `apt` tasks"
---------------------------------------------------
Git repo git@bitbucket.org:psturesson/aao.se.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: [34.240.210.25]: FAILED! => {"changed": false, "failed": true}
to retry, use: --limit @/Applications/MAMP/dev/aao.se/trellis/deploy.retry
PLAY RECAP ***********************************************************************************************************
34.240.210.25 : ok=7 changed=0 unreachable=0 failed=1
localhost : ok=0 changed=0 unreachable=0 failed=0
@ellrod Does ssh-add -l list the private ssh key that grants access to your bitbucket repo? Please try ssh-add or ssh-add -K till it does.
If you’re on macOS Sierra or newer, please ensure your ssh agent isn’t “forgetting” your ssh key. I haven’t read the discussion carefully, but perhaps add this to your ~/.ssh/config`:
Host *
AddKeysToAgent yes
UseKeychain yes
If your repo is with bitbucket, then you need to test ssh -T git@bitbucket.org and it is more applicable if run on your server because during deploys it is your server that will initiate the git clone. For example,
If this last test fails in any way, how about removing /home/web/.ssh/known_hosts from the server then exiting the SSH session and trying your deploy again.
I’m the one that have setup the server in question. And I can’t wrap my head around the problems @ellrod is facing here. It seems he’s able to connect to the server and manually clone the repo, so as far as I can understand, the key is being forwarded.
Could there be some setting within Bitbucket that’s causing this? @ellrod has pushed changes to the repo on Bitbucket which I have later deployed because we have this issue. So access
I can’t seem to get my deploy to work. I’ve followed each of the steps listed in this thread and still getting error. I’ve double checked that SSH Agent Forwarding is enabled locally and on the server and that the key is added to the SSH agent both locally on on GitHub account. I’ve tried removing known_hosts from server and re-deploying.
I’ve deployed before on this project with the same repository and now it isn’t working.
After spinning up a new server and starting fresh it worked fine. So I started looking into differences in server settings between the two.
Turns out that i had changed the folder permissions/ownership of the folders on my server inside /srv/www/. Once I changed the permissions/ownership back to web:www-data it worked perfectly.
Hopefully this helps someone else out in the future.
@smashcreative also mentioned he span up a new server and it worked with changing the file permissions to web.www-data. I have double-checked that these permissions are in place on my server and that is the case.
For me, my deployment based on a private repo on bitbucket:
Hi folks. I have the same issue and don’t know what to do. Here is the error message when i want to deploy to production. Staging works fine.
Git repo git@github.com:maroluke/naanu-website.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