Skip to main content

Git Repository Server Gitosis on Win7 : Troubleshooting

Posted by survivant on September 6, 2010 at 4:27 PM PDT

If you have problems installing Gitosis on Windows, I suggest that you read that guide : : Git Repository Server Gitosis on Win7 (100% working), maybe you will be able to find what you missed.

In this guide, I'll describe raw problems that I found with the solution. Before I came with this guide, I try to install Gitosis on 3 computers and 4 Virtualbox installation by follow tutorial that I found. I kept the errors that I made and I'll explain that I found in this guide.

To save you lot of trouble, be sure that you put this line "loglevel = DEBUG" in gitosis.conf .

The errors are not shown in order.

If you can't connect by ssh, be sure that you open the sh port in your firewall. By default it's the port 22.

[prettify]
$ gitosis-init < id_rsa.pub
2 [main] python 66492 C:\cygwin\bin\python.exe: *** fatal error - unable t o remap
 \\?\C:\cygwin\lib\python2.6\lib-dynload\time.dll to same address as pare nt: 0x360000 != 0x380000 
2 [main] python 30908 fork: child 66492 - died waiting for dll loading, er rno 11 
Traceback (most recent call last): File "/usr/bin/gitosis-init", line 8, in 
 load_entry_point('gitosis==0.2', 'console_scripts', 'gitosis-init')() File "/usr/lib/python2.6/site-packages/
gitosis-0.2-py2.6.egg/gitosis/app.py", line 24, in run return app.main() File "/usr/lib/python2.6/site-packages/
gitosis-0.2-py2.6.egg/gitosis/app.py", line 38, in main self.handle_args(parser, cfg, options, args) File 
"/usr/lib/python2.6/site-packages/gitosis-0.2-py2.6.egg/gitosis/init.py", line 136, in handle_args
 user=user, File "/usr/lib/python2.6/site-packages/gitosis-0.2-py2.6.egg/gitosis/init.py", line 75, in
 init_admin_repository template=resource_filename('gitosis.templates', 'admin') File "/usr/lib/python2.6/
site-packages/gitosis-0.2-py2.6.egg/gitosis/repositor y.py", line 51, in init close_fds=True, File 
"/usr/lib/python2.6/subprocess.py", line 480, in call return Popen(*popenargs, **kwargs).wait() 
File "/usr/lib/python2.6/subprocess.py", line 633, in __init__ errread, errwrite) File "/usr/lib/python2.6/
subprocess.py", line 1049, in _execute_child self.pid = os.fork() OSError: 
[Errno 11] Resource temporarily unavailable 
[/prettify]

If you had this error, it's because you installed Python 2.6 instead of 2.5. Reinstall Python 2.5 and Setuptool for Python 2.5.

[prettify]
$ git clone git@localhost:notexist.git
Initialized empty Git repository in /home/bob/notexist/.git/
DEBUG:gitosis.serve.main:Got command "git-upload-pack 'notexist.git'"
DEBUG:gitosis.access.haveAccess:Access check for 'bob' as 'writable' on 'notexist.git'...
DEBUG:gitosis.access.haveAccess:Stripping .git suffix from 'notexist.git', new v
alue 'notexist'
DEBUG:gitosis.group.getMembership:found 'bob' in 'gitosis-admin'
DEBUG:gitosis.group.getMembership:found 'bob' in 'first_repo'
DEBUG:gitosis.access.haveAccess:Access check for 'bob' as 'writeable' on 'notexi
st.git'...
DEBUG:gitosis.access.haveAccess:Stripping .git suffix from 'notexist.git', new v
alue 'notexist'
DEBUG:gitosis.group.getMembership:found 'bob' in 'gitosis-admin'
DEBUG:gitosis.group.getMembership:found 'bob' in 'first_repo'
DEBUG:gitosis.access.haveAccess:Access check for 'bob' as 'readonly' on 'notexis
t.git'...
DEBUG:gitosis.access.haveAccess:Stripping .git suffix from 'notexist.git', new v
alue 'notexist'
DEBUG:gitosis.group.getMembership:found 'bob' in 'gitosis-admin'
DEBUG:gitosis.group.getMembership:found 'bob' in 'first_repo'
ERROR:gitosis.serve.main:Repository read access denied
fatal: The remote end hung up unexpectedly

bob@bob-PC ~
$
[/prettify]

The error is that the repository doesn't exist.

[prettify]
$ git push origin master:refs/heads/master
ERROR:gitosis.serve.main:Repository read access denied
fatal: The remote end hung up unexpectedly
[/prettify]

There could be multiple reason for that one. Mostly is because you don't have the permission to write. Start by looking into gitosis.conf if your user have the permission for the repository. Also check if you put your ssh-rsa key into keydir. There another possible reason, and it was really hard to find. Check the file /home/git/.ssh/authorized_keys . One error that I made was to add my Windows user into this file and after that I add my key into keydir. The result was when I pushed, Gitosis found my key, but it didn't have the command : " command="gitosis-serve xxx" ". If you have twice your key in that file, remove the line that wasn't generated by Gitosis.

