bypassing gitolite through smart https?

761 views
Skip to first unread message

Miklos Espak

unread,
May 5, 2012, 6:30:14 AM5/5/12
to gitolite
Hi,

I have set up gitolite v3, it works well through git, http and ssh. I can also clone through https, but if I push, I get the following "classic" error:

espakm@zawinul:~/tmp/git/e$ git push origin master
remote: Empty compile time value given to use lib at hooks/update line 6
remote: Use of uninitialized value in require at hooks/update line 7.
remote: Use of uninitialized value in require at hooks/update line 7.
remote: Can't locate Gitolite/Hooks/Update.pm in @INC (@INC contains:  /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/5.8.8 .) at hooks/update line 7.
remote: BEGIN failed--compilation aborted at hooks/update line 7.
remote: error: hook declined to update refs/heads/master
To https://me:********@cmicdev.cs.ucl.ac.uk/git/NiftyGuide.git
! [remote rejected] master -> master (hook declined)
error: failed to push some refs to 'https://me:******@cmicdev.cs.ucl.ac.uk/git/NiftyGuide.git'

I read the documentation about this error, but it's related to ssh that works fine here.

I ran git update-server-info in the repository.

The Apache2 httpd.conf has this:

----------------------------------
SetEnv GIT_PROJECT_ROOT /data/gitolite/repositories
SetEnv GIT_HTTP_EXPORT_ALL

ScriptAliasMatch \
       "(?x)^/git/(.*/(HEAD | \
                       info/refs | \
                       objects/(info/[^/]+ | \
                                [0-9a-f]{2}/[0-9a-f]{38} | \
                                pack/pack-[0-9a-f]{40}\.(pack|idx)) | \
                       git-(upload|receive)-pack))$" \
  
       /usr/libexec/git-core/git-http-backend/$1

<LocationMatch "^/git/.*/git-receive-pack$">
  
   AuthType Basic
  
   AuthName "git"
  
   AuthUserFile "/paramedic/cmicdev/data/apache/access/cmic.htpasswd"
  
   Require valid-user
</LocationMatch>
----------------------

The update hook of the project links to that of gitolite:

[root@cmicdev conf]# ls -l /data/gitolite/repositories/NiftyGuide.git/hooks/update
lrwxrwxrwx 1 git apache 45 May  1 12:42 /data/gitolite/repositories/NiftyGuide.git/hooks/update -> /data/gitolite//.gitolite/hooks/common/update

I have no idea what else to check.

Could someone help me please?

Thank you,
Miklos


milk

unread,
May 5, 2012, 12:47:07 PM5/5/12
to Miklos Espak, gitolite
On Sat, May 5, 2012 at 3:30 AM, Miklos Espak <esp...@gmail.com> wrote:
remote: Can't locate Gitolite/Hooks/Update.pm in @INC (@INC contains:  /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/5.8.8 .) at hooks/update line 7.

Is Gitolite in the paths of @INC?

--milki

Miklos Espak

unread,
May 5, 2012, 12:55:50 PM5/5/12
to milk, gitolite
No, it is not listed. It is  under /usr/local/gitolite/lib.

Do you know how to add it?

Sitaram Chamarty

unread,
May 5, 2012, 12:56:30 PM5/5/12
to milk, Miklos Espak, gitolite
The real error is earlier: remote: Empty compile time value given to
use lib at hooks/update line 6

which means $ENV{GL_LIBDIR} is not set.

Somehow he's not going through gitolite-shell, which should have been
called because of this line (or similar) in httpd conf somewhere:

ScriptAlias /git/ /var/www/gitolite-home/gitolite-source/src/gitolite-shell/

if that had worked, GL_LIBDIR would be set.

I also have no clue how in one example he could not even communicate
with the server (curl error) and in another he got through to the
server upto that point.

Sitaram Chamarty

unread,
May 5, 2012, 12:58:00 PM5/5/12
to milk, Miklos Espak, gitolite
Miklos,

Looking at your http conf from your first email, I dont see
gitolite-shell being mentioned there at all.

How the hell did you expect gitolite to work?
--
Sitaram

milk

unread,
May 5, 2012, 1:04:56 PM5/5/12
to Sitaram Chamarty, Miklos Espak, gitolite
On Sat, May 5, 2012 at 9:58 AM, Sitaram Chamarty <sita...@gmail.com> wrote:
Miklos,

Looking at your http conf from your first email, I dont see
gitolite-shell being mentioned there at all.

How the hell did you expect gitolite to work?

Oo. I think I see it now. apache is using git-http-backend and the gitolite update script is being called as a hook rather than using gitolite. The conf is not setup to use gitolite at all.

--milki

Miklos Espak

unread,
May 5, 2012, 1:07:49 PM5/5/12
to Sitaram Chamarty, milk, gitolite
:)

I don't know much about how gitolite works. I thought naively that if I configured Apache to run the smart http cgi then it will call the hooks and the hooks will call gitolite. I might be completely wrong, sorry.

I found that I completely missed this document:
http://sitaramc.github.com/gitolite/http.html

So, both or you are right. Thank you!

Miklos
Reply all
Reply to author
Forward
0 new messages