cloudfoundry-community / logsearch-for-cloudfoundry

A Logsearch addon that customises Logsearch to work with Cloud Foundry data
Apache License 2.0
49 stars 58 forks source link

Unable to install kibana plugins #357

Open mymasse opened 3 years ago

mymasse commented 3 years ago

Using logsearch-boshrelease and logsearch-for-cloudfoundry version 211.1.0

We have created a bosh release with ES and Kibana plugins and are trying to deploy these. This seemed to have worked for the ES plugins but not for the Kibana plugins.

Our bosh release makes the plugins available in /var/vcap/packages/es-7.6.1-plugins and we wrote an ops file to add the Kibana plugins in the cf-kibana jobs with this

- type: replace
  path: /instance_groups/name=maintenance/jobs/name=cf-kibana/properties/cf-kibana/plugings?
  value:
    - alerting_kibana: file:///var/vcap/packages/es-7.6.1-plugins/alerting-kibana.zip

When running bosh -d logsearch run-errand cf-kibana we get

In the Stdout:

Attempting to transfer from file:///var/vcap/packages/es-7.6.1-plugins/alerting-kibana.zip
Transferring 8122569 bytes...............
Transfer complete
Retrieving metadata from plugin archive
Extracting plugin archive
Extraction complete

In the Stderr:

+ /var/vcap/data/tmp/kibana/bin/kibana-plugin install file:///var/vcap/packages/es-7.6.1-plugins/alerting-kibana.zip --allow-root
Plugin installation was unsuccessful due to error "Cannot delete files/directories outside the current working directory. Can be overridden with the 'force' option."

Note that also if our ops files contains only /var/vcap/packages/es-7.6.1-plugins/alerting-kibana.zip instead of file:///var/vcap/packages/es-7.6.1-plugins/alerting-kibana.zip this fails with: Kibana should not be run as root. Use --allow-root to continue. Which is why we prefixed our path with file:// so that it would hit the line to install the plugins with --allow-root

mymasse commented 3 years ago

Found this on a couple of issues in github:

It seems that after the last update of Kibana 7.6.0, the installation of the plugins must be done from the Kibana home directory.

mymasse commented 3 years ago

Found a fix for this, PR to follow