Skip to content

[9.2] [Ingest pipelines] Fix Ip location processor bug (#265740)#266423

Merged
kibanamachine merged 1 commit intoelastic:9.2from
kibanamachine:backport/9.2/pr-265740
Apr 29, 2026
Merged

[9.2] [Ingest pipelines] Fix Ip location processor bug (#265740)#266423
kibanamachine merged 1 commit intoelastic:9.2from
kibanamachine:backport/9.2/pr-265740

Conversation

@kibanamachine
Copy link
Copy Markdown
Contributor

Backport

This will backport the following commits from main to 9.2:

Questions ?

Please refer to the Backport tool documentation

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)
@kibanamachine kibanamachine added the backport This PR is a backport of another PR label Apr 29, 2026
@kibanamachine kibanamachine enabled auto-merge (squash) April 29, 2026 14:56
@kibanamachine
Copy link
Copy Markdown
Contributor Author

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #38 / Cloud Security Posture - Group 2 Test adding Cloud Security Posture Integrations CSPM AWS CIS_AWS Organization Manual Temporary Keys CIS_AWS Organization Manual Temporary Keys Workflow

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
ingestPipelines 361.6KB 361.7KB +150.0B

cc @SoniaSanzV

@kibanamachine kibanamachine merged commit cae9417 into elastic:9.2 Apr 29, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants