Search code examples
gitdebiangitolitegitlab

Gitlab installation based on gitolite fails


it is so frustrating: I am looking for a managable web-based solution based on gitolite. Redmine failed all the time due to missing or outdated ruby packages. At least I tried to use gitLab. My last guide that I've used was the regular one:

GitlabHQ

I reproduced each point, step by step, but there is no way to perform an errorfree setup:

This should be one of the final steps:

sudo -u gitlab -H bundle exec rake gitlab:check RAILS_ENV=production

but the output tells me user 'gitolite' (=git) is not in gitolite group and how to fix that:

Checking Environment ...

gitlab user is in gitolite group? ... no
Try fixing it: sudo usermod -a -G gitolite gitlab

For more information see: doc/install/installation.md in section "System Users"

Please fix the error above and rerun the checks. Has no "-e" in ~gitolite/.profile ... rake aborted!

No such file or directory - /var/lib/gitolite/.profile

/home/gitlab/gitlab/lib/tasks/gitlab/check.rake:320:in `read'

/home/gitlab/gitlab/lib/tasks/gitlab/check.rake:320:in check_issue_1056_shell_profile_error' /home/gitlab/gitlab/lib/tasks/gitlab/check.rake:257:inblock (3 levels) in '

Tasks: TOP => gitlab:check => gitlab:env:check

(See full trace by running task with --trace

But there is no chance to handle this. The output remains unchanged. Even if an administrator account was created there is no way to start a Webserver to manage the account.

All the time "bad gateway"

Do you know how to fix that? Or do you know another suitable solution based on gitolite?

Thanks a lot - again!


Solution

  • This appears to be a user or permissions problem.

    Does your /etc/passwd file and /etc/group file show the user 'git'?

    > grep git /etc/passwd
    git:x:....
    > grep git /etc/group
    git:x:....
    

    If the user or group cannot be found there, it does not exist.

    In that case you will have to confirm that you followed the command that was mentioned in the tutorial above.

    > sudo adduser \
      --system \
      --shell /bin/sh \
      --gecos 'Git Version Control' \
      --group \
      --disabled-password \
      --home /home/git \
    git
    

    You will also have to have permissions to create such a user.

    Otherwise, after reading the documentation, It seems you are setting your $PATH to complete certain tasks as well as create a .profile file for the user.

    Confirm that the line ...

    > sudo -u git -H sh -c 'printf "%b\n%b\n" "PATH=\$PATH:/home/git/bin" "export PATH" >> /home/git/.profile'
    

    creates the correct file .profile by running

    > sudo su git
    > ls -lah /home/git/ | grep .profile
    

    If grep doesn't show a .profile file you might want to confirm your user has the right permissions to create the file.