elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.71k stars 8.13k forks source link

Integration package assest are not removed after uninstall #149200

Open endorama opened 1 year ago

endorama commented 1 year ago

Kibana version: 8.6.0

Elasticsearch version: 8.6.0

Server OS version:

Browser version:

Browser OS version: Firefox

Original install method (e.g. download page, yum, from source, etc.): Integrations tab

Describe the bug: After uninstalling an integrations package assets are not removed.

Steps to reproduce:

  1. Create Google Cloud Platform policy integration (tested with version 2.16.0).
  2. Remove all integration policies: a. Open Google Cloud Platform integration page b. Navigate to the Integration policies tab c. delete the integration from all agents
  3. Uninstall the integration: a. Open Google Cloud Platform integration page b. Navigate to the Settings tab c. Press on Uninstall Google Cloud Platform
  4. Go to the Saved objects page, GCP dashboards are still present.

Expected behavior: Assets are removed.

Screenshots (if relevant): Screenshot from 2023-01-19 12-02-08

Errors in browser console (if relevant): none

Provide logs and/or server output (if relevant): I found this error in the Kibana logs:

[2023-01-19T11:00:21.668+00:00][ERROR][plugins.fleet] FleetError: error deleting pipeline metrics-gcp.compute-2.17.0: ResponseError: illegal_argument_exception: [illegal_argument_exception] Reason: pipeline [metrics-gcp.compute-2.17.0] cannot be deleted because it is the default pipeline for 1 index(es) including [.ds-metrics-gcp.compute-default-2023.01.19-000001]
    at deletePipeline (/usr/share/kibana/x-pack/plugins/fleet/server/services/epm/elasticsearch/ingest_pipeline/remove.js:56:15)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async Promise.all (index 2)
    at deleteAssets (/usr/share/kibana/x-pack/plugins/fleet/server/services/epm/packages/remove.js:169:5)
    at removeInstallation (/usr/share/kibana/x-pack/plugins/fleet/server/services/epm/packages/remove.js:65:3)
    at deletePackageHandler (/usr/share/kibana/x-pack/plugins/fleet/server/routes/epm/handlers.js:398:17)
    at Router.handle (/usr/share/kibana/node_modules/@kbn/core-http-router-server-internal/target_node/src/router.js:141:30)
    at handler (/usr/share/kibana/node_modules/@kbn/core-http-router-server-internal/target_node/src/router.js:107:50)
    at exports.Manager.execute (/usr/share/kibana/node_modules/@hapi/hapi/lib/toolkit.js:60:28)
    at Object.internals.handler (/usr/share/kibana/node_modules/@hapi/hapi/lib/handler.js:46:20)
    at exports.execute (/usr/share/kibana/node_modules/@hapi/hapi/lib/handler.js:31:20)
    at Request._lifecycle (/usr/share/kibana/node_modules/@hapi/hapi/lib/request.js:371:32)
    at Request._execute (/usr/share/kibana/node_modules/@hapi/hapi/lib/request.js:281:9)

Any additional context: This feels similar to https://github.com/elastic/kibana/issues/137023, but I'm not sure is a duplicate as I can't check if it's the same error.

simonliska commented 1 year ago

Any update ?