Skip to content

[Obs AI Assistant] Do not attempt to overwrite index mappings if inference id in component template has changed#220739

Merged
sorenlouv merged 7 commits intoelastic:mainfrom
sorenlouv:do-not-overwrite-index-mappings-with-different-inference-id
May 12, 2025
Merged

[Obs AI Assistant] Do not attempt to overwrite index mappings if inference id in component template has changed#220739
sorenlouv merged 7 commits intoelastic:mainfrom
sorenlouv:do-not-overwrite-index-mappings-with-different-inference-id

Conversation

@sorenlouv
Copy link
Copy Markdown
Contributor

@sorenlouv sorenlouv commented May 11, 2025

Improve flaky API tests and avoid errors like:

[ERROR][plugins.observabilityAIAssistant.service] Failed to PUT mapping for .kibana-observability-ai-assistant-kb: illegal_argument_exception
 	Root causes:
 		illegal_argument_exception: Mapper for [semantic_text] conflicts with existing mapper:
 	Cannot update parameter [inference_id] from [pt_tiny_elser_inference_id] to [pt_tiny_text_embedding_inference_id]

@sorenlouv sorenlouv requested a review from a team as a code owner May 11, 2025 09:56
@botelastic botelastic bot added ci:project-deploy-observability Create an Observability project Team:Obs AI Assistant Observability AI Assistant labels May 11, 2025
@github-actions
Copy link
Copy Markdown
Contributor

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • /oblt-deploy : Deploy a Kibana instance using the Observability test environments.
  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

@sorenlouv sorenlouv changed the title [Obs AI Assistant] Do not overwrite index mappings with different inference [Obs AI Assistant] Do not overwrite index mappings with different inference id May 11, 2025
@sorenlouv sorenlouv changed the title [Obs AI Assistant] Do not overwrite index mappings with different inference id [Obs AI Assistant] Do not attempt to overwrite index mappings with different inference id May 11, 2025
@sorenlouv sorenlouv changed the title [Obs AI Assistant] Do not attempt to overwrite index mappings with different inference id [Obs AI Assistant] Do not attempt to overwrite index mappings with changed inference id May 11, 2025
@sorenlouv sorenlouv added backport:version Backport to applied version labels v9.1.0 v8.19.0 release_note:skip Skip the PR/issue when compiling release notes labels May 11, 2025
@sorenlouv sorenlouv changed the title [Obs AI Assistant] Do not attempt to overwrite index mappings with changed inference id [Obs AI Assistant] Do not attempt to overwrite index mappings if inference id in component template has changed May 11, 2025
@kibanamachine
Copy link
Copy Markdown
Contributor

Flaky Test Runner Stats

🟠 Some tests failed. - kibana-flaky-test-suite-runner#8261

[✅] x-pack/test/api_integration/deployment_agnostic/configs/serverless/oblt.ai_assistant.serverless.config.ts: 100/100 tests passed.
[❌] x-pack/test/api_integration/deployment_agnostic/configs/stateful/oblt.stateful.config.ts: 75/100 tests passed.

see run history

sorenlouv added 4 commits May 11, 2025 17:47
…del deployment” error

 the model id is the same as the deployment id of a current model deployment]: Cannot create model [pt_tiny_text_embedding] the model id is the same as the deployment id of a current model deployment","attributes":{"body":{"error":{"root_cause":[{"type":"status_exception","reason":"Cannot create model [pt_tiny_text_embedding] the model id is the same as the deployment id of a current model deployment"}],"type":"status_exception","reason":"Cannot create model [pt_tiny_text_embedding] the model id is the same as the deployment id of a current model deployment"},"status":400}}}'
@sorenlouv sorenlouv enabled auto-merge (squash) May 12, 2025 06:11
@elasticmachine
Copy link
Copy Markdown
Contributor

⏳ Build in-progress

  • Buildkite Build
  • Commit: 12dff96
  • Kibana Serverless Image: docker.elastic.co/kibana-ci/kibana-serverless:pr-220739-12dff964950b

History

});
// `createConcreteWriteIndex` will create the write index, or update the index mappings if the index already exists
// only invoke `createConcreteWriteIndex` if the write index does not exist or the inferenceId in the component template is the same as the one in the write index
if (!writeIndexInferenceId || writeIndexInferenceId === componentTemplateInferenceId) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey @sorenlouv
Would this work when changing the model as well?

