gitolite on almalinux

25 views
Skip to first unread message

Michael Höfer

unread,
Jun 19, 2023, 8:58:09 PM6/19/23
to gitolite
I have successfully installed gitolite on a fresh AlmaLinux 9.2 machine.
  - Commit/push work without errors
  - there are no errors in the gitolite logs or the system logs
  - the gitolite.conf file on the gitolite machine is updated
  - but the new repo is not created.

how did i install:
  - as root on gitolite machine:
    - useradd -r -m -s /bin/bash gitolite
    - su - gitolite
  - as gitolite on gitolite machine:
    - cd $HOME
    - mkdir bin
    - mkdir .ssh
    - touch .ssh/authorized_keys
    - echo "ssh-ed25519 AAAAC3NzaC1lZD..." > .ssh/authorized_keys
    - chmod 0700 .ssh
    - chmod 0600 .ssh/authorized_keys
    - gitolite/install -to $HOME/bin
    - ./bin/gitolite setup -pk admin.pub

how did i add a repo (gitolite-ls1 is configured in ~/.ssh/config):
  - as user on local machine:
    - cd ~/Projekte
    - git clone gitolite-ls1:gitolite-admin
    - add new repo hfTest in conf/gitolite.conf
    - git add conf
    - git commit -m "add test repo"
    - git push

output from this command:
Enter passphrase for key '/home/michael/.ssh/admin':
Enumerating objects: 7, done.
Counting objects: 100% (7/7), done.
Delta compression using up to 6 threads
Compressing objects: 100% (3/3), done.
Writing objects: 100% (4/4), 386 bytes | 386.00 KiB/s, done.
Total 4 (delta 0), reused 0 (delta 0), pack-reused 0
To gitolite-ls1:gitolite-admin
   f157628..183ab51  main -> main

  as user on local machine:
    - cd ~/Projekte
    - git clone gitolite-ls1:hfTest

output from this command:
Cloning into 'hfTest'...
Enter passphrase for key '/home/michael/.ssh/admin':
FATAL: R any hfTest admin DENIED by fallthru
(or you mis-spelled the reponame)
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

What did I do to troubleshoot:
  - as user on local machine:
    - git pull (Already up to date.)
    - cd ..
    - rm -rf gitolite-admin
    - git clone gitolite-ls1:gitolite-admin (the new repo is included)

  - as root on gitolite-machine:
    - cat /etc/passwd | grep gitolite
      gitolite:x:991:991::/home/gitolite:/bin/bash
    - setenforce 0

  - as gitolite on gitolite-machine
    - ls repositories (the new is not created)
    - ls -la repositories/gitolite-admin.git/hooks/*update
      lrwxrwxrwx. 1 gitolite gitolite 57 Jun 19 11:44 repositories/gitolite-admin.git/hooks/post-update -> /home/gitolite/.gitolite/hooks/gitolite-admin/post-update
      lrwxrwxrwx. 1 gitolite gitolite 44 Jun 19 11:44 repositories/gitolite-admin.git/hooks/update -> /home/gitolite/.gitolite/hooks/common/update
    - ls -laL repositories/gitolite-admin.git/hooks/*update
      -rwxr-xr-x. 1 gitolite gitolite 343 Jun 19 11:44 repositories/gitolite-admin.git/hooks/post-update
      -rwxr-xr-x. 1 gitolite gitolite 308 Jun 19 11:44 repositories/gitolite-admin.git/hooks/update
    - gitolite list-users
      @all
      admin

What else can I try?
sorry for my bad english, I'll probably never learn it

Sitaram Chamarty

unread,
Jun 19, 2023, 9:22:13 PM6/19/23
to Michael Höfer, gitolite
On Mon, Jun 19, 2023 at 12:25:07PM -0700, 'Michael Höfer' via gitolite wrote:
> I have successfully installed gitolite on a fresh AlmaLinux 9.2 machine.
> - Commit/push work without errors
> - there are no errors in the gitolite logs or the system logs
> - the gitolite.conf file on the gitolite machine is updated
> - but the new repo is not created.

Normally I'd stop here and say your hooks are not present
(somehow) but later you showed them.

Can you check the gitolite logs? Should be in ~/.gitolite/logs
on the server.

A normal push looks like this. Please paste what you see for
the timeframe of the attempted push.

2023-06-20.06:36:34 1973186 ssh ARGV=admin SOC=git-upload-pack 'gitolite-admin' FROM=::1
2023-06-20.06:36:34 1973186 pre_git gitolite-admin admin R any refs/.*
2023-06-20.06:36:34 1973186 system,git,shell,-c,git-upload-pack '/home/g3/repositories/gitolite-admin.git'
2023-06-20.06:36:34 1973186 END
2023-06-20.06:36:35 1973228 ssh ARGV=admin SOC=git-receive-pack 'gitolite-admin' FROM=::1
2023-06-20.06:36:35 1973228 pre_git gitolite-admin admin W any refs/.*
2023-06-20.06:36:35 1973228 system,git,shell,-c,git-receive-pack '/home/g3/repositories/gitolite-admin.git'
2023-06-20.06:36:36 1973228 update gitolite-admin admin W refs/heads/master ff324de2251fc12d4e14ed1bec50a11aaf9ac492 f1848942d42eace0b76b0e871c7121a94174208a refs/.*
2023-06-20.06:36:36 1973228 system,gitolite compile
2023-06-20.06:36:36 1973228 system,gitolite compile-template-data
2023-06-20.06:36:36 1973228 system,/home/g3/gitolite/src/commands/compile-template-data
2023-06-20.06:36:36 1973228 system,gitolite trigger POST_COMPILE
2023-06-20.06:36:36 1973228 system,/home/g3/gitolite/src/triggers/post-compile/ssh-authkeys,POST_COMPILE
2023-06-20.06:36:36 1973228 system,/home/g3/gitolite/src/triggers/post-compile/update-git-configs,POST_COMPILE
2023-06-20.06:36:36 1973228 system,/home/g3/gitolite/src/triggers/post-compile/update-gitweb-access-list,POST_COMPILE
2023-06-20.06:36:36 1973228 system,/home/g3/gitolite/src/commands/access,%,gitweb,R,any
2023-06-20.06:36:36 1973228 system,/home/g3/gitolite/src/commands/git-config,-r,%,gitweb\.
2023-06-20.06:36:36 1973228 system,/home/g3/gitolite/src/triggers/post-compile/update-git-daemon-access-list,POST_COMPILE
2023-06-20.06:36:36 1973228 system,/home/g3/gitolite/src/commands/access,%,daemon,R,any
2023-06-20.06:36:36 1973228 END

Michael Höfer

unread,
Jun 20, 2023, 2:56:51 AM6/20/23
to gitolite
the complete log:

2023-06-19.20:27:09     55948           system,git init --bare >&2
2023-06-19.20:27:09     55948           system,gitolite compile-template-data
2023-06-19.20:27:09     55948           system,/home/gitolite/bin/commands/compile-template-data
2023-06-19.20:27:09     55948           system,/home/gitolite/bin/triggers/post-compile/ssh-authkeys,POST_COMPILE
2023-06-19.20:27:09     55948           system,/home/gitolite/bin/triggers/post-compile/update-git-configs,POST_COMPILE
2023-06-19.20:27:09     55948           system,/home/gitolite/bin/triggers/post-compile/update-gitweb-access-list,POST_COMPILE
2023-06-19.20:27:09     55948           system,/home/gitolite/bin/commands/access,%,gitweb,R,any
2023-06-19.20:27:09     55948           system,/home/gitolite/bin/commands/git-config,-r,%,gitweb\.
2023-06-19.20:27:09     55948           system,/home/gitolite/bin/triggers/post-compile/update-git-daemon-access-list,POST_COMPILE
2023-06-19.20:27:09     55948           system,/home/gitolite/bin/commands/access,%,daemon,R,any
2023-06-19.20:27:09     55948   END
2023-06-19.20:27:51     56032   ssh     ARGV=admin      SOC=git-upload-pack 'gitolite-admin'    FROM=172.21.17.198
2023-06-19.20:27:51     56032   pre_git gitolite-admin  admin   R       any     refs/.*
2023-06-19.20:27:51     56032           system,git,shell,-c,git-upload-pack '/home/gitolite/repositories/gitolite-admin.git'
2023-06-19.20:27:51     56032   END
2023-06-19.20:33:05     56076   ssh     ARGV=admin      SOC=git-receive-pack 'gitolite-admin'   FROM=172.21.17.198
2023-06-19.20:33:05     56076   pre_git gitolite-admin  admin   W       any     refs/.*
2023-06-19.20:33:05     56076           system,git,shell,-c,git-receive-pack '/home/gitolite/repositories/gitolite-admin.git'
2023-06-19.20:33:05     56076   update  gitolite-admin  admin   W       refs/heads/main f157628b451b91cbbc28cb41fab6a4452c2aac93        183ab5101af33174a6b433e9a05f6c442d18eb3a        refs/.*
2023-06-19.20:33:05     56076   END
2023-06-19.20:51:08     56131   ssh     ARGV=admin      SOC=git-upload-pack 'hfTest'    FROM=172.21.17.198
2023-06-19.20:51:08     56131           repo 'hfTest' missing
2023-06-19.20:51:08     56131   die     R any hfTest admin DENIED by fallthru<<newline>>(or you mis-spelled the reponame)
2023-06-19.20:53:40     56174   ssh     ARGV=admin      SOC=git-upload-pack 'gitolite-admin'    FROM=172.21.17.198
2023-06-19.20:53:40     56174   pre_git gitolite-admin  admin   R       any     refs/.*
2023-06-19.20:53:40     56174           system,git,shell,-c,git-upload-pack '/home/gitolite/repositories/gitolite-admin.git'
2023-06-19.20:53:40     56174   END
2023-06-19.21:02:10     56229   ssh     ARGV=admin      SOC=git-upload-pack 'gitolite-admin'    FROM=172.21.17.198
2023-06-19.21:02:10     56229   pre_git gitolite-admin  admin   R       any     refs/.*
2023-06-19.21:02:10     56229           system,git,shell,-c,git-upload-pack '/home/gitolite/repositories/gitolite-admin.git'
2023-06-19.21:02:10     56229   END

Sitaram Chamarty

unread,
Jun 20, 2023, 4:09:29 AM6/20/23
to Michael Höfer, gitolite
On Mon, Jun 19, 2023 at 11:56:51PM -0700, 'Michael Höfer' via gitolite wrote:

> 2023-06-19.20:33:05 56076 update gitolite-admin admin W
> refs/heads/main f157628b451b91cbbc28cb41fab6a4452c2aac93
> 183ab5101af33174a6b433e9a05f6c442d18eb3a refs/.*
> 2023-06-19.20:33:05 56076 END

I expect to see lots of lines between the above two lines (see
my previous message for example; in particular, "gitolite
compile" and "gitolite triggers POST_COMPILE" and others).

Looks like the post-update hook in your gitolite-admin repo is
not firing. I can see from your previous message that its
permissions etc seem fine, so I have no idea why this could be
happening.

Grasping at straws here, perhaps you could put the line
print STDERR "we are here\n";
just above line 12 in
~/repositories/gitolite-admin.git/hooks/post-update, then push a
trivial change (like add/remove a blank line) and see if that
messages shows up.

Michael Höfer

unread,
Jun 20, 2023, 5:09:06 AM6/20/23
to gitolite
I have added the line on .gitolite/hooks/common/update
print STDERR "we are here update\n";

and on .gitolite/hooks/gitolite-admin/post-update
print STDERR "we are here post-update\n";

After command git push, i see

Enter passphrase for key '/home/michael/.ssh/admin':
Enumerating objects: 11, done.
Counting objects: 100% (11/11), done.

Delta compression using up to 6 threads
Compressing objects: 100% (6/6), done.
Writing objects: 100% (8/8), 697 bytes | 697.00 KiB/s, done.
Total 8 (delta 2), reused 0 (delta 0), pack-reused 0
remote: we are here update
remote: we are here post-update
To gitolite-ls1:gitolite-admin
   183ab51..7707cbd  main -> main

on gitolite-machine as gitolite:
  - ls -la repositories/

drwx------. 8 gitolite gitolite  181 Jun 20 10:59 gitolite-admin.git
drwx------. 7 gitolite gitolite  162 Jun 19 20:27 testing.git

I'm at a loss

Roland Wirth

unread,
Jun 20, 2023, 7:24:47 AM6/20/23
to gito...@googlegroups.com
Hi Michael,

you are pushing to `gitolite-admin:main`, gitolite only runs the
triggers for pushes to `master`. The name is hard-coded in
src/lib/Gitolite/Hooks/PostUpdate.pm. If you want to change the magic
branch name, I guess you can replace all occurrences of master with main
there.

Cheers,
Roland

Discussion "Change default branch in gitolite-admin":
https://groups.google.com/g/gitolite/c/heWX6k9T85U/m/wqc6xJyqBAAJ
> --
> You received this message because you are subscribed to the Google
> Groups "gitolite" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to gitolite+u...@googlegroups.com
> <mailto:gitolite+u...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/gitolite/22220f08-2afc-42de-b52f-bdc68495a971n%40googlegroups.com <https://groups.google.com/d/msgid/gitolite/22220f08-2afc-42de-b52f-bdc68495a971n%40googlegroups.com?utm_medium=email&utm_source=footer>.

Michael Höfer

unread,
Jun 20, 2023, 7:51:10 AM6/20/23
to gitolite
That was the key tip. I missed the discussion about the branch name. Thank you for taking the time to troubleshoot.

Greetings Michael
Reply all
Reply to author
Forward
0 new messages