-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Cargo can't find git credentials for private repo anymore #3487
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
This may be due to some change in libssh2, but I'm not entirely sure how to debug unfortunately. |
I have gotten something similar to this today.
The core issue as far as I can see it is that there is no (easy?) way to change the credentials and have them automatically propagate to wherever they need to go (including Cargo in this case). |
This may be related to https://github.com/alexcrichton/git2-rs/issues/202, fixed in alexcrichton/ssh2-rs@0e979f8, pulled into Cargo in #4008 and going into rust-lang/rust in rust-lang/rust#41830. It may work trying the next nightly with rust-lang/rust#41830? |
I'm still running into this, but I haven't changed my GitHub credentials. |
@Boscop are you on Windows? |
Yes, Windows 8.1 with GitHub Desktop. I added the paths to git.exe and github.exe to PATH and cloning the private github repos works on the cmd line. It used to work with cargo too but not anymore. |
@Boscop right now Cargo works when cloning private repositories through using the ssh-agent protocol, do you know if that's configured with GitHub Desktop? |
I think so, ssh-agent.exe is running in the background. |
It may be that libgit2 isn't finding it to communicate with it? Unfortunately I don't know many details of how the ssh-agent is supposed to work on Windows or how libssh2/libgit2 implement it... |
Who implemented the communication between cargo and git/ssh agent? Is there any info that I can provide that would be useful to debug this? |
I'm not super familiar with how it's implemented on Windows. The implementation lives in libssh2, and you may be able to poke around the source to see what's expected. |
@jjpe Why do you have to set git credentials? I never set git credentials and it used to work for me before. Btw, when I do
Why isn't cargo using my ssh key through ssh-agent.exe from GitHub Desktop (which is always running)? |
I'm not sure if I have to per se, it just happened to be my observation at the time as my password had been changed due to company security policy. |
@alexcrichton I see the same error as the initial report above. I'm pretty sure it's because the git2 crate is trying to use If I add |
I'm getting the same error again, even though it was working after I had installed pageant.
Why isn't it working anymore? I'm using this format in Cargo.toml: project = { git = 'https://github.com/username/project' } Do I have to write it differently now? Like this?: project = { git = 'ssh://git@github.com:username/project.git' } But then cargo complains about invalid manifest because of the I have GitHub Desktop: Chocolate-Covered Yaks (3.3.4.0) 50415df Is it because of this? How to fix this? Can cargo please print more helpful error information about git failure in the future? |
|
I've got this now:
Notes:
|
I have the same issue as @norru on Windows 10. Ordinary checkout with |
Any update on this? @stasostrovskyi did you find a solution? |
Still open as of 209-08-16 Have to use |
I'm experiencing this too on macOS. It happens with private repos with restricted access. I'm able to git clone those repos without problems using the git command directly, but Edit: In my case, |
I'm facing this same problem in Linux (Arch). |
I encounter the same issue with https authentication. Is there currently a solution available ? |
In my case, I had this snippet in my
I had to get rid of that. Then the error stopped happening for me. |
Here is what I did for fixing my
|
I solved it on Mac by installing third-party (Microsoft) credential-manager
|
Worked flawlessly here on my MacBook. Thank you very much! |
I was using private repos in my Cargo.toml before without problems.
My git installation is GitHub Desktop for windows.
But now I get this error when doing cargo build on a project that uses a private repo:
Even though ssh-agent.exe is running, and when I git clone the repo manually on the cmd line, it doesn't ask me for credentials, so the underlying mechanism is working.
(It's been several months since I last tried to build this project but I didn't change anything in it from when it last compiled successfully, only updated rust/cargo (and GitHub updated itself).)
cargo 0.16.0-nightly (3568be9 2016-11-26)
The text was updated successfully, but these errors were encountered: