Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The requested URL returned error 502, corporate?

Tags:

git

git-clone

Does anyone know what the problem seems to be with git? I am getting this error when running running a git clone to clone from team foundation server (tfs).

 fatal: unable to access 'http://website.com/_git/project': The requested URL returned error: 502
like image 348
Kevin Cai Avatar asked Jun 16 '17 16:06

Kevin Cai


2 Answers

This took me considerable amount of time to troubleshoot and fix this annoying issue.

In my case I had the http_proxy and https_proxy environment variables set on my PC. ( You can find them under control panel - System and Security - Advanced system settings - Env variables - System variables section bottom panel in windows 10)

Once I deleted those 2 environment variables ( highlight - delete - ok ) and closed the Git-Terminal window and re-opened it the problem (http 502) went away. Just to confirm I tested with Git GUI + VS Code + Git Term. Did git fetch/clone/push/etc ...

Note: I am in a corporate env behind a strict proxy but so is the Enterprise tfs URL therefore I do not need a proxy interfering between me and my tfs server. I suspect (cannot confirm or rule out) the proxy was playing a MITM. Client machine is Windows 10 latest build running git version 2.22.0.windows.1

like image 163
objectNotFound Avatar answered Sep 21 '22 05:09

objectNotFound


For reference: Within a corporate environment behind an authenticating proxy server I had previously edited my git global config an override for the proxy server. Once I corrected this, I was able to connect.

Useful command:

git config --global --list


[filter "lfs"]
        clean = git-lfs clean -- %f
        smudge = git-lfs smudge -- %f
        process = git-lfs filter-process
        required = true
[user]
        name = GuyWicks
[user]
        email = [email protected]
[http]
    proxy = http://public-cache:8080

[https]
    proxy = http://public-cache:8080

I commented out the four proxy lines (#)

like image 35
Guy Avatar answered Sep 19 '22 05:09

Guy