rackspace-cookbooks/elkstack

==> default: undefined method `[]' for nil:NilClass (node['logstash']['instance_default']['basedir'])

syberkitten opened this issue · 4 comments

Wrapping up the cookbook as a library (using it as a recipe from a wrapper cookbook)
I get this error (using berkshelf and Vagrant, and it fails on Vagrant with Centos 6.5)

==> default:
==> default:
==> default: NoMethodError
==> default: -------------
==> default: undefined method []' for nil:NilClass ==> default: ==> default: ==> default: Cookbook Trace: ==> default: --------------- ==> default: /tmp/vagrant-chef-3/chef-solo-1/cookbooks/elkstack/recipes/logstash.rb:22:infrom_file'
==> default: /tmp/vagrant-chef-3/chef-solo-1/cookbooks/elkstack/recipes/single.rb:14:in from_file' ==> default: /tmp/vagrant-chef-3/chef-solo-1/cookbooks/walla_dashboards/recipes/default.rb:12:infrom_file'

And it looks like the error originates from this code (inside logstash.rb)
directory node['logstash']['instance_default']['basedir'] do
owner node['logstash']['instance_default']['user']

I understand this issue is probably due to lack of understanding
Chef internals and the proper way to use the recipe, but it would be very helpful
to be able to make it work.

the issue can be found here and on many other place over the web:
http://stackoverflow.com/questions/26368264/having-an-error-regarding-a-node-basedir-while-installing-a-elkstack-cookbook

Hello! You're using an old version of the logstash cookbook, or you're using some other logstash cookbook. I'd recommend ensuring you have a logstash entry in your Berksfile (as the logstash cookbook being used, while the most popular in the chef community, is not uploaded to Supermarket due someone else having taken the name).

FWIW, this item item 2 under Things You Should Know on project's main documentation.

hi Martin, thanks for the feedback...
I was under the impression that ELKSTACK installs it's own logstash
version..?

how can it be then, that i have a different version being installed?
or do you mean that i have to specify a specific version for logstash
in spite the fact that elk comes with a logstash recipe?

@syberkitten elkstack calls an upstream community cookbook for logstash. It should be considered a 'wrapper cookbook' around logstash, elasticsearch, and kibana cookbooks. It's a work of integration. If you use Berkshelf, you'll need to ensure you have logstash, elasticsearch, and kibana entries in your Berksfile that are the same as the elkstack ones.

I'm not sure there's a question or issue here anymore, so I'm going to close this. If you have specific bugs with elkstack, please open specific issues.

ok, thanks, i'll look it up .. )