gitolite installation failure - No such file - /home/git/gitolite/src/lib/Gitolite/Common.pm

1,885 views
Skip to first unread message

Prasanna

unread,
May 2, 2012, 3:48:32 PM5/2/12
to gito...@googlegroups.com
I am running into below listed issue while trying to install gitolite. Specifically, while trying to run the "setup" command as listed below.

 gitolite setup -pk gitadmin.pub
WARNING: Can't exec "/home/git/gitolite/src/triggers/post-compile/ssh-authkeys": No such file or directory at /home/git/gitolite/src/lib/Gitolite/Common.pm line 120, <DATA> line 1.

I looked at line 120 of Common.pm but could not understand the cause for failure. Anyone remember running into this issue?





Sitaram Chamarty

unread,
May 2, 2012, 4:46:55 PM5/2/12
to Prasanna, gito...@googlegroups.com
On Thu, May 3, 2012 at 1:18 AM, Prasanna <lk.pr...@gmail.com> wrote:
>
> I am running into below listed issue while trying to install gitolite. Specifically, while trying to run the "setup" command as listed below.
>
>  gitolite setup -pk gitadmin.pub
> WARNING: Can't exec "/home/git/gitolite/src/triggers/post-compile/ssh-authkeys": No such file or directory at /home/git/gitolite/src/lib/Gitolite/Common.pm line 120, <DATA> line 1.
>
> I looked at line 120 of Common.pm but could not understand the cause for failure.

What is line 120 in your version?

Also, does the file
/home/git/gitolite/src/triggers/post-compile/ssh-authkeys exist? If
so, what are it's first 2-3 lines?

Finally, what OS is this on?
Message has been deleted

Prasanna

unread,
May 2, 2012, 5:01:24 PM5/2/12
to gito...@googlegroups.com, Prasanna
This is on RHEL 5

ssh-authkeys does exist and here are the first few lines

#!/usr/bin/perl
use strict;
use warnings;

use File::Temp qw(tempfile);

use lib $ENV{GL_LIBDIR};
use Gitolite::Rc;
use Gitolite::Common;

$|++;

# can be called directly, or as a post-update hook.  Since it ignores
# arguments anyway, it hardly matters.

tsh_try("sestatus");
my $selinux = ( tsh_text() =~ /enabled/ );

my $ab = $rc{GL_ADMIN_BASE};
trace( 2, "'keydir' not found in '$ab'; exiting" ), exit if not -d "$ab/keydir";
my $akdir        = "$ENV{HOME}/.ssh";
my $akfile       = "$ENV{HOME}/.ssh/authorized_keys";
my $glshell      = $rc{GL_BINDIR} . "/gitolite-shell";
my $auth_options = auth_options();

sanity();

# ----------------------------------------------------------------------

_chdir($ab);

# old data
my $old_ak = slurp($akfile);
my @non_gl = grep { not /^# gito.*start/ .. /^# gito.*end/ } slurp($akfile);
chomp(@non_gl);
my %seen = map { $_ => 'a non-gitolite key' } ( fp(@non_gl) );

------------------------------------------------------------------------------------------------------------------------------------

My line 120 is same as in github

117     # run system(), catch errors.  Be verbose only if $ENV{D} exists.  If not,
118     # exit with <rc of system()> if it applies, else just "exit 1".
119     trace( 1, 'system', @_ );
120     if ( system(@_) != 0 ) {
121         trace( 1, "system() failed", @_, "-> $?" );
122         if ( $? == -1 ) {
123             die "failed to execute: $!\n" if $ENV{D};
124         } elsif ( $? & 127 ) {
125             die "child died with signal " . ( $? & 127 ) . "\n" if $ENV{D};
126         } else {
127             die "child exited with value " . ( $? >> 8 ) . "\n" if $ENV{D};
128             exit( $? >> 8 );
129         }
130         exit 1;
131     }

Thanks,
Prasanna

Sitaram Chamarty

unread,
May 2, 2012, 9:24:51 PM5/2/12
to Prasanna, gito...@googlegroups.com
On Thu, May 3, 2012 at 2:31 AM, Prasanna <lk.pr...@gmail.com> wrote:
>
> This is on RHEL 5
>
> ssh-authkeys does exist and here are the first few lines
>
> #!/usr/bin/perl
> use strict;

what does
file /home/git/gitolite/src/triggers/post-compile/ssh-authkeys
return?

I'm forced to conclude that someone used a Windows editor on that
file. If it returns something like

a /usr/bin/perl\015 script, ASCII text executable, with CRLF line
terminators

then that's confirmed, and you deserve to be shot for doing that somehow :-)

If it returns something like

a /usr/bin/perl script, ASCII text executable

then I am at a loss to understand what happened, other than your perl
itself is not in the standard place (but I find that hard to believe
since 'gitolite' itself would not have run then).

Prasanna

unread,
May 3, 2012, 9:56:43 AM5/3/12
to gito...@googlegroups.com
Sitaram,
I think am about to be shot ;) Here's what I had to do. I cannot clone gitolite src directly on the server
in which I am trying to install as ssh to an external network is not allowed.

