4

I am having problem with pushing to my server which hosts redmine and repositories. I do have gitolite redmine plugin for redmine & latest gitolite v3.5.x. When i clone repository i.e.

git clone git@<ip address>:repositories/test-project-redmine.git 
// btw: i do get asked for password even though i have send my public key to redmine ?

this repository is cloned without a problem. When i create a simple readme.txt file and then i try to push this back to the repository i get the following

enter image description here

any one what can cause this issue ? Thanks :)

Update:

I have run find / -path '*Gitolite/Hooks/Update.pm' -print 2>/dev/null and yes the files do exist. Also i have checked the file permissions for user 'git' who runs the repositories and he has all required permissions. Picture attached.

enter image description here

however search did not return anything regarding perl

I have found THIS on the github - official plugin page - theoretical solution to the problem. I have done as suggested with inserting this:

__DATA__
#!/usr/bin/perl

BEGIN {
  exit 0 if exists $ENV{GL_BYPASS_UPDATE_HOOK};
}

use strict;
use warnings;
...

into the following files:

/<git user home dir>/bin/lib/Gitolite/Hooks/Update.pm
/<git user home dir>/gitolite/src/lib/Gitolite/Hooks/Update.pm
/<git user home dir>/.gitolite/hooks/common/update

however still no success... ?

Maciej Cygan
  • 5,351
  • 5
  • 38
  • 72
  • This is an incorrect installation of [git `pre-recieve` hook](http://git-scm.com/book/en/Customizing-Git-Git-Hooks) on the remote side. The hook is written in perl and some perl modules are missing – user3159253 Apr 20 '14 at 23:16
  • @user3159253 i have all perl modules on server, so it can not be missing something – Maciej Cygan Apr 20 '14 at 23:26
  • Well, it says clearly about it. I would suggest to check existance of Gitolite/Hooks/Update.pm (use `find / -path '*Gitolite/Hooks/Update.pm' -print 2>/dev/null`) then if the file actually exists, check if it resides in directories, in which `perl` searches for modules (copy `@INC` from the message), and finally check that the module file permissions are suitable for the account which runs th repository. – user3159253 Apr 20 '14 at 23:36
  • @user3159253 i have checked and the file exists + correct permisions are set for user who runs the repository. search returned 0 regarding perl. And i do not quite get what should i copy where - Question edited – Maciej Cygan Apr 20 '14 at 23:54
  • Well, you may check if the hook isn't executed in a chrooted or somehow else restricted environment. Or, better, you may copy this and other required modules right into the hook directory, preserving the structure (that is, `/Gitolite/Hooks/Update.pm`). This is of course an ugly solution, but may be it helps – user3159253 Apr 21 '14 at 01:25
  • @user3159253 could you kindly tell me how do i add the path to '@INC' i tried to google where is the file that contains the list but i can not find it – Maciej Cygan Apr 21 '14 at 16:44

1 Answers1

0

Well, StackOverflow suggests this solution:

use lib '/path/you/want/to/add';

right in the beginning of the script, before other use and require directives. But remember! there's literally a decennary since I did some perl last time, so you'd better check twice :)

Community
  • 1
  • 1
user3159253
  • 16,836
  • 3
  • 30
  • 56
  • Cool the question is in which file do i put the directory to the .pm module ? – Maciej Cygan Apr 21 '14 at 22:10
  • Hm, likely there should be .git/hooks/pre-receive in your repository – user3159253 Apr 21 '14 at 22:13
  • unfortunately there isn't – Maciej Cygan Apr 21 '14 at 23:04
  • Ok so it seems like the reason why i get this error is because i cloned the repository ommiting gitolite - and when i try to push back it throws this error. according to specifications i should use git@: but this returns back 'fatal: repo does not appear to be a git repository, 'fatal: Could not read from remote repository..'... Please make sure you have the correct access rights.. – Maciej Cygan Apr 21 '14 at 23:24