23

I am using a VM provisioned by my company's internal cloud (KVM) - RHEL 6.4.

I am able to clone external repositories from the internet. Yet, I cannot figure out how to clone internal repositories on my company's intranet.

At first I didn't set the http_proxy or https_proxy and received this error:

error: The requested URL returned error: 401 Authorization Required while accessing http://....

After setting http_proxy and https_proxy, I now receive this error after waiting about 60 seconds:

error: The requested URL returned error: 504 Gateway Timeout while accessing http://...

I can clone this repo find from my laptop, just not the VM

Any ideas on where I should look?

Thanks.

samoz
  • 56,849
  • 55
  • 141
  • 195
Matthew Moisen
  • 16,701
  • 27
  • 128
  • 231
  • I have exactly the same issue. @Matthew where you able to resolve it? – Wlad May 10 '17 at 10:42
  • @TsetNoitamotua It has been a while, but I'm pretty sure what I ended up doing was switching to SSH fro HTTPS and everything started working fine. Unfortunately I cannot recall the root cause of the issue. Can you try SSH out and tell me if it works for you? – Matthew Moisen May 11 '17 at 05:16
  • I didn't try SSH yet but I got HTTPS working by adding local adresses to a proxy exception list as described here: http://ask.xmodulo.com/add-proxy-exceptions-ubuntu-desktop.html TL;DR - gsettings set org.gnome.system.proxy ignore-hosts "['localhost', '127.0.0.1', '*.mycompany.com', '::1']" – Wlad May 11 '17 at 08:55
  • What also works is: export no_proxy=.yourcompany.com – Wlad May 11 '17 at 15:25

2 Answers2

30

use this in .gitconfig file then this problem will resolved.

- [http]
     proxy = http://127.0.0.1:8087
     sslVerify = false

OR git config --global http.proxy ''

Matt
  • 74,352
  • 26
  • 153
  • 180
Muhammad Tariq
  • 311
  • 3
  • 4
5

The 504 status is most likely because you're trying to access an internal server through the proxy so I don't think you should set the proxy but instead focus on the 401 status since that most likely comes from the server hosting the repositories.

  • Do you have anonymous access to the internal repositories?

  • Are you cloning them in the same way, i.e. using HTTP on both your laptop and on the server, or are you using SSH on the laptop and HTTP on the server?

  • Do you have any credentials stored on your laptop?

Raniz
  • 10,882
  • 1
  • 32
  • 64