So, I had to clone the src in a different machine that has access. It is a windows machine. I cloned
the src and transferred it to the server via WinScp. I guess, I used the "Auto" transfer mode and also
tried with "binary" mode. I believe the text files are now corrupted due to this. I ran dos2unix
on the files in /posttrigger and now I am getting this error, "FATAL: unknown gitolite sub-command
".

This is what I get upon executing ssh-authkeys

$ ./ssh-authkeys
-bash: ./ssh-authkeys: /usr/bin/perl^M: bad interpreter: No such file or directory

$ dos2unix ssh-authkeys
dos2unix: converting file ssh-authkeys to UNIX format ...

$ ./ssh-authkeys
Empty compile time value given to use lib at ./ssh-authkeys line 7
Use of uninitialized value in require at ./ssh-authkeys line 8.
Use of uninitialized value in require at ./ssh-authkeys line 8.
Can't locate Gitolite/Rc.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 ./ssh-authkeys line 8.
BEGIN failed--compilation aborted at ./ssh-authkeys line 8.

gitolite/install -ln
[git@gr1dlvcrs000 ~]$ gitolite setup -pk ~/gitadmin.pub
FATAL: unknown gitolite sub-command
FATAL: unknown gitolite sub-command
FATAL: unknown gitolite sub-command

Thanks,
Prasanna

David Pratt

unread,
May 3, 2012, 9:59:49 AM5/3/12
to Prasanna, gito...@googlegroups.com
A quick thought - if your machine can't do external ssh, but it does have Internet access, you can always clone gitolite using the github HTTP URL.

Sent from my iPad

Prasanna

unread,
May 3, 2012, 10:23:10 AM5/3/12
to gito...@googlegroups.com, Prasanna
Thanks. I remember trying that option. However, when I tried to install gitolite, I got an error relating to the directory not being a valid git repo (,git directory missing).


On Thursday, May 3, 2012 8:59:49 AM UTC-5, dpratt wrote:
A quick thought - if your machine can't do external ssh, but it does have Internet access, you can always clone gitolite using the github HTTP URL.

Sent from my iPad

Sitaram,

Prasanna

unread,
May 3, 2012, 10:24:42 AM5/3/12
to gito...@googlegroups.com
Sitaram,
Please ignore the error listed below. I created the archive using git bundle (as listed in https://sites.google.com/site/senawario/home/gitolite-tutorial) and installation was successful. Thanks for your help.

Sitaram Chamarty

unread,
May 3, 2012, 10:39:04 AM5/3/12
to Prasanna, gito...@googlegroups.com
On Thu, May 3, 2012 at 7:26 PM, Prasanna <lk.pr...@gmail.com> wrote:
> Sitaram,
> I think am about to be shot ;) Here's what I had to do. I cannot clone

Gee thanks for catching the smiley in my email! Would you believe TWO
people emailed me saying "you were too harsh/severe"?

Next time I'll leave off the smiley...<grumble grumble>

> gitolite src directly on the server
> in which I am trying to install as ssh to an external network is not
> allowed.

git bundle is what you want for situations like this; it appears from
a later email that is what you did so that's good.
Reply all
Reply to author
Forward
0 new messages