sous-chefs / sc-mongodb

Development repository for the sc-mongodb cookbook
https://supermarket.chef.io/cookbooks/sc-mongodb
Apache License 2.0
75 stars 92 forks source link

User management KO : "Could not locate Gemfile" #93

Closed jmcollin78 closed 7 years ago

jmcollin78 commented 9 years ago

Hi there,

Running the "master" branch of this cookbook with "replicatsets" recipe and user_management leads to the following error:

[2015-10-04T14:27:01+00:00] INFO: Processing package[mongodb-org] action install (mongodb::install line 78)
[2015-10-04T14:27:05+00:00] INFO: package[mongodb-org] installing mongodb-org-2.6.11-1 from mongodb repository
[2015-10-04T14:27:49+00:00] INFO: Processing ruby_block[chef_gem_at_converge_time] action run (mongodb::replicaset line 25)

================================================================================
Error executing action `run` on resource 'ruby_block[chef_gem_at_converge_time]'
================================================================================

Bundler::GemfileNotFound
------------------------
Could not locate Gemfile

Cookbook Trace:
---------------
/var/lib/aws/opsworks/cache.stage2/cookbooks/mongodb/recipes/replicaset.rb:29:in `block (3 levels) in from_file'
/var/lib/aws/opsworks/cache.stage2/cookbooks/mongodb/recipes/replicaset.rb:27:in `each'
/var/lib/aws/opsworks/cache.stage2/cookbooks/mongodb/recipes/replicaset.rb:27:in `block (2 levels) in from_file'

Resource Declaration:
---------------------
# In /var/lib/aws/opsworks/cache.stage2/cookbooks/mongodb/recipes/replicaset.rb

25: ruby_block 'chef_gem_at_converge_time' do
26:   block do
27:     node['mongodb']['ruby_gems'].each do |gem, version|
28:       version = Gem::Dependency.new(gem, version)
29:       Chef::Provider::Package::Rubygems::GemEnvironment.new.install(version)
30:     end
31:   end
32: end
33: 

Compiled Resource:
------------------
# Declared in /var/lib/aws/opsworks/cache.stage2/cookbooks/mongodb/recipes/replicaset.rb:25:in `from_file'

ruby_block("chef_gem_at_converge_time") do
action "run"
retries 0
retry_delay 2
block_name "chef_gem_at_converge_time"
cookbook_name "mongodb"
recipe_name "replicaset"
block #
end<

The users are not created. I don't know if it has something to do with replicatsets. I guess no.

My wrapper wookbook:

include_recipe "mongodb::10gen_repo"
include_recipe "mongodb::replicaset"
include_recipe "mongodb::user_management"

My attributes:

include_attribute 'appconfig::config'

default['mongodb']['config']['dbpath'] = '/data'
default['mongodb']['config']['rest'] =false
default['mongodb']['config']['smallfiles'] =true
default['mongodb']['admin']['password'] = 'theadminpassword'
default['mongodb']['users'] = [
        {
                'username' => 'testu',
                'password' => 'testu',
                'roles' => %w(readWrite),
                'database' => default['appconfig']['mongodb']['database']
        }
]

default['mongodb']['cluster_name'] = 'int-mgo-cluster'
default['mongodb']['config']['replSet'] = 'int-mgo-replset'

I also notice this warning at the end of the log file:

[2015-10-04T14:28:03+00:00] INFO: Processing ruby_block[config_replicaset] action create (mongodb::replicaset line 225)
** Notice: The native BSON extension was not loaded. **

For optimal performance, use of the BSON extension is recommended.

To enable the extension make sure ENV['BSON_EXT_DISABLED'] is not set
and run the following command:

gem install bson_ext

If you continue to receive this message after installing, make sure that
the bson_ext gem is in your load path.
[2015-10-04T14:28:04+00:00] WARN: Cannot configure replicaset 'int-mgo-replset', no member nodes found
[2015-10-04T14:28:04+00:00] INFO: ruby_block[config_replicaset] called

May be I miss something cause i'm a newby in Chef config.

Jm

jmcollin78 commented 9 years ago

No idea ? I'm stuck with this issue and I can't get rid of this error.

Many thank's in advance.

luishdez commented 9 years ago

For sure there is a problem with Mongo Gem but I haven't been able to reproduce it yet…

Take a look to these issues may be you can get some ideas:

https://github.com/chef-brigade/mongodb-cookbook/issues/85 https://github.com/chef-brigade/mongodb-cookbook/issues/41

I have a repo with a vagrant test I've checked with Ubuntu and CentOS but I couldn't reproduce it. https://github.com/luishdez/mongodb-cookbook-playground

jkulak commented 8 years ago

I can reproduce on Ubuntu 14.04.1 LTS (GNU/Linux 4.1.5-x86_64-linode61 x86_64) but it works on Ubuntu 14.04.3 LTS (GNU/Linux 3.13.0-63-generic x86_64)

jmcollin78 commented 8 years ago

I'm working with Amazon Linux. Is there any reason for this Linux to not working like Centos ? Le 22 oct. 2015 6:15 PM, "Jakub Kułak" notifications@github.com a écrit :

I can reproduce on Ubuntu 14.04.1 LTS (GNU/Linux 4.1.5-x86_64-linode61 x86_64) but it works on Ubuntu 14.04.3 LTS (GNU/Linux 3.13.0-63-generic x86_64)

— Reply to this email directly or view it on GitHub https://github.com/chef-brigade/mongodb-cookbook/issues/93#issuecomment-150275968 .

damacus commented 7 years ago

I'm going to close this issue down. This should be fixed during the rewrite. If it isn't covered by the tests please shout.

lock[bot] commented 6 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.