I'm trying to configure my own private git server to make it available over HTTP, but I'm stuck and I need some help.
I reviewed several tutorials on how to serve a git repository over HTTP and I think almost all the pieces are in the right places as currently I'm able to clone the remote repository from several clients on different workstations and I can also browse the repositories with the gitweb application.
From the clients I'm able to run the git commit
command, but I'm not able to push the changes to the master branch.
The git push comman logs the following error:
remote: error: unable to create temporary file: Operation not permitted
remote: fatal: failed to write object
error: unpack failed: unpack-objects abnormal exit
Update: after several tests, I managed to push four times from several clients running. The successfull push happened just repeating several times the execution of the same command. This lead me to believe that the problem might be on some overloading trouble on the server side that is not allowing to receive the changes, but I'm still not able to understand which configuration is missing.
The environment is as below:
$ uname -av
Linux odroid 3.8.13.30 #1 SMP PREEMPT Fri Feb 20 14:34:08 BRST 2015 armv7l armv7l armv7l GNU/Linux
$ apache2 -version
Server version: Apache/2.4.7 (Ubuntu)
Server built: Jan 14 2016 17:49:32
$ git --version
git version 1.9.1
The permission should not be an issue as the repositories folders have rw permission for the group that is running the apache service
$ ls /var/git/repos
drwxrwx--- 0 odroid www-data 0 may 28 23:15 testremote.git
drwxrwx--- 0 odroid www-data 0 may 28 23:17 test
$ ps aux | grep apache
root 4524 0.0 0.8 107588 17836 ? Ss may25 0:17 /usr/sbin/apache2 -k restart
www-data 7797 0.0 0.4 107836 8372 ? S 00:35 0:00 /usr/sbin/apache2 -k restart
www-data 7798 0.0 0.3 107636 7392 ? S 00:35 0:00 /usr/sbin/apache2 -k restart
www-data 7799 0.0 0.4 107836 8300 ? S 00:35 0:00 /usr/sbin/apache2 -k restart
www-data 7800 0.0 0.3 107692 7916 ? S 00:35 0:00 /usr/sbin/apache2 -k restart
www-data 7801 0.0 0.3 107636 7392 ? S 00:35 0:00 /usr/sbin/apache2 -k restart
www-data 7812 0.0 0.3 107636 7404 ? S 00:35 0:00 /usr/sbin/apache2 -k restart
My current apache configuration is:
SetEnv GIT_PROJECT_ROOT /mnt/wh13/sandbox/git/repo/
SetEnv GIT_HTTP_EXPORT_ALL 1
SetEnv REMOTE_USER $REDIRECT_REMOTE_USER
ScriptAliasMatch "(?x)^/git/\
(.*\.git/(HEAD|info/refs|objects/\
(info/[^/]+|[0-9a-f]{40}\.(pack|idx))|git-(upload|receive)-pack))$"\
/usr/lib/git-core/git-http-backend/$1
ScriptAlias /git/ /usr/share/gitweb/
ScriptLog ${APACHE_LOG_DIR}/cgi_log.log
<Directory /usr/share/gitweb>
Options +FollowSymLinks +ExecCGI
AddHandler cgi-script .cgi
DirectoryIndex gitweb.cgi
</Directory>
<Directory "/usr/lib/git-core*">
Options ExecCGI Indexes
AuthType Basic
AuthName "GIT Repositories"
AuthUserFile /mnt/wh13/sandbox/git/htpasswd.git
Require valid-user
Order allow,deny
Allow from all
</Directory>
<Directory "/usr/share/gitweb/static">
Options -ExecCGI +Indexes
SetHandler default-handler
</Directory>
I'm not understanding which operation is not permitted and also trying to get more details from the CGI script using the ScriptLog ${APACHE_LOG_DIR}/cgi_log.log
directive didn't provide any useful information.
Can anybody please provide some suggestion on how to further troubleshoot and fix the problem?
Thanks in advance and sorry for the long post