basho-labs / riak-chef-cookbook

Chef cookbook for Riak
https://supermarket.chef.io/cookbooks/riak
94 stars 78 forks source link

String not matched error #158

Closed pooranpatel2512 closed 9 years ago

pooranpatel2512 commented 10 years ago

We think the attribute node['riak']['config']['riak_control']['auth']['mode'] is not used. Is this an expected behaviour?

@bixu

================================================================================
Recipe Compile Error in /var/chef/cache/cookbooks/riak-yetu/attributes/default.rb
================================================================================

IndexError
----------
string not matched

Cookbook Trace:
---------------
  /var/chef/cache/cookbooks/riak-yetu/attributes/default.rb:92:in `[]='
  /var/chef/cache/cookbooks/riak-yetu/attributes/default.rb:92:in `from_file'

Relevant File Content:
----------------------
/var/chef/cache/cookbooks/riak-yetu/attributes/default.rb:

 85:  default['riak']['config']['object']['size']['warning_threshold'] = '5MB'
 86:  default['riak']['config']['object']['size']['maximum'] = '50MB'
 87:  default['riak']['config']['object']['siblings']['warning_threshold'] = 25
 88:  default['riak']['config']['object']['siblings']['maximum'] = 100
 89:  default['riak']['config']['bitcask']['data_root'] = '$(platform_data_dir)/bitcask'
 90:  default['riak']['config']['bitcask']['io_mode'] = 'erlang'
 91:  default['riak']['config']['riak_control.top_level'] = 'off'
 92>> default['riak']['config']['riak_control']['auth']['mode'] = 'off'
 93:  # default['riak']['config']['riak_control']['auth']['user']['user']['password'] = 'pass'
 94:  default['riak']['config']['leveldb']['maximum_memory']['percent'] = 70
 95:  # default['riak']['config']['jmx.top_level'] = 'off'
 96:  default['riak']['config']['search.top_level'] = 'off'
 97:  default['riak']['config']['search']['solr']['start_timeout'] = '30s'
 98:  default['riak']['config']['search']['solr']['port'] = 8093
 99:  default['riak']['config']['search']['solr']['jmx_port'] = 8985
100:  default['riak']['config']['search']['solr']['jvm_options'] = '-d64 -Xms1g -Xmx1g -XX:+UseStringCache -XX:+UseCompressedOops'
101:

[2014-11-04T13:32:13+00:00] DEBUG: Re-raising exception: IndexError - string not matched
/var/chef/cache/cookbooks/riak-yetu/attributes/default.rb:92:in `[]='
  /var/chef/cache/cookbooks/riak-yetu/attributes/default.rb:92:in `from_file'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4/lib/chef/mixin/from_file.rb:30:in `instance_eval'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4/lib/chef/mixin/from_file.rb:30:in `from_file'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4/lib/chef/dsl/include_attribute.rb:39:in `block in include_attribute'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4/lib/chef/dsl/include_attribute.rb:31:in `each'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4/lib/chef/dsl/include_attribute.rb:31:in `include_attribute'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4/lib/chef/run_context/cookbook_compiler.rb:181:in `load_attribute_file'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4/lib/chef/run_context/cookbook_compiler.rb:170:in `load_attributes_from_cookbook'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4/lib/chef/run_context/cookbook_compiler.rb:110:in `block in compile_attributes'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4/lib/chef/run_context/cookbook_compiler.rb:109:in `each'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4/lib/chef/run_context/cookbook_compiler.rb:109:in `compile_attributes'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4/lib/chef/run_context/cookbook_compiler.rb:72:in `compile'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4/lib/chef/run_context.rb:89:in `load'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4/lib/chef/policy_builder/expand_node_object.rb:73:in `setup_run_context'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4/lib/chef/client.rb:265:in `setup_run_context'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4/lib/chef/client.rb:429:in `do_run'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4/lib/chef/client.rb:213:in `block in run'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4/lib/chef/client.rb:207:in `fork'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4/lib/chef/client.rb:207:in `run'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4/lib/chef/application.rb:236:in `run_chef_client'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4/lib/chef/application/client.rb:338:in `block in run_application'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4/lib/chef/application/client.rb:327:in `loop'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4/lib/chef/application/client.rb:327:in `run_application'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4/lib/chef/application.rb:55:in `run'
  /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.16.4/bin/chef-client:26:in `<top (required)>'
  /usr/bin/chef-client:23:in `load'
  /usr/bin/chef-client:23:in `<main>'
hectcastro commented 10 years ago

That attribute produces the following line inside of riak.conf via the cuttlefish.rb library:

riak_control.auth.mode = off

Can you share more about what you're trying to do? Are you attempting to create a riak-yetu wrapper cookbook for Riak?

bixu commented 10 years ago

That’s correct. I suppose we could just try leaving this attribute out of our attribute declarations, as we aren’t changing the value.

Still, I’m puzzled by “string not matched” message.

On Nov 6, 2014, at 2:53 AM, Hector Castro notifications@github.com wrote:

That attribute produces the following line inside of riak.conf via the cuttlefish.rb library:

riak_control.auth.mode = off Can you share more about what you're trying to do? Are you attempting to create a riak-yetu wrapper cookbook for Riak?

— Reply to this email directly or view it on GitHub https://github.com/basho/riak-chef-cookbook/issues/158#issuecomment-61915610.

hectcastro commented 10 years ago

Something appears to be wrong with how you are accessing the nested hash. It is difficult for me to troubleshoot without a bit more of the context around your wrapper cookbook, but I would try dumping earlier levels of the hash to see if anything interesting is revealed:

Something like:

p default['riak']['config']['riak_control']
p default['riak']['config']['riak_control']['auth']
p default['riak']['config']['riak_control']['auth']['mode']

I wonder if a different type is somehow getting assigned to one of these, breaking the ability to nest hashes.

cheeseplus commented 9 years ago

This hasn't been moved in a bit - if you are still experiencing issues I'd love to know but I haven't been able to replicate.

bixu commented 9 years ago

I'd say close it for now. If we find that we can predictably reproduce we can re-open.