3

I am trying to clone a project from github (https://github.com/bhilburn/powerlevel9k to be specific, but all github repos fail in the same way), using Visual Studio 2013's native git integration.

I tried going to File -> Open From Source Control. That opens up the "Team Explorer" window on the left. I then click on the drop down panel for "Clone" under the "Local Git Repositories" heading. After that I enter the URL for powerlevel9k. VS2013 then gives me a very unhelpful message: "An error occurred. Detailed message: An error occurred while sending the request."

Unhelpful Error Message

I am stuck. I do not know what to do here. Nothing I try seems to work. All github repos I have tried give me the same exact error message.

If anyone can help me sort this out I would be eternally greatful.

Avi Caspe
  • 537
  • 4
  • 12
  • Have you tried using Git command line instead and seeing if you get better/different results? [Git help](https://git-scm.com/book/en/v2/Git-Basics-Getting-a-Git-Repository) ... ... ... For Example: git clone httxs://github.com/bhilburn/powerlevel9k "C:\blah\Repos\TestRepo9k" That last parameter (the "C:\..." path) is optional and only if you want to specify a path/folder where the repo should be cloned to. Otherwise, it creates a folder named the same as the repo name, in the location you run the command from – Gregg L Mar 13 '18 at 19:07
  • So I can't clone this repo from VS2013? – Avi Caspe Mar 13 '18 at 22:41
  • Yes, I am able to clone powerlevel9k from the command line. However, even once cloned I am unable to use VS2013 to push my changes to my fork on github. I can import to VS2013 just fine. – Avi Caspe Mar 14 '18 at 01:47
  • I haven't looked into that. I will do that when I get home. – Avi Caspe Mar 14 '18 at 18:36
  • @GreggL The "Show output from:" drop down is completely blank. I cannot select anything at all. – Avi Caspe Mar 15 '18 at 02:03
  • However, I was able to clone the repo using the command line, and then I can open the repo in VS2013 – Avi Caspe Mar 15 '18 at 02:05
  • That being said, I find myself unable to tell Visual Studio 2013 the location of upstream repo (bhilburn/powerlevel9k). In fact any feature that requires connection to github fails with the same error message as in my question – Avi Caspe Mar 15 '18 at 02:08
  • The only gitconfig I have is in \User\avica Nothing inside of any Visual Studio directory. – Avi Caspe Mar 15 '18 at 14:46
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/166898/discussion-between-gregg-l-and-avi-caspe). – Gregg L Mar 15 '18 at 14:50

3 Answers3

1

We experienced the same error recently when we moved some Git repositories. In our case the problem was GitHub no longer supported the TLSv1 or TLSv1.1 protocols as noted in this GitHub posting.

On February 8, 2018 we’ll start disabling the following: TLSv1/TLSv1.1: This applies to all HTTPS connections, including web, API, and git connections to https://github.com and https://api.github.com.

These are the protocols Visual Studio 2013 uses in its Git integration. A post on the Microsoft Developer community recommended upgrading to the latest version of Visual Studio 2017.

Until we could upgrade to Visual Studio 2017, we temporarily used a Visual Studio add-in for 2013. The add-in allows Visual Studio to use the TLSv1.2 protocol.

Brad Klein
  • 11
  • 1
0

TL;DR
This isn't a solution, rather just what we tried (none of which worked).
This way, anyone else who might stumble on this question later might be able to offer other ideas/solutions.

As this other SO question/answer points out (which I didn't see until yesterday afternoon), it might be best to use another tool for Git and not rely on VS 2013's Git support.

Full explanation
From what I could find on the Net, the rather unhelpful error message is most likely indicative of certificate issues when trying to connect to / work with an https repository (as written about in this blog article):

Special considerations for HTTPS endpoints
If an HTTPS URI is used for a remote, the Windows certificate store is used to validate the server’s SSL certificate.

If the server to which you are pushing/pulling has a self-signed certificate, then as of this writing, we give an unfortunate and vague error message to the user. “An error occurred while sending the request” [emphasis added by me] is what is commonly seen. You should use the Windows certificate manager (certmgr.msc) to add the self-signed certificate (or the authority at the top of the certificate’s chain) to the Windows certificate store as a trusted certificate, and then try your network operation again.

From the SO question (linked at beginning of answer) points out (which coincidentally links to the same article as above), it's not clear at all what certificate(s) would need to be added.

After more searching, I found another article that seemed might be related (dealing with SSL and certificate issues) (although it was regarding VS 2015, not 2013, and the error message wasn't the same):

Google pointed me at the .gitconfig file that lives at the root of your user directory. When I looked at that it contained not much at all – just a reference to the recently cloned repository I had tested with above. So I added the setting necessary to tell Git to find it’s trusted certificates in the same place that the command line tools had reported:

[http] sslcainfo = C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt

And remarkably that fixed Visual Studio…

This is what I had Avi try:

  1. Close Visual Studio if open
  2. From a command prompt, run the following: git config --list
  3. From the output, see if there is a 'http.sslcainfo' entry. It should/might have something like "C:\Program Files\Git...\certs\cabundle.crt"
  4. Copy that path
  5. In the gitconfig file in your user directory, try adding (replacing the path I show here with whatever the path from Step 4 is): [http] sslcainfo = C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt
  6. Save the file
  7. Restart Visual Studio and try to connect/push/pull to the Github repo

Avi also tried importing the 'ca-bundle.crt' certificate into Windows Certificate Manager.

And last, but not least, Avi tried adding that same [http] block to the 'config' file under the specific repo's '.git' folder.

Gregg L
  • 380
  • 1
  • 6
  • 16
  • How do I add import the 'ca-bundle.crt cert' into Windows Certification Manager? – Avi Caspe Mar 16 '18 at 16:25
  • Importing the ca-bundle.crt cert didn't help at all. – Avi Caspe Mar 16 '18 at 19:35
  • I also pointed in our chat that adding [https] sslcainfo = C;/Program Files/.../ca-bundle.crt makes it so I can't clone any github repos, not even from command line. I put an error message there. – Avi Caspe Mar 16 '18 at 19:37
  • Gregg L: revert the change to the answer. I used the wrong value for that field. I included the "https.sslcainfo=" under the [https] heading. I can now clone from github via command line. – Avi Caspe Mar 16 '18 at 19:55
  • Still can't clone from inside Visual Studio 2013. – Avi Caspe Mar 16 '18 at 19:56
0

Please do verify following thing.

  1. The server you are trying to connect with is live.
  2. The server you are trying to connect with is not blocking your IP.
  3. The Url of connecting server is valid
  4. You and your server connecting with the router ,You are connecting with router ABC using ISP XYZ ,But your server is connecting with Router DBA using ISP HKA, and you think that I am on the same ISP and router being used by the server but this is not the case.In order to connect with server or push changes you and your server must connected with same ISP using same router (In This Scenario Only).

You can try if server is accessible using ping command in linux or in windows

ping 192.168.100.3 (replace ip with server ip)

TAHA SULTAN TEMURI
  • 4,031
  • 2
  • 40
  • 66