Page MenuHomePhabricator

Setting up existing repository
Closed, ResolvedPublic

Description

I have set up phabricator with http access to the repositories in a testing environment. However, a few things still seem to be wrong.

  • a test repository from bitbucket neither imports files nor commits
  • git clone of any added repository returns fatal: unable to access 'http://x.x.x.x/diffusion/M/mi_ke.git/': The requested URL returned error: 500
  • the file structure in /var/repo looks quite strange, for instance
$ ls /var/repo/M

returns

branches  config  description  HEAD  hooks  info  objects  refs

which looks like the content of the .git folder in a repository but not how the main folder in the repository should look like.

Any ideas how to approach my configuration problems?

Thank you.

Event Timeline

maxie updated the task description. (Show Details)
maxie added a subscriber: maxie.
  • a test repository from bitbucket neither imports files nor commits

What do you mean by that?
The http://x.x.x.x/diffusion/M/edit/ page should show more information about what exactly is wrong and what is working.
Daemon dashboard (http://...//daemon/) may show more details about errors.

  • the file structure in /var/repo looks quite strange, for instance

/var/repo/M

returns

branches config description HEAD hooks info objects refs

That's the expected result. Phabricator makes a bare clone (No working directory) for repositories.
Many git operations (git log, git branch, git ls-tree) would still work on a bare clone.

That's the expected result. Phabricator makes a bare clone (No working directory) for repositories.
Many git operations (git log, git branch, git ls-tree) would still work on a bare clone.

That clears it up, thank up.

Remaining problem: I still couldn't find out why I get an internal server error when I try to clone the created repository or to push to the repository.

No entry in the Apache error_log,

Apache access_log

"GET /diffusion/X/repo.git/info/refs?service=git-upload-pack HTTP/1.1" 500 42 "-" "git/2.1.4"

I checked the Apache error log file and there are no entries.

$GIT_CURL_VERBOSE=1 git clone http://server.example.com/diffusion/T/test.git

returns

Cloning into 'test'...
* Couldn't find host server.example.com in the .netrc file; using defaults
*   Trying ...
* Connected to www-int (...) port 80 (#0)
> GET http://server.example.com/diffusion/T/test.git/info/refs?service=git-upload-pack HTTP/1.1
Host: server.example.com
User-Agent: git/2.1.4
Accept: */*
Accept-Encoding: gzip
Proxy-Connection: Keep-Alive
Pragma: no-cache

* HTTP 1.0, assume close after body
< HTTP/1.0 401 Unauthorized
< Date: Wed, 26 Aug 2015 07:34:03 GMT
< Server: Apache
< X-Powered-By: PHP/5.6.12
< WWW-Authenticate: Basic realm="Phabricator Repositories"
< Content-Length: 43
< Content-Type: text/html; charset=UTF-8
< X-Cache: MISS from www-int ...
< X-Cache-Lookup: MISS from www-int ...:3128
< Via: 1.0 www-int ... (squid/3.1.10)
* HTTP/1.0 connection set to keep alive!
< Connection: keep-alive
< 
* Connection #0 to host www-int left intact
Username for 'http://server.example.com': USER
Password for 'http://USER@server.example.com': 
* Couldn't find host server.example.com in the .netrc file; using defaults
* Found bundle for host server.example.com: 0x110af50
* Hostname www-int was found in DNS cache
*   Trying ...
* Connected to www-int (...) port 80 (#1)
> GET http://server.example.com/diffusion/T/test.git/info/refs?service=git-upload-pack HTTP/1.1
Host: server.example.com
User-Agent: git/2.1.4
Accept: */*
Accept-Encoding: gzip
Proxy-Connection: Keep-Alive
Pragma: no-cache

* HTTP 1.0, assume close after body
< HTTP/1.0 401 Unauthorized
< Date: Wed, 26 Aug 2015 07:34:09 GMT
< Server: Apache
< X-Powered-By: PHP/5.6.12
< WWW-Authenticate: Basic realm="Phabricator Repositories"
< Content-Length: 43
< Content-Type: text/html; charset=UTF-8
< X-Cache: MISS from www-int ...
< X-Cache-Lookup: MISS from www-int ...:3128
< Via: 1.0 www-int ... (squid/3.1.10)
* HTTP/1.0 connection set to keep alive!
< Connection: keep-alive
< 
* Ignoring the response-body
* Connection #1 to host www-int left intact
* Issue another request to this URL: 'http://server.example.com/diffusion/T/test.git/info/refs?service=git-upload-pack'
* Couldn't find host server.example.com in the .netrc file; using defaults
* Found bundle for host server.example.com: 0x110af50
* Re-using existing connection! (#1) with proxy www-int
* Connected to www-int (...) port 80 (#1)
* Server auth using Basic with user 'USER'
> GET http://server.example.com/diffusion/T/test.git/info/refs?service=git-upload-pack HTTP/1.0
Host: server.example.com
Authorization: Basic d2VybmVyam86WDplbml1NQ==
User-Agent: git/2.1.4
Accept: */*
Accept-Encoding: gzip
Proxy-Connection: Keep-Alive
Pragma: no-cache

* HTTP 1.0, assume close after body
< HTTP/1.0 500 Internal Server Error
< Date: Wed, 26 Aug 2015 07:34:09 GMT
< Server: Apache
< X-Powered-By: PHP/5.6.12
< Content-Length: 42
< Content-Type: text/html; charset=UTF-8
< X-Cache: MISS from www-int ...
< X-Cache-Lookup: MISS from www-int ...:3128
< Via: 1.0 www-int ... (squid/3.1.10)
* HTTP/1.0 connection set to keep alive!
< Connection: keep-alive
< 
* Connection #1 to host www-int left intact
fatal: unable to access 'http://server.example.com/diffusion/T/test.git/': The requested URL returned error: 500

The message is the same if I use a repo which does not exist (T exists, not_existing doesn't exist => also raises Internal Server Error):

git clone http://server.example.com/diffusion/T/not_existing.git

If neither T nor not_existing exist, I get a different error message

fatal: repository 'http://server.example.com/diffusion/T/falsetest.git/' not found

I am confused, any ideas?

The message is the same if I use a repo which does not exist (T exists, not_existing doesn't exist => also raises Internal Server Error):

Phabricator ignores the part after /T/ (The callsign) in the uri, so this is not actually a different test. Try
http://server.example.com/diffusion/NNN/not_existing.git

The last part is there so that git will locally create a nice directory test instead of T.

The lack of error message in the logs is odd. Are you using anything other than mod-php? Can you get any kind of error message to show up in the logs?

Phabricator ignores the part after /T/ (The callsign) in the uri, so this is not actually a different test. Try
http://server.example.com/diffusion/NNN/not_existing.git

As expected, the callsign NNN was not found as it does not exist. Callsign T still raises 500.

The lack of error message in the logs is odd. Are you using anything other than mod-php? Can you get any kind of error message to show up in the logs?

I use mod-php (Apache 2.4.16) and I found this entry in the access log (not the error log) of the Apache Server.

193.x.x.x - USER [27/Aug/2015:14:52:56 +0200] "GET /diffusion/T/test.git/info/refs?service=git-upload-pack HTTP/1.1" 500 42 "-" "git/2.1.4"

Does this make somehow sense to you?

I changed to nginx and now I got this in the error log.

2015/08/27 15:40:12 [error] 12875#12875: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 193.x.x.x server: 172.x.x.x, request: "GET /res/phabricator/aced76a5/core.pkg.css HTTP/1.1", upstream: "fastcgi://[::1]:9000", host: "172.x.x.x"
2015/08/27 15:40:48 [error] 12875#12875: *22 connect() failed (111: Connection refused) while connecting to upstream, client: 193.x.x.x, server: 172.x.x.x, request: "GET /diffusion/T/test.git/info/refs?service=git-upload-pack HTTP/1.1", upstream: "fastcgi://[::1]:9000", host: "172.x.x.x"
2015/08/27 15:41:23 [error] 12875#12875: *29 connect() failed (111: Connection refused) while connecting to upstream, client: 193.x.x.x, server: 172.x.x.x, request: "GET /res/phabricator/5ab1a46a/rsrc/css/font/font-lato.css HTTP/1.1", upstream: "fastcgi://[::1]:9000", host: "172.x.x.x"

That looks like nginx is trying to connect to fastcgi, but fastcgi is not running. I'm not sure how to enable it, because I've never used this setup before.

It's theoretically possible that the 500 really generates no logs - try curl -i http://server.example.com/diffusion/T/test.git/info/refs?service=git-upload-pack and see if you get any more output out of it.

curl gives this output.

HTTP/1.0 500 Internal Server Error
Server: nginx/1.8.0
Date: Thu, 27 Aug 2015 14:02:18 GMT
Content-Type: text/html; charset=UTF-8
X-Powered-By: PHP/5.6.12
X-Cache: MISS from www-int2...
X-Cache-Lookup: MISS from www-int2...:80
Via: 1.0 www-int2... (squid/3.1.10)
Connection: close

500 Error 1: sudo: a password is required

I checked the daemon user configuration, but I couldn't find any errors.

sudo: a password is required means you have not successfuly set up sudoers file, as per https://secure.phabricator.com/book/phabricator/article/diffusion_hosting/#configuring-system-user.

The webserver user (www-user in the docs; often httpd or www-data) is trying to run git-upload-pack as the daemon-user. The sudoers file should be configured to allow it to do so without a password.

Thank you, problem solved. I adapted the webserver user in the sudoers file.

maxie claimed this task.