Fatal: authentication failed for [GIT client]

Javier Ros picture Javier Ros · May 31, 2016 · Viewed 7.8k times · Source

I use Windows on the clients and I have a stand-alone installation of GitLab-CE (through omnibus package), I'm having problem with authentication but it isn't a server problem, I have the problem only from one client, I can access from other clients without problems then the problem is in this client.

When git needs authentication I get this error:

fatal: Authentication failed for 'http://sgit.emuasa.es/jros/PruebaGit1.git/'

I have created several repos in the server and when I do a push operation where git needs authentication the client shows me the authentication dialog (user and pwd prompt), I write my credentials and I get the same error. I can access to the gitlab frontend using the same credentials but I can't perform push (or clone from private repositories).

I can access only if I put user and password in the remote using:

git remote delete origin
git remote add origin http://USER:[email protected]/jros/PruebaGit1.git

Then I can access but I don't want to have the password visible in the remote list.

I have tried to write only the user:

git remote delete origin
git remote add origin http://[email protected]/jros/PruebaGit1.git

Git prompts me for the password but the result is the same:

fatal: Authentication failed for 'http://[email protected]/jros/PruebaGit1.git/'

I have clear the credential helper using:

git config --unset credential.helper

And I have erased the credential from Windows Credential Manager ... but I can't find the source of this problem ...

It's a strange behaivor due to I use github and gitlab (online) repositories with no problem.

I have uninstall and reinstall all git client applications (tortoisegit, GitExtension, GitKraken) and uninstall Git but nothing ...

Can you help me? any ideas? What can I do?

Answer

Javier Ros picture Javier Ros · May 31, 2016

Ok, I have solved it.

I have set GIT_CURL_VERBOSE=1 as env variable (as @Jcl says in his comment) and I can see that git connect to proxy:

* Couldn't find host sgit.emuasa.es in the _netrc file; using defaults
* timeout on name lookup is not supported
*   Trying 10.31.9.20...
* Connected to proxy.XXXX.XXX (XX.XX.X.XX) port 8080 (#0)
> GET http://sgit.emuasa.es/jros/prueba2.git/info/refs?service=git-upload-pack HTTP/1.1
Host: sgit.emuasa.es
User-Agent: git/2.8.3.windows.1
Accept: */*
Accept-Encoding: gzip
Accept-Language: es, *;q=0.9
Pragma: no-cache

The git server is internal and don't need to pass through proxy. I have removed the proxy configuration from:

  • Internet Options from IE
  • git config --global --unset http.proxy
  • netsh winhttp proxy

And I get the same, git connects to the proxy ...

I have searching for .gitconfig file and I don't find it ...

Finally I have found a enviroment variable called HTTP_PROXY set on my system and pointed to my proxy ...

I haven't found information about GIT use this enviroment variable but GIT use it.