Skip to content

[Ingest Pipelines] Fix empty string bug#228717

Merged
sabarasaba merged 4 commits intoelastic:mainfrom
sabarasaba:ingest_pipelines-fix_empty_string_bug
Jul 22, 2025
Merged

[Ingest Pipelines] Fix empty string bug#228717
sabarasaba merged 4 commits intoelastic:mainfrom
sabarasaba:ingest_pipelines-fix_empty_string_bug

Conversation

@sabarasaba
Copy link
Member

@sabarasaba sabarasaba commented Jul 21, 2025

Fix: #219184

Summary

This PR fixes a bug in which if a given processor has an empty string value it will get removed before submitting causing errors with the API.

In order to test, create the following pipeline through console and make sure that cloning it or editing it allows you to save it.

PUT _ingest/pipeline/test
{
  "processors": [
    {
      "set": {
        "field": "source.address",
        "value": "",
        "if": "ctx.source?.address == null"
      }
    }
  ]
}

@sabarasaba sabarasaba self-assigned this Jul 21, 2025
@sabarasaba sabarasaba added Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more t// release_note:skip Skip the PR/issue when compiling release notes Feature:Ingest Node Pipelines Ingest node pipelines management backport:version Backport to applied version labels v9.2.0 labels Jul 21, 2025
@sabarasaba sabarasaba marked this pull request as ready for review July 21, 2025 08:43
@sabarasaba sabarasaba requested a review from a team as a code owner July 21, 2025 08:43
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-management (Team:Kibana Management)

@sabarasaba
Copy link
Member Author

/ci

Copy link
Contributor

@SoniaSanzV SoniaSanzV left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tested locally, works well.

I wonder if we should allow in the UI that the value is empty. With the changes you have made it is possible to open the pipeline and clone the processor, which fixes the bug. But if I want to edit the processor, it requires that the value is not empty (which makes our UI useless in this case because that processor will have to be edited with the console). It doesn't have to be fixed here, we can open an issue to do it in the future.

Another question: why not backporting this change?

@sabarasaba sabarasaba added backport:prev-major and removed backport:version Backport to applied version labels labels Jul 21, 2025
@sabarasaba
Copy link
Member Author

Thanks for having a look!

I wonder if we should allow in the UI that the value is empty. With the changes you have made it is possible to open the pipeline and clone the processor, which fixes the bug. But if I want to edit the processor, it requires that the value is not empty (which makes our UI useless in this case because that processor will have to be edited with the console). It doesn't have to be fixed here, we can open an issue to do it in the future.

Maybe! That would require a larger effort as if a textinput is empty, we assume its not set so we dont send it.. making it support empty spaces will complicate things slightly and might require a more specific solution applied at a larger level (all processors). I think for now to address these specific case in which can be generated through console is enough 🤔

@sabarasaba
Copy link
Member Author

@elasticmachine merge upstream

@sabarasaba sabarasaba enabled auto-merge (squash) July 22, 2025 04:45
@sabarasaba sabarasaba merged commit 462e7bd into elastic:main Jul 22, 2025
13 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.17, 8.18, 8.19

https://github.com/elastic/kibana/actions/runs/16436352319

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

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.5KB 361.5KB +27.0B

History

cc @sabarasaba

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jul 22, 2025
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jul 22, 2025
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jul 22, 2025
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.17
8.18
8.19

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Jul 22, 2025
# Backport

This will backport the following commits from `main` to `8.19`:
- [[Ingest Pipelines] Fix empty string bug
(#228717)](#228717)

<!--- Backport version: 9.6.6 -->

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

<!--BACKPORT [{"author":{"name":"Ignacio
Rivas","email":"rivasign@gmail.com"},"sourceCommit":{"committedDate":"2025-07-22T06:18:24Z","message":"[Ingest
Pipelines] Fix empty string bug
(#228717)","sha":"462e7bd41ab3b23f4cc4a892b07a98255cbd85fa","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Kibana
Management","release_note:skip","Feature:Ingest Node
Pipelines","backport:prev-major","v9.2.0"],"title":"[Ingest Pipelines]
Fix empty string
bug","number":228717,"url":"https://github.com/elastic/kibana/pull/228717","mergeCommit":{"message":"[Ingest
Pipelines] Fix empty string bug
(#228717)","sha":"462e7bd41ab3b23f4cc4a892b07a98255cbd85fa"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/228717","number":228717,"mergeCommit":{"message":"[Ingest
Pipelines] Fix empty string bug
(#228717)","sha":"462e7bd41ab3b23f4cc4a892b07a98255cbd85fa"}}]}]
BACKPORT-->

Co-authored-by: Ignacio Rivas <rivasign@gmail.com>
kibanamachine added a commit that referenced this pull request Jul 22, 2025
# Backport

This will backport the following commits from `main` to `8.17`:
- [[Ingest Pipelines] Fix empty string bug
(#228717)](#228717)

<!--- Backport version: 9.6.6 -->

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

<!--BACKPORT [{"author":{"name":"Ignacio
Rivas","email":"rivasign@gmail.com"},"sourceCommit":{"committedDate":"2025-07-22T06:18:24Z","message":"[Ingest
Pipelines] Fix empty string bug
(#228717)","sha":"462e7bd41ab3b23f4cc4a892b07a98255cbd85fa","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Kibana
Management","release_note:skip","Feature:Ingest Node
Pipelines","backport:prev-major","v9.2.0"],"title":"[Ingest Pipelines]
Fix empty string
bug","number":228717,"url":"https://github.com/elastic/kibana/pull/228717","mergeCommit":{"message":"[Ingest
Pipelines] Fix empty string bug
(#228717)","sha":"462e7bd41ab3b23f4cc4a892b07a98255cbd85fa"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/228717","number":228717,"mergeCommit":{"message":"[Ingest
Pipelines] Fix empty string bug
(#228717)","sha":"462e7bd41ab3b23f4cc4a892b07a98255cbd85fa"}}]}]
BACKPORT-->

Co-authored-by: Ignacio Rivas <rivasign@gmail.com>
Bluefinger pushed a commit to Bluefinger/kibana that referenced this pull request Jul 22, 2025
@mistic mistic added v8.17.10 and removed v8.17.9 labels Jul 22, 2025
kdelemme pushed a commit to kdelemme/kibana that referenced this pull request Jul 23, 2025
kibanamachine added a commit that referenced this pull request Jul 23, 2025
# Backport

This will backport the following commits from `main` to `8.18`:
- [[Ingest Pipelines] Fix empty string bug
(#228717)](#228717)

<!--- Backport version: 9.6.6 -->

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

<!--BACKPORT [{"author":{"name":"Ignacio
Rivas","email":"rivasign@gmail.com"},"sourceCommit":{"committedDate":"2025-07-22T06:18:24Z","message":"[Ingest
Pipelines] Fix empty string bug
(#228717)","sha":"462e7bd41ab3b23f4cc4a892b07a98255cbd85fa","branchLabelMapping":{"^v9.2.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Kibana
Management","release_note:skip","Feature:Ingest Node
Pipelines","backport:prev-major","v9.2.0"],"title":"[Ingest Pipelines]
Fix empty string
bug","number":228717,"url":"https://github.com/elastic/kibana/pull/228717","mergeCommit":{"message":"[Ingest
Pipelines] Fix empty string bug
(#228717)","sha":"462e7bd41ab3b23f4cc4a892b07a98255cbd85fa"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.2.0","branchLabelMappingKey":"^v9.2.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/228717","number":228717,"mergeCommit":{"message":"[Ingest
Pipelines] Fix empty string bug
(#228717)","sha":"462e7bd41ab3b23f4cc4a892b07a98255cbd85fa"}}]}]
BACKPORT-->

Co-authored-by: Ignacio Rivas <rivasign@gmail.com>
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
kertal pushed a commit to kertal/kibana that referenced this pull request Jul 25, 2025
crespocarlos pushed a commit to crespocarlos/kibana that referenced this pull request Jul 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature:Ingest Node Pipelines Ingest node pipelines management release_note:skip Skip the PR/issue when compiling release notes Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more t// v8.17.10 v8.18.5 v8.19.0 v9.2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

You cannot clone an ingest pipeline if a set processor has an empty string ("") as its value.

5 participants