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

Search head clustering ImmutableAttributeModification error #134

Closed
haidangwa opened this issue Jan 14, 2020 · 0 comments · Fixed by #135
Closed

Search head clustering ImmutableAttributeModification error #134

haidangwa opened this issue Jan 14, 2020 · 0 comments · Fixed by #135
Assignees

Comments

@haidangwa
Copy link
Contributor

Cookbook version

4.0.3

Chef-client version

15.6.10

Platform Details

Redhat 8

Steps to Reproduce:

Run the setup_shclustering recipe on a cluster member.

Expected Result:

search head clustering is able to perform chef search query and assign the list of search head cluster members to the variable, shcluster_servers_list.

Actual Result:

  ================================================================================
  Recipe Compile Error in /var/chef/cache/cookbooks/etech_splunk_installer/recipes/default.rb
  ================================================================================

  Chef::Exceptions::ImmutableAttributeModification
  ------------------------------------------------
  Node attributes are read-only when you do not specify which precedence level to set. To set an attribute use code like `node.default["key"] = "value"'

  Cookbook Trace:
  ---------------
    /var/chef/cache/cookbooks/chef-splunk/recipes/setup_shclustering.rb:104:in `block in from_file'
    /var/chef/cache/cookbooks/chef-splunk/recipes/setup_shclustering.rb:103:in `each'
    /var/chef/cache/cookbooks/chef-splunk/recipes/setup_shclustering.rb:103:in `from_file'
    /var/chef/cache/cookbooks/chef-splunk/recipes/server.rb:64:in `from_file'
    /var/chef/cache/cookbooks/chef-splunk/recipes/default.rb:27:in `from_file'
    /var/chef/cache/cookbooks/etech_splunk_installer/recipes/default.rb:23:in `from_file'

  Relevant File Content:
  ----------------------
  /var/chef/cache/cookbooks/chef-splunk/recipes/setup_shclustering.rb:

   97:    search(
   98:      :node,
   99:      "\
  100:      splunk_shclustering_enabled:true AND \
  101:      splunk_shclustering_label:#{node['splunk']['shclustering']['label']} AND \
  102:      chef_environment:#{node.chef_environment}"
  103:    ).each do |result|
  104>>     shcluster_servers_list << result['splunk']['shclustering']['mgmt_uri']
  105:    end
  106:  end
  107:
  108:  execute 'bootstrap-shcluster' do
  109:    command "#{splunk_cmd} bootstrap shcluster-captain -servers_list '#{shcluster_servers_list.join(';')}' -auth '#{splunk_auth_info}'"
  110:    sensitive true
  111:    not_if { ::File.exist?("#{splunk_dir}/etc/.setup_shcluster") }
  112:    only_if { node['splunk']['shclustering']['mode'] == 'captain' }
  113:    notifies :restart, 'service[splunk]'

  System Info:
  ------------
  chef_version=15.6.10
  platform=redhat
  platform_version=8.1
  ruby=ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-linux]
  program_name=chef-client worker: ppid=9768;start=20:44:47;
  executable=/opt/chef/embedded/bin/chef-client


  Running handlers:
[2020-01-14T20:45:09+00:00] ERROR: Running exception handlers
    - Chef::Handler::Datadog
  Running handlers complete
[2020-01-14T20:45:09+00:00] ERROR: Exception handlers complete
  Chef Infra Client failed. 0 resources updated in 21 seconds
[2020-01-14T20:45:09+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[2020-01-14T20:45:09+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2020-01-14T20:45:09+00:00] ERROR: Node attributes are read-only when you do not specify which precedence level to set. To set an attribute use code like `node.default["key"] = "value"'
[2020-01-14T20:45:09+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef Infra Client run process exited unsuccessfully (exit code 1)
@haidangwa haidangwa self-assigned this Jan 14, 2020
haidangwa added a commit that referenced this issue Jan 14, 2020
Signed-off-by: Dang H. Nguyen <dang.nguyen@disney.com>
haidangwa added a commit that referenced this issue Jan 15, 2020
Signed-off-by: Dang H. Nguyen <dang.nguyen@disney.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant