Failed to deploy on option to install WP-CLI packages

Hi,

Apologies if this subject has cropped up before, but I have taken a look through the discourse and have not been able to find a matching issue.

This is an issue on a long standing project (around 2 years old), trellis has gone through a number of updates for bug fixes etc. I thought updating to the latest version of trellis may resolve the issue but on deploying to a server I received these error messages using the verbose command:

System info:
Ansible 2.2.0.0; Linux
Trellis at “Option to install WP-CLI packages”

Local modifications exist in repository (force=no).
fatal: [xxx.xxx.xxx.xxx]: 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] *******************************
task path: /trellis/roles/deploy/tasks/update.yml:45

System info:
Ansible 2.2.0.0; Linux
Trellis at “Option to install WP-CLI packages”

Git repo git@bitbucket.org:xxx/xxx.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: [xxx.xxx.xxx.xxx]: FAILED! => {
“changed”: false,
“failed”: true,
“invocation”: {
“module_args”: {
“msg”: “Git repo git@bitbucket.org:xxx/xxx.git cannot be accessed. Please verify the repository exists and you have SSH forwarding set up correctly.\nMore info:\n> https://roots.io/trellis/docs/deploys/#ssh-keys\n> https://roots.io/trellis/docs/ssh-keys/#cloning-remote-repo-using-ssh-agent-forwarding\n
},
“module_name”: “fail”
}
}

I have looked into the web pages shown in the error messages to ensure that ssh forwarding is setup correctly. I have tried using ssh git@bitbucket.org and the terminal outputs the repo’s I have access to including the repo I am trying to use in the deploy.

However when I try ssh git@bitbucket.org + :[project]/[repo-name].git the terminal states ssh: Could not resolve hostname bitbucket.org + :[project]/[repo-name].git Name or service not known

I also tried to ssh to the remote server from the server I am trying to deploy from and that succeeds as well.

Any help regarding this issue would be greatly appreciated

At first glance, I’d guess that the git clone is failing because Local modifications exist in repository and force=no. This refers to the path /srv/www/example.com/shared/source.

I don’t know how modifications could be made to those files unless manually, like this precedent. Actions on the live site probably didn’t make the modifications because the site works with the project files copied to a new subdirectory of /srv/www/example.com/releases.

I haven’t tried, but I’d suggest:

  • ssh to server
    ssh web@example.com
  • navigate to shared dir
    cd /srv/www/example.com/shared
  • move source dir out of the way, as backup
    mv source source_bak
  • list modified files, just for information
    cd source_bak && git status
  • retry deploy

The next deploy should make a new clean clone in a new source directory and hopefully you’ll be on your way. If that works, then I’d keep an eye out for the problem recurring, and if it recurs, try to figure out what could be modifying files in this source directory.

1 Like

Amazing, I dont know how you managed to work that out without me turning on the logging at the local modifications stage. I was about to add to the issue but you already provided the solution.

After completing your steps this solved the issue. I will keep an eye on the issue as I am not sure how the source was directly changed as I deployed a day before this issue became apparent.

Hopefully, this will help someone else with a similar issue.

thanks for the insight and lightning quick response @fullyint

1 Like

Brilliant. This also fixed an issue I was having where deployment was throwing errors about being unable to access the Git repo. Thanks!