Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libgit2 and ssh keys - regression in 0.5.0-rc0 compared to 0.4.0 #17768

Closed
mdcfrancis opened this issue Aug 2, 2016 · 22 comments
Closed

libgit2 and ssh keys - regression in 0.5.0-rc0 compared to 0.4.0 #17768

mdcfrancis opened this issue Aug 2, 2016 · 22 comments
Labels
libgit2 The libgit2 library or the LibGit2 stdlib module needs docs Documentation for this change is required
Milestone

Comments

@mdcfrancis
Copy link

This is a regression on 0.5.0-rc0 with a local git repo using SSH, this is using the workaround for libcurl

#13472

This is on Ubuntu 3.16.0-77-generic

INFO: Initializing package repository /home/michael/.julia/v0.5
INFO: Cloning METADATA from [email protected]:external/METADATA.jl.git
ERROR: error authenticating:  ssh-agent
Private key location for '[email protected]' [/home/michael/.ssh/id_rsa]:
Passphrase for /home/michael/.ssh/id_rsa:

julia> Pkg.add( "Foo" )
ERROR: error authenticating:  ssh-agentINFO: Updating cache of Foo...

Private key location for '[email protected]' [/home/michael/.ssh/id_rsa]:ERROR: error authenticating:  ssh-agent
Private key location for 'ssh://[email protected]' [/home/michael/.ssh/id_rsa]:

and then just hangs ...

@tkelman tkelman added the libgit2 The libgit2 library or the LibGit2 stdlib module label Aug 2, 2016
@mdcfrancis
Copy link
Author

actually does not hang, requests user input for each and every repo.

@Keno
Copy link
Member

Keno commented Aug 2, 2016

keys are cached during Pkg.update, or can be set using environment variables. For any other usage, I'd recommend starting an ssh agent.

@tkelman tkelman added the needs docs Documentation for this change is required label Aug 2, 2016
@mdcfrancis
Copy link
Author

This is very different behavior from previously. I don't have to do this with regular git commands. Makes the system much less friendly.

@Keno
Copy link
Member

Keno commented Aug 2, 2016

How is your regular git accessing ssh credentials?

@wildart
Copy link
Member

wildart commented Aug 3, 2016

It looks like #17691 changed credentials caching mechanism.

@mdcfrancis
Copy link
Author

@Keno that's a good question and one that I would have to do some research on, but basically with a standard install on ubuntu you simply don't have to worry. This was never an issue with 0.4 or with any other git client.

@Keno
Copy link
Member

Keno commented Aug 3, 2016

Can you see if ssh-add -l lists your key? In that case there may be an issue with how libgit2 communicates with the agent.

@mdcfrancis
Copy link
Author

no that does not list the key - by default it is just using ~/.shh/id_rsa.pub

@Keno
Copy link
Member

Keno commented Aug 3, 2016

Sure, but the key appears to be encrypted? Is it not?

@ViralBShah ViralBShah changed the title libgit2 - regression 0.5.0.rc0 libgit2 and ssh keys - regression in 0.5.0-rc0 compared to 0.4.0 Aug 3, 2016
@mdcfrancis
Copy link
Author

no the key is not encrypted

@Keno
Copy link
Member

Keno commented Aug 4, 2016

Ah, maybe that commit did not make it into rc0, can you try rc1?

@mdcfrancis
Copy link
Author

Worse :( Pkg.init( ... ) to a local fork of METADATA hosted internally

ERROR: error authenticating: ssh-agent
ERROR: GitError(Code:ERROR, Class:SSH, Failed to authenticate SSH session: Unable to open public key file)
in macro expansion at ./libgit2/error.jl:98 [inlined]
in clone(::String, ::String, ::Base.LibGit2.CloneOptions) at ./libgit2/repository.jl:191
in #clone#109(::String, ::Bool, ::Ptr{Void}, ::Nullable{Base.LibGit2.AbstractPayload}, ::Function, ::String, ::String) at ./libgit2/libgit2.jl:320

@mdcfrancis
Copy link
Author

I'll try and figure out what is going on

@Keno
Copy link
Member

Keno commented Aug 4, 2016

Ah, I think I've seen that one and have a fix. Hold on

@mdcfrancis
Copy link
Author

With master now I just get the following

ERROR: error authenticating: ssh-agent

but it correctly works with ssh

@wildart
Copy link
Member

wildart commented Aug 8, 2016

Which means that your ~/.shh/id_rsa key was a correct key for the authentication, if you didn't get prompted.

@Keno I wounder can we drop this message about ssh-agent. If it fails, it fails. No harm done, so we switch to key-based authentication.

@mdcfrancis
Copy link
Author

Yes exactly - this is working correctly, just the error message is distracting

@Keno
Copy link
Member

Keno commented Aug 8, 2016

Yes, we should drop the message.

@StefanKarpinski StefanKarpinski added this to the 0.5.0 milestone Aug 10, 2016
@StefanKarpinski
Copy link
Member

Isn't there a PR for this?

@Keno
Copy link
Member

Keno commented Aug 10, 2016

Already done.

@StefanKarpinski
Copy link
Member

Can we have some cross references here then (and close the issue as appropriate).

@Keno
Copy link
Member

Keno commented Aug 10, 2016

The original issue was fixed as part of #17586 and #17651, the ssh-agent issue I did in #17860. Though there have been a couple of others in between refactoring this stuff, so there may have been other issues in between.

@Keno Keno closed this as completed Aug 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
libgit2 The libgit2 library or the LibGit2 stdlib module needs docs Documentation for this change is required
Projects
None yet
Development

No branches or pull requests

5 participants