Deploying production can't verify remote repo

Hey there,

The remote server setup went just fine but when I try to deploy I get stuck at task [Verify remote repo]. Any ideas? Settings are well configured in group_vars/production/wordpress_sites.yml

PLAY [Ensure necessary variables are defined] *********************************

TASK: [Ensure environment is defined] *****************************************
skipping: [localhost]

PLAY [Deploy WP site] *********************************************************

GATHERING FACTS ***************************************************************
ok: [46.101.164.224]

TASK: [Ensure site is valid] **************************************************
skipping: [46.101.164.224]

TASK: [Ensure repo is valid] **************************************************
skipping: [46.101.164.224]

TASK: [Verify remote repo] ****************************************************

You can just try running that task manually via SSH to see what’s going on:

git ls-remote {{ project.repo }} HEAD

Replace that with the repo URL of course.

edit: make sure you SSH in as the web_user (usually just web).

git ls-remote GitHub - roots/bedrock: WordPress boilerplate with Composer, easier configuration, and an improved folder structure HEAD
87ab3fd20c23a64b55adb12bec3fa468ebd2c835 HEAD

Seems fine. but

git ls-remote git@github.com:roots/bedrock.git HEAD
The authenticity of host ‘github.com (192.30.252.128)’ can’t be established.
RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added ‘github.com,192.30.252.128’ (RSA) to the list of known hosts.
Permission denied (publickey).
fatal: Could not read from remote repository.

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

Should I change the format of the git URL wordpress_sites.yml ?

If git ls-remote git@github.com:roots/bedrock.git HEAD fails then your deploy wouldn’t work anyway. That should mean your SSH key isn’t set up properly.

See the docs here: https://roots.io/trellis/docs/ssh-keys/

Now that bad part is that “Verify remote repo” was added to check for these problems up front and provide a nicer error message. I’m not why it’s stuck there instead of failing :frowning:

I am also having issues with this. Using a private repo. Checking the head returns fine. Keys setup under the users section.

SSH keys have been added to keychain (OSX) as per instructions at the bottom of the Trellis SSH keys docs. I have also checked the ansible.cfg which correctly has;

ssh_args = -o ForwardAgent=yes -o

ForwardAgent has been setup correctly as per the info on the following link;

https://developer.github.com/guides/using-ssh-agent-forwarding/

Running git ls-remote on the private repo from the server returns fine.

Any ideas?

I have even tried editing the deploy.yml file to do the check on roots/bedrock.git to try and bypass the check, but this still hangs on verify remote repo.

Edit: Changing the command from the SSH format to the URL format works.

command: git ls-remote http://github.com/roots/bedrock.git HEAD

I have had to sub in the bedrock repo due to mine being private to bypass the check. Believe this to be a bug?

Yep, it’s a bug.

Fixed in here: https://github.com/roots/trellis/pull/463

1 Like