6

I have recently installed Gitolite in a Cygwin environment using SSH keys and everything else.

I successfully installed Gitolite and had access to the gitolite-admin repository, configured and put the new keys. When I committed and pushed, everything was fine until I noticed that I can't access the new repositories or gitolite-admin repository again ...

I then entered my server via ssh and noticed that gitolite deleted all of the public keys in authorized_keys except for my default SSH key I configured with SSH.

I checked if the hooks are propagating and everything looks fine - Gitolite created the new repositories and compiled the new gitolite.conf

I don't know what i missed - something is wrong but I don't have an idea what it is.

The last I saw is that the file ~/.gitolite/src/sshkeys-lint manage the authorized_keys files but i dont understand the shell script language very well.

Nic
  • 13,287
  • 7
  • 40
  • 42
Rafael
  • 3,081
  • 6
  • 32
  • 53
  • Sounds like you could possibly have a permissions issue on your `authorized_keys` file? – Nic Sep 24 '11 at 05:48
  • `authorizad_keys` has 600 permision on git user that is fine he can read because i can access via ssh if i run `~/.gitolite/src/gl-setup-authkeys --batch ~/.gitolite/keydir` .... the `authorized_keys` is updated and everything is right the problem is i have to do it and doesn't trigger automatically – Rafael Sep 26 '11 at 14:12
  • @melee thanks for the grammar check. i'll try to write better my questions / answers – Rafael Sep 26 '11 at 14:22
  • no worries, just here to help. Its hard to advise on this issue because I haven't installed on Cygwin before. I'll see if I can try to replicate the problem on one of my Win boxes. – Nic Sep 26 '11 at 14:41
  • 1
    I've discovered that re-running gl-setup seems to fix this issue. But, I would hate to have to run that every time you push changes to the repo. – NickSuperb Mar 05 '12 at 16:47

1 Answers1

6

When you commit, are you getting the following error in the console(of the machine where from you are commiting)??

remote: FIND: Parameter format not correct 
remote: FIND: Parameter format not correct 

If yes then the problem is the find.exe.

Windows has a find.exe in its \windows\system32 folder and cygwin has its own find.exe. Usually \windows\system32 comes first in the environment variable 'path'.

Gitolite uses 'find' in its scripts, but unfortunately the find.exe from windows rather than from cywin gets executed.

Now to fix the problem, go to the environment variables tab and add bin directory of cygwin before system32.

After this you wont face the issue of "authorized_keys file getting cleared on a commit" again.

I have gitolite working on windows server 2008 machine with mirroring working fine. (I have configured this as a slave and the master is a centOs machine.) More info, As you have installed sshd as a windows service, the cygwin path would be given lesser proirity over windows path will kick in.

manoj
  • 1,655
  • 15
  • 19
  • i will check that on the first chance that i have – Rafael Jan 22 '12 at 01:21
  • I'm encountering the same exact issue.. However adding cygwin to the path is not working for me. Its possible that this fix may require a reboot?? Another thing.. wouldn't it be smarter to add 'c:\cygwin\bin\find.exe' to the path? That way your not putting any system functions in jeopardy. – NickSuperb Mar 05 '12 at 16:42
  • Thank you, it worked for me! Gitolite wasn't able to update the authorized_keys file, because it used the wrong find.exe, when called from the SSHD deamon/service of Cygwin (but why?! this ought to be fixed - when called from the cygwin commandline it worked perfectly). @Nick: Yes, it seems you have to restart, for the service (or the service user-account?) to discover that the PATH has changed.... (i had to on XP at least) – DisplayName May 10 '14 at 14:23