2

I am trying to follow the instructions at https://gitlab.com/gitlab-org/gitlab-ee/blob/master/doc/update/8.7-ce-to-ee.md to upgrade our GitLab CE server to GitLab EE

Server is CentOS 6.7, with GitLab CE originally installed by

$ curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.rpm.sh | sudo bash
$ sudo yum install gitlab-ce

And the current version is

$ rpm -q gitlab-ce
gitlab-ce-8.7.5-ce.0.el6.x86_64

I follow the steps from the upgrade guide linked above, but get an error

$ cd /home/git/gitlab
$ sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=production
sudo: bundle: command not found

I am aware of this problem from earlier work and other questions here. I think the base cause is that we have installed from rpm, so should use "gitlab-rake" instead of "bundle exec rake".

That will suffice for the above problem, but the next steps in the guide include

$ sudo -u git -H bundle install ...

It seems that gitlab-rake will not work for that, so I need to actually use the bundle command. But I have no idea which one - there are currently 19 different files on disk called .../bin/bundle, of which 7 came from the gitlab rpm.

So: which "bundle" command should I use when the guide tells me to

sudo -u git -H bundle install ....

?

jalanb
  • 1,097
  • 2
  • 11
  • 37
  • try `which bundle` as normal user and use absolute path to that one with `sudo -u git` – mb21 Jun 26 '16 at 10:45
  • If what @mb21 said doesn't work, you can also try installing bundle manually. If I recall correctly, `sudo -H gem install -g bundle` should work. – Zenexer Jun 27 '16 at 09:21

1 Answers1

1

This may or may not help your specific case but I've been facing a similar issue with GitLab CE (Community Edition) running on CentOS 7. Everything was working smoothly but when trying to run some of the documented service commands that make use of bundle, I found out that bundle wasn't in anyone's $PATH: neither root's nor the git user's.

In the end, systemd pointed me to the right environment, namely:

# systemctl status gitlab-runsvdir.service | grep Loaded
Loaded: loaded (/usr/lib/systemd/system/gitlab-runsvdir.service; enabled; vendor preset: disabled)
# grep '^Exec' /usr/lib/systemd/system/gitlab-runsvdir.service
ExecStart=/opt/gitlab/embedded/bin/runsvdir-start
# grep PATH /opt/gitlab/embedded/bin/runsvdir-start
PATH=/opt/gitlab/bin:/opt/gitlab/embedded/bin:/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin

Et voilà.

That script (/opt/gitlab/embedded/bin/runsvdir-start) also includes a fair bit of scaffolding to set the correct runtime environment, which is useful to study and apply where appropriate.

YMMV obviously, particularly if you're not running GitLab under systemd but a similar approach might work with other init systems.

Finally it's worth noting that (as pointed out in the original q), any rake command should be run using gitlab-rake.

sxc731
  • 2,418
  • 2
  • 28
  • 30