sbadia / puppet-gitlab

Puppet module for manage GitLab installation
http://forge.puppetlabs.com/sbadia/gitlab
GNU General Public License v3.0
131 stars 77 forks source link

First Installation fails because of an Notification Message while `gem install charlock_holmes`. #210

Open tobiashochguertel opened 9 years ago

tobiashochguertel commented 9 years ago

It's not really a big problem, but for the perfection it would be nice to get this fixed. I installed gitlab on an empty server with Ubuntu 14.04, and the puppet agent run fails because of the output of "This could take a while..." - I think the exit code 1 with this message has to be catched and handeled to further run.

I done this installation from the console promp manually and restarted the puppet agent run. Things went nice.

Notice: /Stage[main]/Profiles::Scm_service_git/Exec[initial update]/returns: executed successfully
Error: Execution of '/home/git/.rbenv/versions/2.1.2/bin/gem install --no-rdoc --no-ri -v0.6.9.4 charlock_holmes' returned 1: Building native extensions.  This could take a while...
Error: /Stage[main]/Gitlab::Setup/Rbenv::Gem[charlock_holmes]/Rbenvgem[git/2.1.2/charlock_holmes/0.6.9.4]/ensure: change from absent to 0.6.9.4 failed: Execution of '/home/git/.rbenv/versions/2.1.2/bin/gem install --no-rdoc --no-ri -v0.6.9.4 charlock_holmes' returned 1: Building native extensions.  This could take a while...
Notice: /Stage[main]/Gitlab::Package/Vcsrepo[/home/git/gitlab]: Dependency Rbenvgem[git/2.1.2/charlock_holmes/0.6.9.4] has failures: true
....

I hope this Helps.

sbadia commented 9 years ago

seems working fine now (with rbenv) https://paste.debian.net/plainh/16dd7871 (just tested in #223 ) Thanks!

gcmalloc commented 9 years ago

I'm having the same issue on centos 7 with the version 1.0.0 of this module.

gcmalloc commented 9 years ago

Ok, run a second time, everything worked fine. I suspect a dependency issue. Will look into it

sbadia commented 9 years ago

oh! thanks @gcmalloc for the quick feedback! I re-open the issue then, I take a look with beaker on centos then.

sergef commented 9 years ago

Same issue here with first installation, little bit more details:

err Execution of '/home/git/.rbenv/versions/2.1.6/bin/gem install --no-rdoc --no-ri -v0.6.9.4 charlock_holmes' returned 1: Building native extensions. This could take a while...   Puppet          2015-07-15 05:18 UTC
err Could not find command 'bundle' /Stage[main]/Gitlab::Install/Exec[install gitlab]   /etc/puppetlabs/puppet/environments/ci/modules/gitlab/manifests/install.pp  105 2015-07-15 05:18 UTC
err change from absent to 0.6.9.4 failed: Execution of '/home/git/.rbenv/versions/2.1.6/bin/gem install --no-rdoc --no-ri -v0.6.9.4 charlock_holmes' returned 1: Building native extensions. This could take a while... /Stage[main]/Gitlab::Setup/Rbenv::Gem[charlock_holmes]/Rbenvgem[git/2.1.6/charlock_holmes/0.6.9.4]/ensure   /etc/puppetlabs/puppet/environments/ci/modules/rbenv/manifests/gem.pp   30  2015-07-15 05:18 UTC
err Failed to call refresh: Could not find command 'bundle' /Stage[main]/Gitlab::Install/Exec[install gitlab]   /etc/puppetlabs/puppet/environments/ci/modules/gitlab/manifests/install.pp  105 2015-07-15 05:18 UTC
err ruby /home/git/gitlab-shell/bin/install returned 1 instead of one of [0]    /Stage[main]/Gitlab::Install/Exec[install gitlab-shell] /etc/puppetlabs/puppet/environments/ci/modules/gitlab/manifests/install.pp  35  2015-07-15 05:18 UTC
err Failed to call refresh: ruby /home/git/gitlab-shell/bin/install returned 1 instead of one of [0]    /Stage[main]/Gitlab::Install/Exec[install gitlab-shell]

It looks like Could not find command 'bundle' causing this problem. I'll continue investigation, probably caused by incomplete deployment of rbenv package?

sergef commented 9 years ago

Here's the gist with debug info: https://gist.github.com/sergef/4e5f8b3da79fb2def0e4 File error-when-running-as-sudo.log is actually /home/git/.rbenv/versions/2.1.6/lib/ruby/gems/2.1.0/extensions/x86_64-linux/2.1.0-static/charlock_holmes-0.6.9.4/gem_make.out Last line is showing the issue Permission denied @ dir_chdir - /home/sudouser... somehow it's trying to return to home dir of the user running puppet agent from sudo session (could be sudo environment issue or build issue?).

I've tried clean deployment running puppet agent as a service - and charlock_holmes installed without problems. But some errors still there:

err Could not evaluate: Could not find command 'bundle' /Stage[main]/Gitlab::Install/Exec[install gitlab]   /etc/puppetlabs/puppet/environments/ci/modules/gitlab/manifests/install.pp  105 2015-07-15 06:49 UTC
err Could not find command 'bundle' /Stage[main]/Gitlab::Install/Exec[install gitlab]   /etc/puppetlabs/puppet/environments/ci/modules/gitlab/manifests/install.pp  105 2015-07-15 06:49 UTC
err Failed to call refresh: Could not find command 'bundle' /Stage[main]/Gitlab::Install/Exec[install gitlab]

tbc...

sergef commented 9 years ago

To followup here, I was able to install gitlab at once from 0.

    class { 'rbenv': } ->
    rbenv::plugin { 'sstephenson/ruby-build': } ->
    rbenv::build { $ruby_version:
        global => true
    } ->
    rbenv::gem { 'bigdecimal':
        version      => '1.2.4',
        ruby_version => $ruby_version,
        skip_docs    => true,
        timeout      => 0
    } ->
    rbenv::gem { 'charlock_holmes':
        version      => '0.6.9.4',
        ruby_version => $ruby_version,
        skip_docs    => true,
        timeout      => 0
    } ->
    rbenv::gem { 'io-console':
        version      => '0.4.3',
        ruby_version => $ruby_version,
        skip_docs    => true,
        timeout      => 0
    } ->
    rbenv::gem { 'json':
        version      => '1.8.1',
        ruby_version => $ruby_version,
        skip_docs    => true,
        timeout      => 0
    } ->
    rbenv::gem { 'minitest':
        version      => '4.7.5',
        ruby_version => $ruby_version,
        skip_docs    => true,
        timeout      => 0
    } ->
    rbenv::gem { 'psych':
        version      => '2.0.5',
        ruby_version => $ruby_version,
        skip_docs    => true,
        timeout      => 0
    } ->
    rbenv::gem { 'rake':
        version      => '10.1.0',
        ruby_version => $ruby_version,
        skip_docs    => true,
        timeout      => 0
    } ->
    rbenv::gem { 'rdoc':
        version      => '4.1.0',
        ruby_version => $ruby_version,
        skip_docs    => true,
        timeout      => 0
    } ->
    rbenv::gem { 'test-unit':
        version      => '2.1.6.0',
        ruby_version => $ruby_version,
        skip_docs    => true,
        timeout      => 0
    } ->
    Exec {
        path => [
            '/usr/local/rbenv/shims',
            '/usr/local/rbenv/bin',
            '/usr/local/sbin',
            '/usr/local/bin',
            '/usr/sbin',
            '/usr/bin',
            '/sbin',
            '/bin'
        ]
    }

Also installation on CentOS and RedHat 7.1 required firewall and selinux modules.

sbadia commented 9 years ago

Hi, thanks @sergef for the debug and feedback!! About jdowning/rbenv what the changes with alup/rbenv do you think we must to change? And about Exec path, it's needed for users who have a ruby in a different path, it's really needed to revert that ? Indeed for firewall and selinux module/config, don't hesitate if you want to made a pull-request :)

sergef commented 9 years ago

I'll try to get back to alup/rbenv to be more compatible with the main idea, used jdowning/rbenv as an experiment. I think exec paths not being set was the main issue, but i'll confirm soon.

sbadia commented 9 years ago

thanks! ok ack :)