fix(kibana): discard unknown saved objects on upgrade from 7.x#4741
Merged
rene-dekker merged 1 commit intotigera:masterfrom Apr 23, 2026
Merged
Conversation
Set migrations.discardUnknownObjects to the running Kibana version so CE 3.20 -> 3.21+ upgrades don't crashloop on the orphan ingest_manager_settings document left behind by Fleet 7.17 after v1.38 disabled the Fleet plugin. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
746c2e6 to
edcd5e5
Compare
rene-dekker
approved these changes
Apr 23, 2026
This was referenced Apr 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Set
migrations.discardUnknownObjectson the Kibana CR so CE 3.20 → 3.21+ upgrades no longer crashloop on the orphaningest_manager_settingssaved-object document.Problem
In operator v1.38 (PR #4323), Fleet was disabled via
xpack.fleet.enabled: falseto silence outbound traffic from the Fleet plugin (e.g.ProductDocBase:EnsureUpToDate→kibana-knowledge-base-artifacts.elastic.co). That change had an unintended consequence:.kibana:type: ingest_manager_settings, idfleet-default-settings, containing an empty default-settings body.ingest_manager_settingsSO type is no longer registered.CHECK_UNKNOWN_DOCUMENTS → FATALand Kibana crashloops.Reproduced on lab upgrades: 3.19.4→3.21.6, 3.19.4→3.22.2, 3.20.7→3.22.2, 3.20.7→3.21.6.
Fix
Set
migrations.discardUnknownObjects: <kibana-version>in the Kibana CR'sspec.config. Kibana's migration then discards any docs whose type has no registered owner instead of erroring out. The setting is version-pinned, so it only takes effect for the current migration — no risk of silently eating data during future upgrades.Value is sourced from
components.ComponentEckKibana.Version(same constant used forSpec.Version), guaranteeing they can't drift.Validation
Built and deployed this patch to a lab CE 3.21.6 cluster that was crashlooping with the
ingest_manager_settingsFATAL. After the operator reconciled and wrotemigrations.discardUnknownObjects: "8.19.10", Kibana pods came up 1/1 Running on next restart, withMigration completedlogs for all 6.kibana*indices. No FATAL.Cherry-pick targets
tianfeng92:fix-kibana-discard-unknown-objects-v1.38Test plan
kibana_test.goasserting the setting is renderedgo test ./pkg/render/logstorage/kibana/passes🤖 Generated with Claude Code
Release Note
Caveat discovered during v1.40 validation
The value is sourced from
components.ComponentEckKibana.Version. This constant must match the actual Kibana binary version shipped in thetigera/kibanaimage. Kibana ignoresmigrations.discardUnknownObjectswhen the configured version string doesn't equal its own internal version (logsThe flag ... does not match the current kibana version; unknown objects will NOT be discarded).While validating on a CE 3.20 → 3.22 upgrade, we found that operator
release-v1.40has drifted:ComponentEckKibana.Version = "8.19.12"but the releasedquay.io/tigera/kibana:v3.22.2image still ships an 8.19.10 binary. That drift is pre-existing and independent of this PR, but it blocks the cherry-pick torelease-v1.40from taking effect until one of:ComponentEckKibana.Versionis reverted to"8.19.10"onrelease-v1.40(matches the image), ortigera/kibana3.22 image is rebuilt against upstream Kibanav8.19.12(matches the constant)release-v1.38(ComponentEckKibana.Version ="8.19.10", image also 8.19.10) is fine as-is — confirmed end-to-end on a CE 3.20 → 3.21 upgrade.Suggest owners of
release-v1.40/release-calient-v3.22treat the constant-vs-image sync as a precondition for cherry-picking this fix.