In the /setup route we call createOrUpdateKnowledgeBaseIndexAssets with nextInferenceId when currentWriteIndexInferenceId !== nextInferenceId.
In that scenario, are we avoiding calling createConcreteWriteIndex here with this change?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I tested locally and changing the model seems to be working

@sorenlouv sorenlouv merged commit d2f25df into elastic:main May 12, 2025
10 checks passed
@kibanamachine
Copy link
Copy Markdown
Contributor

Starting backport for target branches: 8.19

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

@kibanamachine
Copy link
Copy Markdown
Contributor

💔 All backports failed

Status Branch Result
8.19 Backport failed because of merge conflicts

You might need to backport the following PRs to 8.19:
- [Obs AI Assistant] Improve flaky recall tests (#220638)
- [Obs AI Assistant] Use update-by-query for semantic_text migration (#220255)
- [Obs AI Assistant] Add support for dense vector embeddings in API tests (#219199)

Manual backport

To create the backport manually run:

node scripts/backport --pr 220739

Questions ?

Please refer to the Backport tool documentation

@sorenlouv sorenlouv deleted the do-not-overwrite-index-mappings-with-different-inference-id branch May 14, 2025 04:52
sorenlouv added a commit to sorenlouv/kibana that referenced this pull request May 14, 2025
…rence id in component template has changed (elastic#220739)

Improve flaky API tests and avoid errors like:

```
[ERROR][plugins.observabilityAIAssistant.service] Failed to PUT mapping for .kibana-observability-ai-assistant-kb: illegal_argument_exception
 	Root causes:
 		illegal_argument_exception: Mapper for [semantic_text] conflicts with existing mapper:
 	Cannot update parameter [inference_id] from [pt_tiny_elser_inference_id] to [pt_tiny_text_embedding_inference_id]
```

(cherry picked from commit d2f25df)
@sorenlouv
Copy link
Copy Markdown
Contributor Author

💚 All backports created successfully

Status Branch Result
8.19

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

Questions ?

Please refer to the Backport tool documentation

@kibanamachine kibanamachine added the backport missing Added to PRs automatically when the are determined to be missing a backport. label May 14, 2025
@kibanamachine
Copy link
Copy Markdown
Contributor

Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync.
cc: @sorenlouv

sorenlouv added a commit that referenced this pull request May 14, 2025
… AI Assistant] Do not attempt to overwrite index mappings if inference id in component template has changed (#220739) (#220791)

# Backport

This will backport the following commits from `main` to `8.19`:
- [[Obs AI Assistant] Improve flaky recall tests
(#220638)](#220638)
- [[Obs AI Assistant] Do not attempt to overwrite index mappings if
inference id in component template has changed
(#220739)](#220739)

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

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

<!--BACKPORT [{"author":{"name":"Søren
Louv-Jansen","email":"soren.louv@elastic.co"},"sourceCommit":{"committedDate":"2025-05-09T13:21:07Z","message":"[Obs
AI Assistant] Improve flaky recall tests
(#220638)","sha":"ed1f558f30127b36f450e9b9f991fcc1c13c36c3","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport
missing","ci:build-cloud-image","ci:build-serverless-image","Team:Obs AI
Assistant","ci:project-deploy-observability","backport:version","v9.1.0","v8.19.0"],"title":"[Obs
AI Assistant] Improve flaky recall
tests","number":220638,"url":"https://github.com/elastic/kibana/pull/220638","mergeCommit":{"message":"[Obs
AI Assistant] Improve flaky recall tests
(#220638)","sha":"ed1f558f30127b36f450e9b9f991fcc1c13c36c3"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/220638","number":220638,"mergeCommit":{"message":"[Obs
AI Assistant] Improve flaky recall tests
(#220638)","sha":"ed1f558f30127b36f450e9b9f991fcc1c13c36c3"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/220790","number":220790,"state":"OPEN"}]},{"author":{"name":"Søren
Louv-Jansen","email":"soren.louv@elastic.co"},"sourceCommit":{"committedDate":"2025-05-12T15:11:03Z","message":"[Obs
AI Assistant] Do not attempt to overwrite index mappings if inference id
in component template has changed (#220739)\n\nImprove flaky API tests
and avoid errors
like:\n\n```\n[ERROR][plugins.observabilityAIAssistant.service] Failed
to PUT mapping for .kibana-observability-ai-assistant-kb:
illegal_argument_exception\n \tRoot causes:\n
\t\tillegal_argument_exception: Mapper for [semantic_text] conflicts
with existing mapper:\n \tCannot update parameter [inference_id] from
[pt_tiny_elser_inference_id] to
[pt_tiny_text_embedding_inference_id]\n```","sha":"d2f25df5f3c8337ae9237093fde05d43660e0cf2","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Obs
AI
Assistant","ci:project-deploy-observability","backport:version","v9.1.0","v8.19.0"],"title":"[Obs
AI Assistant] Do not attempt to overwrite index mappings if inference id
in component template has
changed","number":220739,"url":"https://github.com/elastic/kibana/pull/220739","mergeCommit":{"message":"[Obs
AI Assistant] Do not attempt to overwrite index mappings if inference id
in component template has changed (#220739)\n\nImprove flaky API tests
and avoid errors
like:\n\n```\n[ERROR][plugins.observabilityAIAssistant.service] Failed
to PUT mapping for .kibana-observability-ai-assistant-kb:
illegal_argument_exception\n \tRoot causes:\n
\t\tillegal_argument_exception: Mapper for [semantic_text] conflicts
with existing mapper:\n \tCannot update parameter [inference_id] from
[pt_tiny_elser_inference_id] to
[pt_tiny_text_embedding_inference_id]\n```","sha":"d2f25df5f3c8337ae9237093fde05d43660e0cf2"}},"sourceBranch":"main","suggestedTargetBranches":["8.19"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/220739","number":220739,"mergeCommit":{"message":"[Obs
AI Assistant] Do not attempt to overwrite index mappings if inference id
in component template has changed (#220739)\n\nImprove flaky API tests
and avoid errors
like:\n\n```\n[ERROR][plugins.observabilityAIAssistant.service] Failed
to PUT mapping for .kibana-observability-ai-assistant-kb:
illegal_argument_exception\n \tRoot causes:\n
\t\tillegal_argument_exception: Mapper for [semantic_text] conflicts
with existing mapper:\n \tCannot update parameter [inference_id] from
[pt_tiny_elser_inference_id] to
[pt_tiny_text_embedding_inference_id]\n```","sha":"d2f25df5f3c8337ae9237093fde05d43660e0cf2"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->
@sorenlouv sorenlouv removed the v8.19.0 label May 14, 2025
@sorenlouv
Copy link
Copy Markdown
Contributor Author

Backported to 8.19 in #220791

@kibanamachine kibanamachine removed the backport missing Added to PRs automatically when the are determined to be missing a backport. label May 15, 2025
akowalska622 pushed a commit to akowalska622/kibana that referenced this pull request May 29, 2025
…rence id in component template has changed (elastic#220739)

Improve flaky API tests and avoid errors like:

```
[ERROR][plugins.observabilityAIAssistant.service] Failed to PUT mapping for .kibana-observability-ai-assistant-kb: illegal_argument_exception
 	Root causes:
 		illegal_argument_exception: Mapper for [semantic_text] conflicts with existing mapper:
 	Cannot update parameter [inference_id] from [pt_tiny_elser_inference_id] to [pt_tiny_text_embedding_inference_id]
```
qn895 pushed a commit to qn895/kibana that referenced this pull request Jun 3, 2025
…rence id in component template has changed (elastic#220739)

Improve flaky API tests and avoid errors like:

```
[ERROR][plugins.observabilityAIAssistant.service] Failed to PUT mapping for .kibana-observability-ai-assistant-kb: illegal_argument_exception
 	Root causes:
 		illegal_argument_exception: Mapper for [semantic_text] conflicts with existing mapper:
 	Cannot update parameter [inference_id] from [pt_tiny_elser_inference_id] to [pt_tiny_text_embedding_inference_id]
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:version Backport to applied version labels ci:project-deploy-observability Create an Observability project release_note:skip Skip the PR/issue when compiling release notes Team:Obs AI Assistant Observability AI Assistant v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants