rackspace-cookbooks/elkstack

Logstash fails to run properly

dexxtreme opened this issue · 5 comments

Logstash fails to run properly after a new install (currently using ELKStack ver. 4.0.0). The following error is being generated:

Unable to load "text!config" modules because of an unknown error.

According to discussions found on elastic/kibana#1653 , the following needs to be added to the "location" block in nginx to resolve issues with CORS on Elasticsearch:

proxy_set_header Host $http_host;

After fixing that issue, the following error is now being generated:

ReferenceError: ZeroClipboard is not defined

Not too clear on what is needed to fix this one, though.

Actually... I'm not fully sure which part(s) aren't working properly... I think it is actually more about the link from Kibana to Elasticsearch.

So, I've debugged this a bit more (using Ubuntu 14.04). After finding various links on Google, I have added the following to kibana.yml:

bundledPluginIds:
 - plugins/dashboard/index
 - plugins/discover/index
 - plugins/doc/index
 - plugins/kibana/index
 - plugins/metric_vis/index
 - plugins/settings/index
 - plugins/table_vis/index
 - plugins/vis_types/index
 - plugins/visualize/index

Using the non-camel-case variant (bundled_plugin_ids) still results in the "ZeroClipboard" error.

I added custom templates to my cookbook to fix the nginx and kibana configs. Unfortunately, it is still redirecting to the following URL after passing authentication:

/#/undefined

Also, the Kibana service is being restarted on every Chef run due to kibana.yml being written and re-written every time.

So, it appears that there is currently a mix of CamelCase and under_score variable names. The following changes appear to work:

default_app_id instead of defaultAppId
kibana_index instead of kibanaIndex

I'm guessing it will be fixed in the next beta or full release:
elastic/kibana#2373

I was also running into this issue today. I recreated the template at the end of my wrapper cookbook with the following:

templates/default/elkstack/kibana.yml.erb

port: <%= @port %>
elasticsearch: "<%= @elasticsearch %>"
host: "0.0.0.0"
request_timeout: 60
shard_timeout: 30000
verify_ssl: true
kibana_index: "<%= @index %>"
default_app_id: "discover"
apps:
- { id: "discover", name: "Discover" }
- { id: "visualize", name: "Visualize" }
- { id: "dashboard", name: "Dashboard" }
- { id: "settings", name: "Settings" }
bundledPluginIds:
 - plugins/dashboard/index
 - plugins/discover/index
 - plugins/settings/index
 - plugins/table_vis/index
 - plugins/vis_types/index
 - plugins/visualize/index

and the addition to my wrapper cookbook

template "#{node['kibana']['install_path']}/kibana/current/#{node['kibana']['file']['config']}" do
  source 'elkstack/kibana.yml.erb'
  cookbook 'mycookbook'
  mode '0644'
  user node['kibana']['user']
  group node['kibana']['user']
  variables(
    index: node['kibana']['config']['kibana_index'],
    port: node['kibana']['java_webserver_port'],
    elasticsearch: "#{node['kibana']['es_scheme']}#{node['kibana']['es_server']}:#{node['kibana']['es_port']}",
    default_route: node['kibana']['config']['default_route'],
    panel_names: node['kibana']['config']['panel_names']
  )
end

I concur with @dexxtreme; it looks like a bug in kibana, and the next release will fix it.