Page MenuHomePhabricator

Git clone returns 401 Authentication failed
Closed, ObsoletePublic

Asked by spuzvica on Sep 7 2015, 1:33 PM.

Details

After doing the upgrade today to the latest Phabricator, our Git repos stopped working, clone, pull or push does not work anymore, simply returning 401, Authentication failed. I tried resetting all passwords including the VCS one but no success.

Here's a detailed log of the command:

$ GIT_CURL_VERBOSE=1 git clone http://rok@myserver.example.com:80/diffusion/INFOZONE --verbose
Cloning into 'INFOZONE'...
* STATE: INIT => CONNECT handle 0x600096680; line 1026 (connection #-5000)
* Couldn't find host myserver.example.com in the .netrc file; using defaults
* Hostname was NOT found in DNS cache
*   Trying 192.168.10.31...
* STATE: CONNECT => WAITCONNECT handle 0x600096680; line 1073 (connection #0)
* Connected to myserver.example.com (192.168.10.31) port 80 (#0)
* STATE: WAITCONNECT => DO handle 0x600096680; line 1192 (connection #0)
> GET /diffusion/INFOZONE/info/refs?service=git-upload-pack HTTP/1.1
User-Agent: git/1.7.9
Host: myserver.example.com
Accept: */*
Pragma: no-cache

* STATE: DO => DO_DONE handle 0x600096680; line 1278 (connection #0)
* STATE: DO_DONE => WAITPERFORM handle 0x600096680; line 1404 (connection #0)
* STATE: WAITPERFORM => PERFORM handle 0x600096680; line 1417 (connection #0)
* HTTP 1.1 or later with persistent connection, pipelining supported
< HTTP/1.1 401 You must log in to access repositories.
< Date: Mon, 07 Sep 2015 13:31:44 GMT
* Server Apache is not blacklisted
< Server: Apache
< X-Powered-By: PHP/5.4.38
< WWW-Authenticate: Basic realm="Phabricator Repositories"
< X-Frame-Options: SAMEORIGIN
< Transfer-Encoding: chunked
< Content-Type: text/html
<
* Ignoring the response-body
* Connection #0 to host myserver.example.com left intact
* Issue another request to this URL: 'http://rok@myserver.example.com:80/diffusion/INFOZONE/info/refs?service=git-upload-pack'
* STATE: PERFORM => CONNECT handle 0x600096680; line 1562 (connection #-5000)
* Couldn't find host myserver.example.com in the .netrc file; using defaults
* Found bundle for host myserver.example.com: 0x6000a0490
* Re-using existing connection! (#0) with host myserver.example.com
* Connected to myserver.example.com (192.168.10.31) port 80 (#0)
* STATE: CONNECT => DO handle 0x600096680; line 1066 (connection #0)
* Server auth using Basic with user 'rok'
> GET /diffusion/INFOZONE/info/refs?service=git-upload-pack HTTP/1.1
Authorization: Basic cm9rOg==
User-Agent: git/1.7.9
Host: myserver.example.com
Accept: */*
Pragma: no-cache

* STATE: DO => DO_DONE handle 0x600096680; line 1278 (connection #0)
* STATE: DO_DONE => WAITPERFORM handle 0x600096680; line 1404 (connection #0)
* STATE: WAITPERFORM => PERFORM handle 0x600096680; line 1417 (connection #0)
* HTTP 1.1 or later with persistent connection, pipelining supported
< HTTP/1.1 401 You must log in to access repositories.
< Date: Mon, 07 Sep 2015 13:31:45 GMT
* Server Apache is not blacklisted
< Server: Apache
< X-Powered-By: PHP/5.4.38
* Authentication problem. Ignoring this.
< WWW-Authenticate: Basic realm="Phabricator Repositories"
< X-Frame-Options: SAMEORIGIN
< Transfer-Encoding: chunked
< Content-Type: text/html
* The requested URL returned error: 401
* Closing connection 0
* The cache now contains 0 members
* Expire cleared
Password for 'http://rok@myserver.example.com:80':
* STATE: INIT => CONNECT handle 0x600096680; line 1026 (connection #-5000)
* Couldn't find host myserver.example.com in the .netrc file; using defaults
* Hostname was found in DNS cache
*   Trying 192.168.10.31...
* STATE: CONNECT => WAITCONNECT handle 0x600096680; line 1073 (connection #1)
* Connected to myserver.example.com (192.168.10.31) port 80 (#1)
* STATE: WAITCONNECT => DO handle 0x600096680; line 1192 (connection #1)
* Server auth using Basic with user 'rok'
> GET /diffusion/INFOZONE/info/refs?service=git-upload-pack HTTP/1.1
Authorization: Basic cm9rOnRyaXN0dmFyaQ==
User-Agent: git/1.7.9
Host: myserver.example.com
Accept: */*
Pragma: no-cache

* STATE: DO => DO_DONE handle 0x600096680; line 1278 (connection #1)
* STATE: DO_DONE => WAITPERFORM handle 0x600096680; line 1404 (connection #1)
* STATE: WAITPERFORM => PERFORM handle 0x600096680; line 1417 (connection #1)
* HTTP 1.1 or later with persistent connection, pipelining supported
< HTTP/1.1 401 You must log in to access repositories.
< Date: Mon, 07 Sep 2015 13:31:48 GMT
* Server Apache is not blacklisted
< Server: Apache
< X-Powered-By: PHP/5.4.38
* Authentication problem. Ignoring this.
< WWW-Authenticate: Basic realm="Phabricator Repositories"
< X-Frame-Options: SAMEORIGIN
< Transfer-Encoding: chunked
< Content-Type: text/html
* The requested URL returned error: 401
* Closing connection 1
* The cache now contains 0 members
* Expire cleared
fatal: Authentication failed

Any idea why this would start happening?

Answers

johnny-bit
Updated 2,231 Days Ago

Have You checked https://secure.phabricator.com/book/phabricator/article/diffusion_hosting/#troubleshooting-http ? it looks like You should authenticate yet I don't see authentication attempt.

BTW: are You actually using git 1.7.9? That was released ~3 years ago? have You considered upgrading?

pirolla
Updated 2,183 Days Ago

This seems to be the same issue I'm having trying to create a diffusion self hosted git repo on DreamHost... I know you don't support shared environments but I thought worth mentioning.

I have upgraded git and nothing happened, by the way. The odd thing is that I am able to create a hosted git repository and access it through http with some .htaccess configurations (basic realm, httppasswd, etc) outside phabricator/diffusion.

New Answer

Answer

This question has been marked as closed, but you can still leave a new answer.