Skip to content

[8.19] [Obs AI Assistant] Check for documents before starting semantic text migration (#221152)#221203

Merged
kibanamachine merged 1 commit intoelastic:8.19from
kibanamachine:backport/8.19/pr-221152
May 21, 2025
Merged

[8.19] [Obs AI Assistant] Check for documents before starting semantic text migration (#221152)#221203
kibanamachine merged 1 commit intoelastic:8.19from
kibanamachine:backport/8.19/pr-221152

Conversation

@kibanamachine
Copy link
Contributor

Backport

This will backport the following commits from main to 8.19:

Questions ?

Please refer to the Backport tool documentation

…migration (elastic#221152)

Closes elastic#221157

## Summary

We run a semantic text migration at startup to add the semantic text
field to documents that were created before 8.17.

Before multilingual KB was introduced:
- We created index assets for KB when the AI Assistant flyout opens.
- Even if the user does not set up the KB, they will have a component
template pointing to the custom inference endpoint.

With the introduction of multilingual KB:
- We moved some of the index creation to when setting up the KB.
- We try to do the semantic_text migration at startup. During this
migration, for users who didn't set up the KB but had the index assets
created at startup, the custom inference endpoint will be unavailable.
- But since the migration uses the inference endpoint from the write
index, we try to access an endpoint that's not available.

This is the reason for this error to be logged.
```
Inference endpoint "obs_ai_assistant_kb_inference" not found or unavailable: resource_not_found_exception
	Root causes:
		resource_not_found_exception: Inference endpoint not found [obs_ai_assistant_kb_inference]
```

There is no customer impact from this, just that the error that gets
logged is creating a lot of noise.

## Solution

This PR checks whether there are documents without semantic_text before
starting the migration.
And also reduced the log level to warn because we hit the `/status`
endpoint once when a user opens the AI Assistant.

### Checklist

- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

(cherry picked from commit b1e7012)
@kibanamachine kibanamachine added the backport This PR is a backport of another PR label May 21, 2025
@kibanamachine kibanamachine enabled auto-merge (squash) May 21, 2025 21:28
@botelastic botelastic bot added the Team:Obs AI Assistant Observability AI Assistant label May 21, 2025
@elasticmachine
Copy link
Contributor

Pinging @elastic/obs-ai-assistant (Team:Obs AI Assistant)

@kibanamachine kibanamachine merged commit 5ef460d into elastic:8.19 May 21, 2025
13 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 Team:Obs AI Assistant Observability AI Assistant

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants