[9.2] [Ingest pipelines] Fix Ip location processor bug (#265740)#266423
Merged
kibanamachine merged 1 commit intoelastic:9.2from Apr 29, 2026
Merged
[9.2] [Ingest pipelines] Fix Ip location processor bug (#265740)#266423kibanamachine merged 1 commit intoelastic:9.2from
kibanamachine merged 1 commit intoelastic:9.2from
Conversation
Closes elastic#257233 ## Summary - When an IP Location processor used a local database whose filename coincidentally matched a known managed database display name (e.g. `ASN.mmdb` colliding with the IPinfo "ASN" label), the pipeline editor produced the wrong `database_file` on save and visually selected both the local and the IPinfo entries in the combo box at the same time. - The root cause was that deserialization and serialization of `database_file` relied solely on the display label string (e.g. `"ASN"`) to identify databases, making local and managed entries indistinguishable when their labels collided. - The fix gives local databases a distinct combo box label using their full filename including the `.mmdb` extension (e.g. `"ASN.mmdb"`). The deserializer now returns the full filename for unrecognised databases (local ones) so that `selectedOptions` matches the correct entry. The serializer skips the managed-database lookup when the value already ends in `.mmdb`, returning it as-is. A `normalizeMmdbFilename` helper is added to `utils.ts` (with a guard against double extension, e.g. `ASN.mmdb.mmdb`) and a `getDatabaseOptionLabel` helper centralises the label logic. Both are covered by new unit tests in `utils.test.ts`. ### Test plan 1. Upload a local database named `ASN.mmdb` as a cluster extension (place in `.es/<version>/config/ingest-geoip/`). You can use: [ASN.mmdb.zip](https://github.com/user-attachments/files/27123526/ASN.mmdb.zip). 2. From Stack Management → Ingest Pipelines → Manage processors, create a ASN database. Confirm both `ASN.mmdb` (Local) and `ASN` (IPinfo) appear in the list. 3. Create (or open) an ingest pipeline with two IP Location processors: - First processor: `database_file: "ASN.mmdb"` (the local one) - Second processor: `database_file: "standard_asn.mmdb"` (the IPinfo managed one) 4. Open each processor in the editor: - The first should show `ASN.mmdb` selected under the Local group only — no tick on the IPinfo entry. - The second should show `ASN` selected under the IPinfo group only — no tick on the Local entry. 5. Save the pipeline without changes and inspect the request preview — values must round-trip correctly: - First processor: `"database_file": "ASN.mmdb"` - Second processor: `"database_file": "standard_asn.mmdb"` ### Before/after notes ### Evidence (screenshots / screen recording) **Before** <img width="821" height="277" alt="Screenshot 2026-04-27 at 12 30 08" src="https://github.com/user-attachments/assets/1d167bcc-75f1-4240-8dfb-daa4c44d1f47" /> <img width="597" height="479" alt="Screenshot 2026-04-27 at 12 31 08" src="https://github.com/user-attachments/assets/6021842e-b9ae-44b6-abf9-0985f7bee92b" /> **After** <img width="822" height="285" alt="Screenshot 2026-04-27 at 12 30 32" src="https://github.com/user-attachments/assets/1f8c58ce-1b56-4fb9-8d2a-4d6cdfa97bfd" /> <img width="571" height="568" alt="Screenshot 2026-04-27 at 12 32 25" src="https://github.com/user-attachments/assets/dc94a073-69fe-4e81-8d21-8ad746008fd8" /> --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> (cherry picked from commit 19f4b1c)
Contributor
Author
💛 Build succeeded, but was flaky
Failed CI StepsTest Failures
Metrics [docs]Async chunks
cc @SoniaSanzV |
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.
Backport
This will backport the following commits from
mainto9.2:Questions ?
Please refer to the Backport tool documentation