sbadia/puppet-gitlab

Errors trying to setup gitlab on CentOS 7.

Closed this issue · 4 comments

I'm using the role/profile model and trying to setup gitlab on a CentOS 7 minimal install. I keep getting this error: "ExecJS::RuntimeUnavailable: Could not find a JavaScript runtime. See https://github.com/rails/execjs for a list of available runtimes"

Here is my role.pp:
include profile::firewall
include profile::git
include profile::gitlab
include profile::mysql
include profile::nginx
include profile::redis
include profile::selinux
include profile::vcsrepo
include profile::wget

Here is what I have in hiera, everything else is default:
gitlab::gitlab_backup: true
gitlab::gitlab_backup_path: '/mnt/backups/gitlab'
gitlab::gitlab_repodir: '/mnt/storage/gitlab'
gitlab::gitlab_dbpwd: 'password'
gitlab::gitlab_domain: 'gitlab.domain.example'

This is my profile::gitlab.pp
include ::gitlab

Here is the output I am getting from my first puppet run:
Debug: Executing 'bundle install --without development aws test postgres --deployment'
Notice: /Stage[main]/Gitlab::Install/Exec[install gitlab]/returns: Installing rugged 0.22.2 with native extensions
Notice: /Stage[main]/Gitlab::Install/Exec[install gitlab]/returns:
Notice: /Stage[main]/Gitlab::Install/Exec[install gitlab]/returns: Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
Notice: /Stage[main]/Gitlab::Install/Exec[install gitlab]/returns:
Notice: /Stage[main]/Gitlab::Install/Exec[install gitlab]/returns: /home/git/.rbenv/versions/2.1.6/bin/ruby extconf.rb
Notice: /Stage[main]/Gitlab::Install/Exec[install gitlab]/returns: checking for gmake... yes
Notice: /Stage[main]/Gitlab::Install/Exec[install gitlab]/returns: checking for cmake... no
Notice: /Stage[main]/Gitlab::Install/Exec[install gitlab]/returns: ERROR: CMake is required to build Rugged.
Error: bundle install --without development aws test postgres --deployment returned 5 instead of one of [0]
Error: /Stage[main]/Gitlab::Install/Exec[install gitlab]/returns: change from notrun to 0 failed: bundle install --without development aws test postgres --deployment returned 5 instead of one of [0]
Notice: /Stage[main]/Gitlab::Install/Exec[setup gitlab database]: Dependency Exec[install gitlab] has failures: true
Warning: /Stage[main]/Gitlab::Install/Exec[setup gitlab database]: Skipping because of failed dependencies

