Skip to content

connecting to github repo from server: success for 1-9, error for 10 only #7

@buffler

Description

@buffler

First of all, this is an awesome sanity checker - thank you tons for providing it!

I keep running into the following error when running bundle exec cap staging deploy:

Permission denied (publickey).
fatal: Could not read from remote repository.

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

I have a feeling this is going to end up being an issue on my end, not yours, but: have you ever seen numbers 1-9 succeed but 10 still fail, when trying to connect to a Github repo from a staging server? Here's the output when running bundle exec cap staging ssh:doctor:

SSH agent forwarding report
---------------------------
1. [success] `repo_url` setting ok
2. [success] ssh private key file exists
3. [success] `ssh-agent` process seems to be running locally
4. [success] `ssh-agent` process recognized by `ssh-add` command
5. [success] ssh private keys added to `ssh-agent`
6. [success] application repository accessible from local machine
7. [success] all hosts using passwordless login
8. [success] `forward_agent` ok for all hosts
9. [success] ssh agent successfully forwarded to remote hosts
10. [error] It seems Capistrano cannot access application git repository from these hosts:
ssh.phx.nearlyfreespeech.net
Actions:
- make sure all the previous checks pass. That should make this one work too.

This happens when using the format

set :repo_url, 'git@github.com:{github-organization}/{private-repo}.git'

in my deploy.rb. When using either

set :repo_url, 'https://{github-username}:{github-password}@github.com/{github-organization}/{private-repo}.git'

or

set :repo_url, 'https://{github-oauth-token}:@github.com/{github-organization}/{private-repo}.git'

, I am able to successfully connect to the Github repo from the staging server - but those are less than ideal as (I think) they'd require putting Github credentials of some sort in the repo.

I'm admittedly not super strong re: ssh-agent, forwarding, etc. so I'm sure there are a few things I could be missing. I am encouraged to know that having checks 1-9 pass should make 10 work too, but perplexed as to what else might be causing check 10 to fail. Thanks for any insight/assistance you may be able to provide!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions