sous-chefs / sc-mongodb

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

uninitialized constant `IRB::Abort` #162

Open mateusduboli opened 7 years ago

mateusduboli commented 7 years ago

I'm getting this error message from trying run chef on a newly created mongodb instance with a replica set configuration:

Message

aws_instance.graylog-mongodb.0 (chef):     - restart service service[mongod]
aws_instance.graylog-mongodb.0 (chef):   * ruby_block[config_replicaset] action create

aws_instance.graylog-mongodb.0 (chef):
aws_instance.graylog-mongodb.0 (chef):     ================================================================================
aws_instance.graylog-mongodb.0 (chef):     Error executing action `create` on resource 'ruby_block[config_replicaset]'
aws_instance.graylog-mongodb.0 (chef):     ================================================================================

aws_instance.graylog-mongodb.0 (chef):     NameError
aws_instance.graylog-mongodb.0 (chef):     ---------
aws_instance.graylog-mongodb.0 (chef):     uninitialized constant IRB::Abort

aws_instance.graylog-mongodb.0 (chef):     Cookbook Trace:
aws_instance.graylog-mongodb.0 (chef):     ---------------
aws_instance.graylog-mongodb.0 (chef):     /var/chef/cache/cookbooks/sc-mongodb/libraries/mongodb.rb:97:in `configure_replicaset'
aws_instance.graylog-mongodb.0 (chef):     /var/chef/cache/cookbooks/sc-mongodb/definitions/mongodb.rb:246:in `block (3 levels) in from_file'

aws_instance.graylog-mongodb.0 (chef):     Resource Declaration:
aws_instance.graylog-mongodb.0 (chef):     ---------------------
aws_instance.graylog-mongodb.0 (chef):     # In /var/chef/cache/cookbooks/sc-mongodb/definitions/mongodb.rb
aws_instance.graylog-mongodb.0 (chef):
aws_instance.graylog-mongodb.0 (chef):     244:     ruby_block 'config_replicaset' do
aws_instance.graylog-mongodb.0 (chef):     245:       block do
aws_instance.graylog-mongodb.0 (chef):     246:         MongoDB.configure_replicaset(node, replicaset_name, rs_nodes) unless new_resource.replicaset.nil?
aws_instance.graylog-mongodb.0 (chef):     247:       end
aws_instance.graylog-mongodb.0 (chef):     248:       action :nothing
aws_instance.graylog-mongodb.0 (chef):     249:     end
aws_instance.graylog-mongodb.0 (chef):     250:
aws_instance.graylog-mongodb.0 (chef):
aws_instance.graylog-mongodb.0 (chef):     Compiled Resource:
aws_instance.graylog-mongodb.0 (chef):     ------------------
aws_instance.graylog-mongodb.0 (chef):     # Declared in /var/chef/cache/cookbooks/sc-mongodb/definitions/mongodb.rb:244:in `block in from_file'
aws_instance.graylog-mongodb.0 (chef):
aws_instance.graylog-mongodb.0 (chef):     ruby_block("config_replicaset") do
aws_instance.graylog-mongodb.0 (chef):       params {:mongodb_type=>"mongod", :action=>[:enable, :start], :logpath=>"/var/log/mongodb/mongod.log", :configservers=>[], :replicaset=>true, :notifies=>[], :not_if=>[], :name=>"mongod"}
aws_instance.graylog-mongodb.0 (chef):       action [:nothing]
aws_instance.graylog-mongodb.0 (chef):       default_guard_interpreter :default
aws_instance.graylog-mongodb.0 (chef):       block_name "config_replicaset"
aws_instance.graylog-mongodb.0 (chef):       declared_type :ruby_block
aws_instance.graylog-mongodb.0 (chef):       cookbook_name "sc-mongodb"
aws_instance.graylog-mongodb.0 (chef):       recipe_name "replicaset"
aws_instance.graylog-mongodb.0 (chef):       block #<Proc:0x0000000489a400@/var/chef/cache/cookbooks/sc-mongodb/definitions/mongodb.rb:245>
aws_instance.graylog-mongodb.0 (chef):     end
aws_instance.graylog-mongodb.0 (chef):
aws_instance.graylog-mongodb.0 (chef):     System Info:
aws_instance.graylog-mongodb.0 (chef):     ------------
aws_instance.graylog-mongodb.0 (chef):     chef_version=13.1.31
aws_instance.graylog-mongodb.0 (chef):     platform=centos
aws_instance.graylog-mongodb.0 (chef):     platform_version=7.3.1611
aws_instance.graylog-mongodb.0 (chef):     ruby=ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-linux]
aws_instance.graylog-mongodb.0 (chef):     program_name=chef-client worker: ppid=8166;start=18:41:34;
aws_instance.graylog-mongodb.0 (chef):     executable=/opt/chef/bin/chef-client

I'm running chef using terraform and the only recipe in the run-list is sc-mongodb::replicaset.

Any reason why is this happening?

dyf182 commented 7 years ago

+1

tayeke commented 7 years ago

+1

mateusduboli commented 7 years ago

This happens when you run the cookbook first with sc-mongodb::install and then use sc-mongodb::replicaset.

It can be fixed if you install mongo using sc-mongodb::replicaset with node['mongodb']['auto_configure']['replicaset'] = false to not run the replicaset script.

I didn't looked much into it, but seems to be a valid workaround.

github-actions[bot] commented 4 years ago

Marking stale due to inactivity. Remove stale label or comment or this will be closed in 7 days. Alternatively drop by the #sous-chefs channel on the Chef Community Slack and we'll be happy to help! Thanks, Sous-Chefs.