I add cmake to the list of required packages for gitlab profile:
Debug: Executing 'bundle install --without development aws test postgres --deployment'
Notice: /Stage[main]/Gitlab::Install/Exec[install gitlab]/returns: executed successfully
Info: /Stage[main]/Gitlab::Install/Exec[install gitlab]: Scheduling refresh of Exec[run migrations]
Debug: /Stage[main]/Gitlab::Install/Exec[install gitlab]: The container Class[Gitlab::Install] will propagate my refresh event
Debug: Execsetup gitlab database: Executing '/usr/bin/yes yes | bundle exec rake gitlab:setup RAILS_ENV=production'
Debug: Executing '/usr/bin/yes yes | bundle exec rake gitlab:setup RAILS_ENV=production'
Notice: /Stage[main]/Gitlab::Install/Exec[setup gitlab database]/returns: rake aborted!
Notice: /Stage[main]/Gitlab::Install/Exec[setup gitlab database]/returns: ExecJS::RuntimeUnavailable: Could not find a JavaScript runtime. See https://github.com/rails/execjs for a list of available runtimes.
Notice: /Stage[main]/Gitlab::Install/Exec[setup gitlab database]/returns: /home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/execjs-2.5.2/lib/execjs/runtimes.rb:48:in autodetect' Notice: /Stage[main]/Gitlab::Install/Exec[setup gitlab database]/returns: /home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/execjs-2.5.2/lib/execjs.rb:5:inmodule:ExecJS'
Notice: /Stage[main]/Gitlab::Install/Exec[setup gitlab database]/returns: /home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/execjs-2.5.2/lib/execjs.rb:4:in <top (required)>' Notice: /Stage[main]/Gitlab::Install/Exec[setup gitlab database]/returns: /home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.11/lib/active_support/dependencies.rb:247:inrequire'
Notice: /Stage[main]/Gitlab::Install/Exec[setup gitlab database]/returns: /home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.11/lib/active_support/dependencies.rb:247:in block in require' Notice: /Stage[main]/Gitlab::Install/Exec[setup gitlab database]/returns: /home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.11/lib/active_support/dependencies.rb:232:inload_dependency'
Notice: /Stage[main]/Gitlab::Install/Exec[setup gitlab database]/returns: /home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.11/lib/active_support/dependencies.rb:247:in require' Notice: /Stage[main]/Gitlab::Install/Exec[setup gitlab database]/returns: /home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/coffee-script-2.4.1/lib/coffee_script.rb:1:in<top (required)>'
Notice: /Stage[main]/Gitlab::Install/Exec[setup gitlab database]/returns: /home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.11/lib/active_support/dependencies.rb:247:in require' Notice: /Stage[main]/Gitlab::Install/Exec[setup gitlab database]/returns: /home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.11/lib/active_support/dependencies.rb:247:inblock in require'
Notice: /Stage[main]/Gitlab::Install/Exec[setup gitlab database]/returns: /home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.11/lib/active_support/dependencies.rb:232:in load_dependency' Notice: /Stage[main]/Gitlab::Install/Exec[setup gitlab database]/returns: /home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.11/lib/active_support/dependencies.rb:247:inrequire'
Notice: /Stage[main]/Gitlab::Install/Exec[setup gitlab database]/returns: /home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/coffee-script-2.4.1/lib/coffee-script.rb:1:in <top (required)>' Notice: /Stage[main]/Gitlab::Install/Exec[setup gitlab database]/returns: /home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.11/lib/active_support/dependencies.rb:247:inrequire'
Notice: /Stage[main]/Gitlab::Install/Exec[setup gitlab database]/returns: /home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.11/lib/active_support/dependencies.rb:247:in block in require' Notice: /Stage[main]/Gitlab::Install/Exec[setup gitlab database]/returns: /home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.11/lib/active_support/dependencies.rb:232:inload_dependency'
Notice: /Stage[main]/Gitlab::Install/Exec[setup gitlab database]/returns: /home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.11/lib/active_support/dependencies.rb:247:in require' Notice: /Stage[main]/Gitlab::Install/Exec[setup gitlab database]/returns: /home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/coffee-rails-4.1.0/lib/coffee-rails.rb:1:in<top (required)>'
Notice: /Stage[main]/Gitlab::Install/Exec[setup gitlab database]/returns: /home/git/gitlab/config/application.rb:6:in <top (required)>' Notice: /Stage[main]/Gitlab::Install/Exec[setup gitlab database]/returns: /home/git/gitlab/Rakefile:5:inrequire'
Notice: /Stage[main]/Gitlab::Install/Exec[setup gitlab database]/returns: /home/git/gitlab/Rakefile:5:in `<top (required)>'
Notice: /Stage[main]/Gitlab::Install/Exec[setup gitlab database]/returns: (See full trace by running task with --trace)
Error: /usr/bin/yes yes | bundle exec rake gitlab:setup RAILS_ENV=production returned 1 instead of one of [0]
Error: /Stage[main]/Gitlab::Install/Exec[setup gitlab database]/returns: change from notrun to 0 failed: /usr/bin/yes yes | bundle exec rake gitlab:setup RAILS_ENV=production returned 1 instead of one of [0]

I google the error and see suggestions to install the execjs & therubyracer gems:
Debug: Executing '/usr/bin/yes yes | bundle exec rake gitlab:setup RAILS_ENV=production'
Notice: /Stage[main]/Gitlab::Install/Exec[setup gitlab database]/returns: rake aborted!
Notice: /Stage[main]/Gitlab::Install/Exec[setup gitlab database]/returns: ExecJS::RuntimeUnavailable: Could not find a JavaScript runtime. See https://github.com/rails/execjs for a list of available runtimes.
Notice: /Stage[main]/Gitlab::Install/Exec[setup gitlab database]/returns: /home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/execjs-2.5.2/lib/execjs/runtimes.rb:48:in autodetect' Notice: /Stage[main]/Gitlab::Install/Exec[setup gitlab database]/returns: /home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/execjs-2.5.2/lib/execjs.rb:5:inmodule:ExecJS'
Notice: /Stage[main]/Gitlab::Install/Exec[setup gitlab database]/returns: /home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/execjs-2.5.2/lib/execjs.rb:4:in <top (required)>' Notice: /Stage[main]/Gitlab::Install/Exec[setup gitlab database]/returns: /home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.11/lib/active_support/dependencies.rb:247:inrequire'
Notice: /Stage[main]/Gitlab::Install/Exec[setup gitlab database]/returns: /home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.11/lib/active_support/dependencies.rb:247:in block in require' Notice: /Stage[main]/Gitlab::Install/Exec[setup gitlab database]/returns: /home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.11/lib/active_support/dependencies.rb:232:inload_dependency'
Notice: /Stage[main]/Gitlab::Install/Exec[setup gitlab database]/returns: /home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.11/lib/active_support/dependencies.rb:247:in require' Notice: /Stage[main]/Gitlab::Install/Exec[setup gitlab database]/returns: /home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/coffee-script-2.4.1/lib/coffee_script.rb:1:in<top (required)>'
Notice: /Stage[main]/Gitlab::Install/Exec[setup gitlab database]/returns: /home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.11/lib/active_support/dependencies.rb:247:in require' Notice: /Stage[main]/Gitlab::Install/Exec[setup gitlab database]/returns: /home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.11/lib/active_support/dependencies.rb:247:inblock in require'
Notice: /Stage[main]/Gitlab::Install/Exec[setup gitlab database]/returns: /home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.11/lib/active_support/dependencies.rb:232:in load_dependency' Notice: /Stage[main]/Gitlab::Install/Exec[setup gitlab database]/returns: /home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.11/lib/active_support/dependencies.rb:247:inrequire'
Notice: /Stage[main]/Gitlab::Install/Exec[setup gitlab database]/returns: /home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/coffee-script-2.4.1/lib/coffee-script.rb:1:in <top (required)>' Notice: /Stage[main]/Gitlab::Install/Exec[setup gitlab database]/returns: /home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.11/lib/active_support/dependencies.rb:247:inrequire'
Notice: /Stage[main]/Gitlab::Install/Exec[setup gitlab database]/returns: /home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.11/lib/active_support/dependencies.rb:247:in block in require' Notice: /Stage[main]/Gitlab::Install/Exec[setup gitlab database]/returns: /home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.11/lib/active_support/dependencies.rb:232:inload_dependency'
Notice: /Stage[main]/Gitlab::Install/Exec[setup gitlab database]/returns: /home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.11/lib/active_support/dependencies.rb:247:in require' Notice: /Stage[main]/Gitlab::Install/Exec[setup gitlab database]/returns: /home/git/gitlab/vendor/bundle/ruby/2.1.0/gems/coffee-rails-4.1.0/lib/coffee-rails.rb:1:in<top (required)>'
Notice: /Stage[main]/Gitlab::Install/Exec[setup gitlab database]/returns: /home/git/gitlab/config/application.rb:6:in <top (required)>' Notice: /Stage[main]/Gitlab::Install/Exec[setup gitlab database]/returns: /home/git/gitlab/Rakefile:5:inrequire'
Notice: /Stage[main]/Gitlab::Install/Exec[setup gitlab database]/returns: /home/git/gitlab/Rakefile:5:in `<top (required)>'
Notice: /Stage[main]/Gitlab::Install/Exec[setup gitlab database]/returns: (See full trace by running task with --trace)
Error: /usr/bin/yes yes | bundle exec rake gitlab:setup RAILS_ENV=production returned 1 instead of one of [0]
Error: /Stage[main]/Gitlab::Install/Exec[setup gitlab database]/returns: change from notrun to 0 failed: /usr/bin/yes yes | bundle exec rake gitlab:setup RAILS_ENV=production returned 1 instead of one of [0]

