voxpupuli / puppet-kibana

Kibana Puppet module by Elastic.
Apache License 2.0
16 stars 48 forks source link

Unexpected Permissions issues #27

Open pickypg opened 6 years ago

pickypg commented 6 years ago

https://discuss.elastic.co/t/kibana-6-2-3-6-2-4-error-invalid-dimensions-for-plot-width-473-height-0/129140/4?u=pickypg

After the user installed Kibana via the puppet module, they ran into weird permissions issues until they reinstalled it:

FATAL { Error: EACCES: permission denied, open '/usr/share/kibana/optimize/bundles/ml.style.css'
    at Error (native)
  cause: 
   { Error: EACCES: permission denied, open '/usr/share/kibana/optimize/bundles/ml.style.css'
       at Error (native)
     errno: -13,
     code: 'EACCES',
     syscall: 'open',
     path: '/usr/share/kibana/optimize/bundles/ml.style.css' },
  isOperational: true,
  errno: -13,
  code: 'EACCES',
  syscall: 'open',
  path: '/usr/share/kibana/optimize/bundles/ml.style.css' }

I've asked that the user respond here in case there are any questions.

tylerjl commented 6 years ago

Thanks for the report - if I can see an example manifest that reproduces the error, that'd be a good place to start debugging, as the tests do currently test plugin installation which still appears to be working normally 🤔

diranged commented 6 years ago

Our setup is a bit tricky to just copy and paste because it has legacy support in it for Kibana4/5... but here's the relevant bits:

class profiles::kibana (
  Hash   $config  = {},
  String $url     = 'http://localhost:9200',
  Hash   $plugins = {},
  String $version = '4.6.2'
) {
  $default_config = {
    'elasticsearch.requestTimeout' => 500000,
    'elasticsearch.shardTimeout'   => 0,
    'elasticsearch.url'            => $url,
  }
...
  $_config = merge($default_config, $config)
  $ver_array = split($version, '[.]')
  $ver_major = $ver_array[0]
  $ver_minor = $ver_array[1]
  $ver_patch = $ver_array[2]
  if ($ver_major) >= '5' {
    $package_repo_version = "${ver_major}.x"
    $_plugins = {
      'x-pack' => {},
    }
  }
  ...
    class { 'kibana':
      ensure => $version,
      config => $_config,
    }
...
profiles::kibana::config:
  kibana.defaultAppId: discover
  console.enabled: false
  xpack.grokdebugger.enabled: true
  xpack.searchprofiler.enabled: true
  xpack.graph.enabled: false
  xpack.apm.ui.enabled: false
  xpack.reporting.enabled: false
  xpack.security.enabled: false
profiles::kibana::plugins:
  x-pack:
    version: "%{hiera('profiles::elasticsearch::version')}"
    source: x-pack
profiles::elasticsearch::is_master: 'false'
profiles::elasticsearch::is_data: 'false'
profiles::elasticsearch::memory: 35
profiles::kibana::version: "%{hiera('profiles::elasticsearch::version')}"

Basically nothing special here..

tylerjl commented 6 years ago

Just wanted to ping here that I've reproduced the issue, I'm seeing if there's a fix I can implement. It looks like kibana-plugin install is timing out because the command takes so long to run, FYI.