Skip to content

Cloning SSH repos seem to fail  #372

Closed

Description

@fatso83

I had problems getting the example to run in my own code, constantly getting error authenticating:. Checked out the project (revision 5d371ae) and ran the tests (quit after finishing the Clone tests).

  Clone
    ✓ can clone with http (4566ms)
    ✓ can clone with https (4469ms)
    1) can clone with ssh
    ✓ can clone with ssh while manually loading a key (13553ms)
    ✓ can clone with git (3616ms)
^C

  15 passing (32s)
  1 failing

  1) Clone can clone with ssh:
     Error: error authenticating: 

This fails on both Ubuntu 14.10 and on OS X 10.10.

Activity

  1. fatso83 commented on Jan 30, 2015

    @fatso83
    Author

    Actually the error on Linux is more verbose:

    1) Clone can clone with ssh:
         Error: error authenticating: no auth sock variable
    

    I have made sure to start ssh-agent and verified at socket has been created at SSH_AUTH_SOCK.

  2. tbranyen commented on Jan 30, 2015

    @tbranyen
    Member

    Hey @fatso83 I'm not entirely sure why that's failing for you. I use Linux as my primary OS and I've never had a clone test failure like that. You'll also notice we continuously test on Travis-CI which is also Linux and the tests pass fine there.

    I'd look more into your system setup, since agents can be tricky to get right. I'm hesitant to blame NodeGit at this point.

  3. maxkorp commented on Jan 30, 2015

    @maxkorp
    Collaborator

    And you've verified that the environment variable SSH_AUTH_SOCK is set?

  4. fatso83 commented on Jan 30, 2015

    @fatso83
    Author

    @maxkorp : actually that was a good point, as I had just checked that the advertised socket was present. I thought explicitly running ssh-agent set up the environment variable for me:

    $ ssh-agent
    SSH_AUTH_SOCK=/tmp/ssh-QejtRVwKAexV/agent.21239; export SSH_AUTH_SOCK;
    SSH_AGENT_PID=21240; export SSH_AGENT_PID;
    echo Agent pid 21240;
    

    Turned out I was wrong

    printenv|grep SSH_AUTH_SOCK # gave me empty on Linux, was set on OS X
    

    Anyway, after setting the environment variable on Linux (and checking it was present by echoing it) I got the same error message as on OS X.

    1) Clone can clone with ssh:
         Error: error authenticating
    

    Any way I can check this is just my environment pulling tricks? I tried this on two different setups, so I thought I had it verified, but if the CI tests still run ...

  5. tbranyen commented on Feb 2, 2015

    @tbranyen
    Member

    I just pulled latest and tried again with my machine, and it works as expected. Unfortunately unless we can reproduce a bug in our CI environment, we have to chalk this up to environmental error.

    Ensure you have something like this in your enivornment runtime configuration file, like .bashrc:

    # SSH Agent
    SSH_ENV="$HOME/.ssh/environment"
    
    function start_agent {
         echo "Initialising new SSH agent..."
         /usr/bin/ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}"
         echo succeeded
         chmod 600 "${SSH_ENV}"
         . "${SSH_ENV}" > /dev/null
         /usr/bin/ssh-add;
    }
    
    # Source SSH settings, if applicable
    
    if [ -f "${SSH_ENV}" ]; then
         . "${SSH_ENV}" > /dev/null
         #ps ${SSH_AGENT_PID} doesn't work under cywgin
         ps -ef | grep ${SSH_AGENT_PID} | grep ssh-agent$ > /dev/null || {
             start_agent;
         }
    else
         start_agent;
    fi 

    Please open a PR with a failing test case, and we'll be happy to work with you to resolve.

  6. threeq commented on Jan 18, 2017

    @threeq

    @tbranyen
    perfect! It's work!

  7. arrowing commented on Nov 25, 2019

    @arrowing

    @tbranyen good job!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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