-
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: Custom integration creation / integration update fails on changing subobjects
property on mapping
#183496
Comments
Pinging @elastic/fleet (Team:Fleet) |
Hey @flash1293 thanks for the issue. The custom integrations code paths within Fleet were actually contributed by o11y (namely @Kerry350), so I'm a little wary of making changes here. To me, the Ref initial custom integrations scope: #159991 |
Actually I added the |
Is just the update of the existing mapping failing or also if you set it on a template and then trigger the rollover? |
Only the existing mapping update for the current write index here: kibana/x-pack/plugins/fleet/server/services/epm/elasticsearch/template/template.ts Line 1045 in ae997d9
I tested the rollover case and it works as expected. So that would indeed be another option - to not attempt to update subobjects for the current write index, but instead just roll over. |
This is a common behaviour when upgrading Integration packages AFAIK. At first it tries to update the mapping and if we get an error, the template is updated and then a rollover is triggered as there are also other changes which require a rollover, like change to TSDS. The reason rollover is not always triggered is because this could lead to too many indices quickly. |
subobjects
property on mapping
Updated the title to reflect that the scope is broader. |
Yes I think we should handle this via rollover as we do for standard integrations. |
Pulling this into the team's next sprint as a P1 bug. It should be relatively straightforward, and we should get some non-o11y folks into the custom integrations code regardless since we are codeowners on it 🙂 |
@kpollich It's been a while this bug is open, is there anything to clear up about how to fix it? It's blocking some integration work. |
I don't think there are any blockers here, it's just been tough to fit in with other priorities. Will try to make sure this is done as part of the current sprint. I'll bump the priority here. For context - the Fleet team only oversaw the "custom integrations" work that was contributed to our API. We haven't actively maintained or contributed to these APIs to date, so this will be new ground for the team. |
@flash1293 I tried to reproduce this bug locally following the steps in the description but I didn't get any error. Followed steps:
Is there any other steps that I'm missing? I tried twice but couldn't reproduce both times. |
@criamico In the second screenshot, the "dataset" name should be In the data stream |
Thanks @flash1293, I have a PR with a tentative fix: #186991 Could you please take a look? |
…apper_exception error (#186991) Fixes #183496 Fixes #180062 ## Summary Custom integration creation / integration update currently fails on changing subobjects property on mapping with `mapper_exception` error. This PR handles this case by triggering a rollover when the error is received. ## Testing - In dev tools, enter the following ``` POST logs-testintegration.test-default/_doc { "message": "abc" } ``` - Navigate to `/app/observabilityOnboarding/customLogs/?category=logs` and fill it with the following: ![Screenshot 2024-06-26 at 15 19 19](https://github.com/elastic/kibana/assets/16084106/a8a0016b-79aa-41b9-9b9b-8a4198a43feb) In the screenshot the error is visible but in the current branch the request should succeed and install `testintegration` correctly. ### Checklist - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios --------- Co-authored-by: Kibana Machine <[email protected]>
When creating a custom integration (
kibana/x-pack/plugins/fleet/server/routes/epm/index.ts
Line 267 in e048b86
/api/fleet/epm/custom_integrations
for a datastream that already contains log datastreams created via the rootlogs
template, the creation fails because the integration tries to setsubobjects: false
for all streams:kibana/x-pack/plugins/fleet/server/services/epm/packages/custom_integrations/assets/dataset/utils.ts
Line 30 in 98aff21
As the existing datastreams don't have this set and it's not possible to change this setting after the fact, the creation fails with:
The same happens when trying to upgrade an integration that has a data stream which didn't have
subobjects
defined in the old version but setssubobjects: false
after the upgrade.Steps to reproduce:
/app/observabilityOnboarding/customLogs/?category=logs
and create a new integration like thisLclicking "Continue" fails:
I can think of the following fixes:
subobjects: false
for custom integrations for nowThis is relevant for near-term plans around offering automated mapping issue mitigation flows.
cc @ruflin @achyutjhunjhunwala
The text was updated successfully, but these errors were encountered: