-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Fleet] Packages with a large number of saved objects in them cause Kibana to crash #147695
Comments
Pinging @elastic/fleet (Team:Fleet) |
Hey @joshdover, our team is experimenting with Fleet packages that could contain a significant number of saved objects of the
While working on those PoCs, we've encountered some limitations on the Fleet's side, presumably related to how package assets are tracked and then deleted. I.e., all installed package assets are listed in the kibana/x-pack/plugins/fleet/server/saved_objects/index.ts Lines 261 to 267 in ab8dd04
cc @banderror |
Yes we definitely should switch over now that this is available. We'd be open to accept a PR for that if your team has the time. |
Pinging @elastic/security-solution (Team: SecuritySolution) |
Pinging @elastic/security-detections-response (Team:Detections and Resp) |
…ects (#148141) **Resolves: #147695, #148174 **Related to: #145851, #137420 ## Summary This PR improves the stability of the Fleet packages installation process with many saved objects. 1. Changed mappings of the `installed_kibana` and `package_assets` fields from `nested` to `object` with `enabled: false`. Values of those fields were retrieved from `_source`, and no queries or aggregations were performed against them. So the mappings were unused, while during the installation of packages containing more than 10,000 saved objects, an error was thrown due to the nested field limitations: ``` Error installing security_detection_engine 8.4.1: The number of nested documents has exceeded the allowed limit of [10000]. This limit can be set by changing the [index.mapping.nested_objects.limit] index level setting. ``` 2. Improved the deletion of previous package assets by switching from sending multiple `savedObjectsClient.delete` requests in parallel to a single `savedObjectsClient.bulkDelete` request. Multiple parallel requests were causing the Elasticsearch cluster to stop responding for some time; see [this ticket](#147695) for more info. **Before** ![Screenshot 2022-12-28 at 11 09 35](https://user-images.githubusercontent.com/1938181/209816219-ade6dd0a-0d56-4acc-929e-b88571f0fe81.png) **After** ![Screenshot 2022-12-28 at 13 56 44](https://user-images.githubusercontent.com/1938181/209816209-16c69922-4ae2-4589-9aa4-5a28050037f4.png)
We have recently encountered an issue where Kibana crashes when installing a Fleet package that contains a large number of saved objects. The crash occurs during the installation process and seems to be caused by the deletion of the previous package version.
Steps to reproduce:
POST /api/fleet/epm/packages/<package>/<version>
.You could follow the steps from this ticket to generate a package with a large number of saved objects and install it.
Expected result:
The Fleet package should be installed successfully without crashing Kibana.
Actual result:
Kibana crashes during the installation process. Elasticsearch logs show dozens of warnings similar to this:
During that time, all requests to Kibana fail with
Notes:
This issue does not occur with smaller packages containing fewer saved objects.
The issue can be temporarily resolved by manually deleting the saved objects from the previous package version before installing the new one, but this is not a permanent solution.
APM logs show hundreds of DELETE requests sent in parallel, they seem to overflow Elasticsearch, making it unresponsive:
The text was updated successfully, but these errors were encountered: