Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cookbook fails when 'bootstrap true' added to config #133

Open
simoninkin opened this issue Mar 8, 2017 · 2 comments
Open

Cookbook fails when 'bootstrap true' added to config #133

simoninkin opened this issue Mar 8, 2017 · 2 comments
Labels
Triage: Needs Information Indicates an issue needs more information in order to work on it. Triage: Support Indicates an issue that is a support question and will be redirected to other mediums.

Comments

@simoninkin
Copy link

Cookbook version

5.0.1

Platform Details

DigitalOcean

Steps to Reproduce:

Put the 'bootstrap true' in default['chef-server']['configuration'] and run the cookbook

For example:

default['chef-server']['configuration'] = <<-EOS bootstrap true ip_version "ipv4" notification_email "[email protected]" nginx['cache_max_size'] = "3500m" EOS

Actual Result:

The cookbook fails to start with an error:

`

   ================================================================================
   Recipe Compile Error in /var/opt/opscode/local-mode-cache/cookbooks/private-chef/recipes/default.rb
   ================================================================================
   
   NoMethodError
   -------------
   undefined method `[]' for true:TrueClass
   
   Cookbook Trace:
   ---------------
     /var/opt/opscode/local-mode-cache/cookbooks/private-chef/recipes/oc_id.rb:156:in `from_file'
     /var/opt/opscode/local-mode-cache/cookbooks/private-chef/recipes/default.rb:148:in `block in from_file'
     /var/opt/opscode/local-mode-cache/cookbooks/private-chef/recipes/default.rb:131:in `each'
     /var/opt/opscode/local-mode-cache/cookbooks/private-chef/recipes/default.rb:131:in `from_file'
   
   Relevant File Content:
   ----------------------
   /var/opt/opscode/local-mode-cache/cookbooks/private-chef/recipes/oc_id.rb:
   
   149:    only_if { is_data_master? }
   150:  end
   151:
   152:  component_runit_service "oc_id" do
   153:    package 'private_chef'
   154:  end
   155:
   156>> if node['private_chef']['bootstrap']['enable']
   157:    execute "/opt/opscode/bin/private-chef-ctl start oc_id" do
   158:      retries 20
   159:    end
   160:  end
   161:
   162:  # Take the existing oc_id.applications (with only a redirect_uri), ensure they
   163:  # exist in the database, and dump their data to /etc/opscode/oc-id-applications.
   164:  node['private_chef']['oc_id']['applications'].each do |name, app|
   165:    oc_id_application name do
   
   Platform:
   ---------
   x86_64-linux
   
   [2017-03-08T15:51:45+00:00] ERROR: Running exception handlers
   [2017-03-08T15:51:45+00:00] ERROR: Exception handlers complete
   [2017-03-08T15:51:45+00:00] FATAL: Stacktrace dumped to /var/opt/opscode/local-mode-cache/chef-stacktrace.out
   [2017-03-08T15:51:45+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
   [2017-03-08T15:51:45+00:00] FATAL: NoMethodError: undefined method `[]' for true:TrueClass
   STDERR: 
   ---- End output of chef-server-ctl reconfigure ----
   Ran chef-server-ctl reconfigure returned 1
   [2017-03-08T15:51:45+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)`

I've been trying to get this working and it only works without this option set in the config.

@cheeseplus
Copy link

There is a note on the readme regarding the attribute, 'This must include newlines for each of the configuration items.' so adding some \n or inserting the line breaks should resolve this.

@simoninkin
Copy link
Author

simoninkin commented Mar 20, 2017

Hi, sorry, couldn't get back to this earlier.
The new line chars are meant for the .json config definition, I am using the <<-EOS method
Perhaps it would've helped, if I included the config:

default['chef-server'][:configuration] = <<-EOS
bootstrap true
ip_version "ipv4"
notification_email "[email protected]"
nginx['cache_max_size'] = "3500m"
EOS

Just to be sure, I've tested the following as well and got the same result:
default['chef-server'][:configuration] = "bootstrap true\nip_version \"ipv4\"\nnotification_email \"[email protected]\"\nnginx['cache_max_size'] = \"3500m\"\n"

If I exclude the 'bootsrap true' flag from the conf, the cookbook works.

@tas50 tas50 added Triage: Needs Information Indicates an issue needs more information in order to work on it. and removed Status: Pending Contributor Response labels Jan 4, 2019
@tas50 tas50 added Triage: Support Indicates an issue that is a support question and will be redirected to other mediums. and removed Type: Question labels Jan 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Triage: Needs Information Indicates an issue needs more information in order to work on it. Triage: Support Indicates an issue that is a support question and will be redirected to other mediums.
Projects
None yet
Development

No branches or pull requests

3 participants