0

When setting up an Omnibus Gitlab 12.7.5 Enterprise Edition, on the step where ElasticSearch is integrated, the indexer setup fails with "Could not locate Gemfile or .bundle/ directory" when issuing the command:

sudo -u git -H bundle exec rake gitlab:indexer:install[/home/git/gitlab-elasticsearch-indexer] RAILS_ENV=production

At first, it complained of git not owning some subdirectories of /var/opt/gitlab. That warning disappeared when I chowned them to git

Then it started complaining about "Could not locate Gemfile or .bundle/ directory"

Being a complete Ruby iliterate, here are the steps taken to solve it:

  • Search in forums, googling it, hope stackoverflow groups would have relevant info...
  • Setup bundler by apt: sudo apt install ruby-bundler, it appears installed but the error persists:
XXX@gitlab:~$ sudo dpkg -l ruby-bundler
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                            Version              Architecture         Description
+++-===============================-====================-====================-====================================================================
ii  ruby-bundler                    1.16.1-1             all                  Manage Ruby application dependencies (runtime)

  • Set up bundler through the recommended setup: sudo gem install bundler, appears to setup OK, but the error persists
Fetching: bundler-2.1.4.gem (100%)
Successfully installed bundler-2.1.4
Parsing documentation for bundler-2.1.4
Installing ri documentation for bundler-2.1.4
Done installing documentation for bundler after 3 seconds
1 gem installed
  • Tried cd-ing to /var/opt/gitlab as suggested on some SO cases but the error is still there

/var/opt/gitlab/.bundle is empty, I do not know it that is a clue of some mis-setup

Any help welcome with the issue, it is surely caused by my lack of Ruby command

[EDIT:] Following this question I have found that my disk is almost full (28.3 GiB used out of 30). I will increase it while waiting for some real knowledge on the issue => no luck there, clearly it is not a space issue

[EDIT2:] Given that the home dir specified for user git in passwd is /var/opt/gitlab I have tried executing the command using that dir as installation dir, that is: sudo -u git -H bundle exec rake gitlab:indexer:install[/var/opt/gitlab/gitlab-elasticsearch-indexer] RAILS_ENV=production but the "Could not locate Gemfile or .bundle/ directory" error is still there

[EDIT3:] Seems that in the product features page the ElasticSearch integration is a "Bronze"(paid) feature. That might be the cause why the indexer refuses to install on my "Core" (free) system. I had set a post on Gitlab Forums to confirm, hope to get some useful info soon!

jmcollantes
  • 84
  • 1
  • 8

2 Answers2

0

I have to say that I'm working with premium version and I stumbled also to the exactly same problem. After that I realized that our gitlab enterprise edition 12.7.5 was actually already installed with the indexer. I don't know if that can be the case with your version.

I got indexing running with:

gitlab-rake gitlab:elastic:create_empty_index && gitlab-rake gitlab:elastic:index
  • Hi, Tuppikake, thanks for the help. That's part of the following section, "Adding GitLab’s data to the Elasticsearch index" I have tried the command `sudo gitlab-rake gitlab:elastic:create_empty_index` but it failed with 'Faraday::ConnectionFailed: Connection refused - Connection refused - connect(2) for "127.0.0.1" port 9200 (localhost:9200)' I guess that is because I cannot set the ElasticSearch host and port because it does not appear on "Settings"->"Integrations", due to being CORE. I will wait for confirmation on the official forums and mark your answer as correct if so – jmcollantes Feb 13 '20 at 13:10
0

Finally I found the answer.

Gitlab takes out of the UI the fields to properly configure this unless you pay a license -you can run an Enterprise Version without paying a license-

I understand the business logic behind it but nevertheless it should be more documented

jmcollantes
  • 84
  • 1
  • 8