When I su into the git user and try to run the command manually I get:
bash-4.2$ /usr/bin/yes yes | bundle exec rake gitlab:setup RAILS_ENV=production
bash: bundle: command not found

Any suggestions?

Went ahead and installed nodejs so I can get this up and running.

Hi, thanks for you bug report!

Seems linked to cmake (for rugged gem), same error on my side:

[git@centos-server-70-x64 ~]$ gem install rugged -v '0.22.2'
Fetching: rugged-0.22.2.gem (100%)
Building native extensions.  This could take a while...
ERROR:  Error installing rugged:
    ERROR: Failed to build gem native extension.

    /home/git/.rbenv/versions/2.1.6/bin/ruby extconf.rb
checking for gmake... yes
checking for cmake... no
ERROR: CMake is required to build Rugged.
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
    --with-opt-dir
    --without-opt-dir
    --with-opt-include
    --without-opt-include=${opt-dir}/include
    --with-opt-lib
    --without-opt-lib=${opt-dir}/lib
    --with-make-prog
    --without-make-prog
    --srcdir=.
    --curdir
    --ruby=/home/git/.rbenv/versions/2.1.6/bin/ruby
    --use-system-libraries

extconf failed, exit code 1

Gem files will remain installed in /home/git/.rbenv/versions/2.1.6/lib/ruby/gems/2.1.0/gems/rugged-0.22.2 for inspection.
Results logged to /home/git/.rbenv/versions/2.1.6/lib/ruby/gems/2.1.0/extensions/x86_64-linux/2.1.0-static/rugged-0.22.2/gem_make.out

Full logs here: https://paste.debian.net/plainh/de3ddc4e

Fixed by #227

awesome, can't wait to try it.