Here it's what authorized_keys look like after adding key into keydir.

[prettify]
$ cat authorized_keys
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDf2jt0E6wpOj2iUoJttpvedR3jHbu/LizVkzDWFmG/
nuwZltnhwz1uCk7ArK0LeRlJFE25A/KS2OGci6xTh9MeZ5E1UHEYhR83HF98KLp64QmzwSwL6LWOlDm1
Q5fYm4jCdkXs/C0+3zvdxiza5gUBwaBSEpCd3gtWiIMv2T+Vi8O73YlIITMrYAA3gzh1HBie9xjSiZRI
TDDiQ3kFUB+aUKkwuprZtmm1PArTUU16OPUjQbP31rsJp6j8oGZVNW+pCiL91lTvVGCGmqjBqXuT4FMG
3/xIBVWN1seflEp8U1HL6ZScvkXLCStPPOecKi5Q562bDeK26VC+3kXnCUgZ git@bob-PC
### autogenerated by gitosis, DO NOT EDIT
command="gitosis-serve bob",no-port-forwarding,no-X11-forwarding,no-agent-forwar
ding,no-pty ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDG2PKZmEwo53Rlm1LvSD52slhu+sTa
UUprTi3nfGhhYY3g1QAaonl6EWt4kZpD0U043f11TH8bJEwhytWo6EwxMsj9qfXcbORx2bj7zvNlHxTx
Akaz0i5vVkHCuv18ykexqcgNULxenMz6LaK9MY0eqP1ZNeWZkJVY1fSSLydv58zTP/ap3SC1H7feSdeF
5Hs9oZCvTR9J7A2KCjKlp5R0dC2EUeYmPGY0H0hmQnU4aGa9bxVq8iMfgzYkopubrpmXWvtMMgE3la+q
MskeHfdF7b0E9APaSnzTtjK2YMt52/FnPBF/99UvVjt9B9yOV3fsUgIGF1Ks5mjUlZRHX6VJ bob@bob
-PC
command="gitosis-serve git@bob-PC",no-port-forwarding,no-X11-forwarding,no-agent
-forwarding,no-pty ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDf2jt0E6wpOj2iUoJttpved
R3jHbu/LizVkzDWFmG/nuwZltnhwz1uCk7ArK0LeRlJFE25A/KS2OGci6xTh9MeZ5E1UHEYhR83HF98K
Lp64QmzwSwL6LWOlDm1Q5fYm4jCdkXs/C0+3zvdxiza5gUBwaBSEpCd3gtWiIMv2T+Vi8O73YlIITMrY
AA3gzh1HBie9xjSiZRITDDiQ3kFUB+aUKkwuprZtmm1PArTUU16OPUjQbP31rsJp6j8oGZVNW+pCiL91
lTvVGCGmqjBqXuT4FMG3/xIBVWN1seflEp8U1HL6ZScvkXLCStPPOecKi5Q562bDeK26VC+3kXnCUgZ
git@bob-PC

bob@bob-PC /home/git/.ssh
$
[/prettify]

[prettify]
$ git clone git@localost:home/git/repositories/gitosis-admin.git
Initialized empty Git repository in /home/survivant/from_ge/gitosis-admin/.git/
The authenticity of host 'ge (192.168.0.13)' can't be established.
RSA key fingerprint is 0c:fb:0b:70:62:1a:7a:2d:15:a8:36:25:6b:11:2e:09.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'localost,192.168.0.13' (RSA) to the list of known hosts.
git@localost's password:
Permission denied, please try again.
git@localost's password:
Permission denied, please try again.
git@localost's password:
Permission denied (publickey,password,keyboard-interactive).
fatal: The remote end hung up unexpectedly
[/prettify]

You will obtain this error when you didn't put the user's key into keydir.

[prettify]
bob@bob-PC ~/git_clone/first_repo
$ git push origin master:refs/heads/master
fatal: 'first_repo.git' does not appear to be a git repository
fatal: The remote end hung up unexpectedly
[/prettify]

I obtain that error message because I didn't add : [group first_repo] in gitosis.conf

[prettify]
win7user@win7user-PC ~/git_clone/first_repo
$ git push
fatal: No destination configured to push to.
[/prettify]

You need to add "origin" in you git repository. Use that command :

win7user@win7user-PC ~/git_clone/first_repo
$ git remote add origin git@localhost:first_repo.git

Another error is when you push a new gitosis.conf version and not still not able to push in your repositories. Be sure that you change the permission on the files :

[prettify]
git@bob-PC ~
$ chmod 755 /home/git/repositories/gitosis-admin.git/hooks/ -R

git@bob-PC ~
$ chmod 755 /home/git/repositories/gitosis-admin.git/hooks/post-update

git@bob-PC ~
$
[/prettify]

I really hope that can help your troubleshooting.

You can follow me on Twitter

Related Topics >>

Comments

thank you very much . it is

thank you very much . it is so uesful.