Setup fails: could not symlink

609 views
Skip to first unread message

Hidde de Jong

unread,
Mar 30, 2014, 11:19:58 AM3/30/14
to gito...@googlegroups.com
Hello,

I'm trying to install gitolite on my server slot, but the setup keeps failing with the following error:
(using the command: gitolite setup -pk hidde.pub)

FATAL: could not symlink /media/sdn1/home/hiddedejong/.gitolite/hooks/common/update to gitolite-admin.git/hooks
at /media/sdn1/home/hiddedejong/gitolite/src/lib/Gitolite/Conf/Store.pm line 367

I have some limitations on the server I use. Since it's a server slot, I can't create extra users. I can't create a dedicated gitolite hosting user, so I'll have to use my normal shell access user. I also have to install everything in my home directory.

(Git is installed system wide, but I also have an other version in my home directory. When I run gitolite-shell, it shows me it uses Git 1.9.0. The version in my home directory.)

I cloned and installed gitolite as a shell user. I also run gitolite setup as the same user. (As far as I understand, this how I should be doing this...?) Other comparable issues were mostly caused by bypassing the gitolite-shell, but since no keys were added to authorized_keys by the setup, there is no way yet to access the gitolite-shell as a user.

Where does this error come from and how can I resolve it? Unfortunately there's no way for me to seperate the userid's. I have to use one userid for both shell access and gitolite.

Thank you

Sitaram Chamarty

unread,
Mar 30, 2014, 12:31:42 PM3/30/14
to Hidde de Jong, gito...@googlegroups.com
(1) Having the same userid for shell and gitolite is perfectly fine as
far as gitolite is concerned. If **your** ssh knowledge can keep up and
not lock you out, that is. (Which cannot happen if you at least know
the password to the account or have some means to reset it).

All of that has NOTHING to do with this problem.

(2) I would suggest you manually try this command:

cd ~/repositories
ln -sf /media/sdn1/home/hiddedejong/.gitolite/hooks/common/update gitolite-admin.git/hooks

and tell us what you got.

Hidde de Jong

unread,
Mar 30, 2014, 12:50:10 PM3/30/14
to gito...@googlegroups.com, Hidde de Jong
The command executes without any errors, but setup still fails...

(Manually executing /media/sdn1/home/hiddedejong/.gitolite/hooks/common/update gives me the 'Empty compile time value' and 'Use of uninitialized value in require' errors.)

Sitaram Chamarty

unread,
Mar 30, 2014, 12:58:04 PM3/30/14
to Hidde de Jong, gito...@googlegroups.com
On 03/30/2014 10:20 PM, Hidde de Jong wrote:
> The command executes without any errors, but setup still fails...

That's puzzling. Perhaps you can try this patch and retry the *entire*
install once again (removing EVERYTHING related to gitolite first?)
ln.patch

Hidde de Jong

unread,
Mar 30, 2014, 5:34:28 PM3/30/14
to gito...@googlegroups.com, Hidde de Jong
I removed everything related to gitolite and tried patching, but the patch does not work. It says 'can't find file to patch at input line 5', using the command 'patch < ln.patch' (also tried -p1, but I have never done this before.)

I tried the patch before and after installing gitolite. (also ran gitolite setup, but it still fails) I think you want to patch the Common.pm file in my $HOME/bin/lib/Gitolite directory? Because the directory does not exist..

Thank you very much for you help!

Sitaram Chamarty

unread,
Mar 30, 2014, 8:28:26 PM3/30/14
to Hidde de Jong, gito...@googlegroups.com
Git patches are applied with 'git apply', and you should be in the
gitolite source directory when you attempt to do so. The actual file
being patched here is src/lib/Gitolite/Common.pm within the gitolite
source tree.

The patch is very small; just two lines are replaced. Even if automatic
patching failed, it should be easy to -- carefully -- apply the patch
manually using an editor.

(And I just tested; even the normal 'patch' command -- the non-git
version -- works fine; it doesn't recognsie the i/ and w/ prefixes that
git-diff adds so it asks you for the file name. Since we can easily see
the file name in the text printed so far, we just paste it in --
basically paste in the part after "i/" or "w/". And it just works).

What OS does this server run, by the way?

Hidde de Jong

unread,
Mar 31, 2014, 4:38:19 AM3/31/14
to gito...@googlegroups.com, Hidde de Jong
Ah, now I understand! I removed everything related to gitolite again (also made a new clone) and applied the patch. The patch was applied successfully this time and I tried installing again.

This time I got the error (something in the lines of:)
'failed to create symbolic link, gitolite-admin.git/hooks does not exist'

So I manually created the directory hooks and I ran setup again. Now I got the same problem, but now for testing.git. Again, I manually created the directory hooks and ran setup again. This time there were no errors. My public key was added to authorized_keys.

I seems to work fine, I cloned gitolite-admin.git and tried to create new repos. This works, but every time a repository gets created, the same error comes up. However, this one is easily resolved by creating the hooks directory manually on the server and running 'gitolite setup -pk [keyfile]' again.

The exact error message:
remote: Initialized empty Git repository in /media/sdn1/home/hiddedejong/repositories/water.git/
remote: ln: failed to create symbolic link `water.git/hooks/update': No such file or directory
remote: FATAL: ln -sf failed: at /media/sdn1/home/hiddedejong/gitolite/src/lib/Gitolite/Common.pm line 190, <DATA> line 1.

Sitaram Chamarty

unread,
Mar 31, 2014, 8:10:47 AM3/31/14
to Hidde de Jong, gito...@googlegroups.com
On 03/31/2014 02:08 PM, Hidde de Jong wrote:
> Ah, now I understand! I removed everything related to gitolite again
> (also made a new clone) and applied the patch. The patch was applied
> successfully this time and I tried installing again.
>
> This time I got the error (something in the lines of:) 'failed to
> create symbolic link, gitolite-admin.git/hooks does not exist'

Try "git init --bare" in an empty directory and tell me if you see a
.git/hooks directory in it.

Assuming you don't, you'll have to fix that somehow. Gitolite expects a
'git init --bare' to create a hooks directory.
Reply all
Reply to author
Forward
0 new messages