Skip to content
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

[EPM] Kubernetes integration fails to install #164690

Closed
joshdover opened this issue Aug 24, 2023 · 8 comments · Fixed by #164712
Closed

[EPM] Kubernetes integration fails to install #164690

joshdover opened this issue Aug 24, 2023 · 8 comments · Fixed by #164712
Assignees
Labels
bug Fixes for quality problems that affect the customer experience impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. Team:Fleet Team label for Observability Data Collection Fleet team

Comments

@joshdover
Copy link
Contributor

Kibana version: Serverless, commit: 766ff8fa614d

Elasticsearch version: Serverless, commit elastic/elasticsearch@a85372bbb270

Kubernetes package version: 1.43.1

When trying to install the Kubernetes integration I get this error:

Error installing kubernetes 1.43.1: Encountered 1 errors creating saved objects: [{"type":"dashboard","id":"kubernetes-f5ab5510-9c94-11e9-94fd-c91206cd5249","error":{"error":"Internal Server Error","message":"Unexpected bulk response [400] strict_dynamic_mapping_exception: [1:78159] mapping set to strict, dynamic introduction of [migrationVersion] within [_doc] is not allowed","statusCode":500,"type":"unknown"}}]

This does not happen on the system integration. I noticed that the migrationVersion field is missing from the .kibana_analytics index mappings.

The dashboard in question: https://github.com/elastic/integrations/blob/c346a9a73890a32293189ec86a84991a9d4f56f4/packages/kubernetes/kibana/dashboard/kubernetes-f5ab5510-9c94-11e9-94fd-c91206cd5249.json#L3502

cc @elastic/kibana-core for any insights here

@joshdover joshdover added bug Fixes for quality problems that affect the customer experience impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. Team:Fleet Team label for Observability Data Collection Fleet team labels Aug 24, 2023
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

@joshdover
Copy link
Contributor Author

cc @elastic/obs-cloudnative-monitoring

@juliaElastic
Copy link
Contributor

juliaElastic commented Aug 24, 2023

I wonder if this is related to the changes we made here to add migrationVersion from the package, it has been merged for a while in 8.10.
The kibana SavedObject type has migrationVersion here, I'm not sure why it's missing from the es mapping.

In Fleet we could change this as the field is deprecated @deprecated Use `typeMigrationVersion` instead.

@juliaElastic
Copy link
Contributor

It looks like migrationVersion was removed in 8.8 #154246

@gizas
Copy link
Contributor

gizas commented Aug 24, 2023

I can see for Kubernetes Integration:

version: 1.43.1
description: Collect logs and metrics from Kubernetes clusters with Elastic Agent.
[...]
conditions:
  kibana.version: "^8.8.0"

What is the ES version where you deploy @joshdover ?

@juliaElastic
Copy link
Contributor

That happens in latest main and 8.10, 8.9 branch since we added logic to copy over migrationVersion from the package to SO. It looks like the mapping was removed in 8.8.
I think instead we have to transform it to typeMigrationVersion like here

@rudolf
Copy link
Contributor

rudolf commented Aug 24, 2023

Yeah I think the problem occurs because the dashboard has coreMigrationVersion: 8.8.0

https://github.com/elastic/integrations/blob/c346a9a73890a32293189ec86a84991a9d4f56f4/packages/kubernetes/kibana/dashboard/kubernetes-f5ab5510-9c94-11e9-94fd-c91206cd5249.json#L3500

This means we don't run the transform that removes migrationVersion and replaces it with typeMigrationVersion https://github.com/elastic/kibana/blob/main/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/document_migrator/migrations/transform_migration_version.ts#L11

It might be that this dashboard was exported in 8.8.0 but before we merged #150075

Replacing migrationVersion with typeMigrationVersion should fix it.

Do we provide any guidelines for package creators around which versions they should use? It would be safer if they always used a released version of Kibana. But I guess we might sometimes want to update a package using an unreleased Kibana so that we can release both the new feature and updated package in the same stack release.

@juliaElastic
Copy link
Contributor

Do we provide any guidelines for package creators around which versions they should use?

@jsoriano Do you know if we have any guidelines about this?
I wonder if migrationVersion should be deprecated in package-spec as well, to encourage integration devs to use the new fields instead.

juliaElastic added a commit that referenced this issue Aug 24, 2023
## Summary

Fix #164690

`migrationVersion` was removed from es mapping in 8.8:
#154246
Replacing it with `typeMigrationVersion` using the same logic as in
kibana core:

https://github.com/elastic/kibana/blob/ba843882a7bb35aa3062efd6562ed85d5db157f4/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/document_migrator/migrations/transform_migration_version.ts#L17


To verify:
- add Kubernetes integration to a new policy
- verify that it is added successfully

### Checklist

- [x] [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
kibanamachine pushed a commit to kibanamachine/kibana that referenced this issue Aug 24, 2023
…#164712)

## Summary

Fix elastic#164690

`migrationVersion` was removed from es mapping in 8.8:
elastic#154246
Replacing it with `typeMigrationVersion` using the same logic as in
kibana core:

https://github.com/elastic/kibana/blob/ba843882a7bb35aa3062efd6562ed85d5db157f4/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/document_migrator/migrations/transform_migration_version.ts#L17

To verify:
- add Kubernetes integration to a new policy
- verify that it is added successfully

### Checklist

- [x] [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

(cherry picked from commit 0146dc8)
kibanamachine pushed a commit to kibanamachine/kibana that referenced this issue Aug 24, 2023
…#164712)

## Summary

Fix elastic#164690

`migrationVersion` was removed from es mapping in 8.8:
elastic#154246
Replacing it with `typeMigrationVersion` using the same logic as in
kibana core:

https://github.com/elastic/kibana/blob/ba843882a7bb35aa3062efd6562ed85d5db157f4/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/document_migrator/migrations/transform_migration_version.ts#L17

To verify:
- add Kubernetes integration to a new policy
- verify that it is added successfully

### Checklist

- [x] [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

(cherry picked from commit 0146dc8)
kibanamachine referenced this issue Aug 24, 2023
…164712) (#164727)

# Backport

This will backport the following commits from `main` to `8.10`:
- [[Fleet] set typeMigrationVersion instead of migrationVersion
(#164712)](#164712)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Julia
Bardi","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-08-24T14:37:58Z","message":"[Fleet]
set typeMigrationVersion instead of migrationVersion (#164712)\n\n##
Summary\r\n\r\nFix
https://github.com/elastic/kibana/issues/164690\r\n\r\n`migrationVersion`
was removed from es mapping in
8.8:\r\nhttps://github.com//issues/154246\r\nReplacing it
with `typeMigrationVersion` using the same logic as in\r\nkibana
core:\r\n\r\nhttps://github.com/elastic/kibana/blob/ba843882a7bb35aa3062efd6562ed85d5db157f4/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/document_migrator/migrations/transform_migration_version.ts#L17\r\n\r\n\r\nTo
verify:\r\n- add Kubernetes integration to a new policy\r\n- verify that
it is added successfully\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"0146dc87e8db9ed085295ad63d5863f2964d4eb6","branchLabelMapping":{"^v8.11.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Fleet","v8.10.0","v8.11.0","v8.9.2"],"number":164712,"url":"https://github.com/elastic/kibana/pull/164712","mergeCommit":{"message":"[Fleet]
set typeMigrationVersion instead of migrationVersion (#164712)\n\n##
Summary\r\n\r\nFix
https://github.com/elastic/kibana/issues/164690\r\n\r\n`migrationVersion`
was removed from es mapping in
8.8:\r\nhttps://github.com//issues/154246\r\nReplacing it
with `typeMigrationVersion` using the same logic as in\r\nkibana
core:\r\n\r\nhttps://github.com/elastic/kibana/blob/ba843882a7bb35aa3062efd6562ed85d5db157f4/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/document_migrator/migrations/transform_migration_version.ts#L17\r\n\r\n\r\nTo
verify:\r\n- add Kubernetes integration to a new policy\r\n- verify that
it is added successfully\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"0146dc87e8db9ed085295ad63d5863f2964d4eb6"}},"sourceBranch":"main","suggestedTargetBranches":["8.10","8.9"],"targetPullRequestStates":[{"branch":"8.10","label":"v8.10.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.11.0","labelRegex":"^v8.11.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/164712","number":164712,"mergeCommit":{"message":"[Fleet]
set typeMigrationVersion instead of migrationVersion (#164712)\n\n##
Summary\r\n\r\nFix
https://github.com/elastic/kibana/issues/164690\r\n\r\n`migrationVersion`
was removed from es mapping in
8.8:\r\nhttps://github.com//issues/154246\r\nReplacing it
with `typeMigrationVersion` using the same logic as in\r\nkibana
core:\r\n\r\nhttps://github.com/elastic/kibana/blob/ba843882a7bb35aa3062efd6562ed85d5db157f4/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/document_migrator/migrations/transform_migration_version.ts#L17\r\n\r\n\r\nTo
verify:\r\n- add Kubernetes integration to a new policy\r\n- verify that
it is added successfully\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"0146dc87e8db9ed085295ad63d5863f2964d4eb6"}},{"branch":"8.9","label":"v8.9.2","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Julia Bardi <[email protected]>
kibanamachine referenced this issue Aug 24, 2023
…164712) (#164728)

# Backport

This will backport the following commits from `main` to `8.9`:
- [[Fleet] set typeMigrationVersion instead of migrationVersion
(#164712)](#164712)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Julia
Bardi","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-08-24T14:37:58Z","message":"[Fleet]
set typeMigrationVersion instead of migrationVersion (#164712)\n\n##
Summary\r\n\r\nFix
https://github.com/elastic/kibana/issues/164690\r\n\r\n`migrationVersion`
was removed from es mapping in
8.8:\r\nhttps://github.com//issues/154246\r\nReplacing it
with `typeMigrationVersion` using the same logic as in\r\nkibana
core:\r\n\r\nhttps://github.com/elastic/kibana/blob/ba843882a7bb35aa3062efd6562ed85d5db157f4/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/document_migrator/migrations/transform_migration_version.ts#L17\r\n\r\n\r\nTo
verify:\r\n- add Kubernetes integration to a new policy\r\n- verify that
it is added successfully\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"0146dc87e8db9ed085295ad63d5863f2964d4eb6","branchLabelMapping":{"^v8.11.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Fleet","v8.10.0","v8.11.0","v8.9.2"],"number":164712,"url":"https://github.com/elastic/kibana/pull/164712","mergeCommit":{"message":"[Fleet]
set typeMigrationVersion instead of migrationVersion (#164712)\n\n##
Summary\r\n\r\nFix
https://github.com/elastic/kibana/issues/164690\r\n\r\n`migrationVersion`
was removed from es mapping in
8.8:\r\nhttps://github.com//issues/154246\r\nReplacing it
with `typeMigrationVersion` using the same logic as in\r\nkibana
core:\r\n\r\nhttps://github.com/elastic/kibana/blob/ba843882a7bb35aa3062efd6562ed85d5db157f4/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/document_migrator/migrations/transform_migration_version.ts#L17\r\n\r\n\r\nTo
verify:\r\n- add Kubernetes integration to a new policy\r\n- verify that
it is added successfully\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"0146dc87e8db9ed085295ad63d5863f2964d4eb6"}},"sourceBranch":"main","suggestedTargetBranches":["8.10","8.9"],"targetPullRequestStates":[{"branch":"8.10","label":"v8.10.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.11.0","labelRegex":"^v8.11.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/164712","number":164712,"mergeCommit":{"message":"[Fleet]
set typeMigrationVersion instead of migrationVersion (#164712)\n\n##
Summary\r\n\r\nFix
https://github.com/elastic/kibana/issues/164690\r\n\r\n`migrationVersion`
was removed from es mapping in
8.8:\r\nhttps://github.com//issues/154246\r\nReplacing it
with `typeMigrationVersion` using the same logic as in\r\nkibana
core:\r\n\r\nhttps://github.com/elastic/kibana/blob/ba843882a7bb35aa3062efd6562ed85d5db157f4/packages/core/saved-objects/core-saved-objects-migration-server-internal/src/document_migrator/migrations/transform_migration_version.ts#L17\r\n\r\n\r\nTo
verify:\r\n- add Kubernetes integration to a new policy\r\n- verify that
it is added successfully\r\n\r\n### Checklist\r\n\r\n- [x] [Unit or
functional\r\ntests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)\r\nwere
updated or added to match the most common
scenarios","sha":"0146dc87e8db9ed085295ad63d5863f2964d4eb6"}},{"branch":"8.9","label":"v8.9.2","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Julia Bardi <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience impact:high Addressing this issue will have a high level of impact on the quality/strength of our product. Team:Fleet Team label for Observability Data Collection Fleet team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants