Skip to content

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

Closed
viduni94 wants to merge 1 commit intoelastic:8.18from
viduni94:backport/8.18/pr-221152
Closed

[8.18] [Obs AI Assistant] Check for documents before starting semantic text migration (#221152)#223827
viduni94 wants to merge 1 commit intoelastic:8.18from
viduni94:backport/8.18/pr-221152

Conversation

@viduni94
Copy link
Contributor

Backport

This will backport the following commits from main to 8.18:

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)

# Conflicts:
#	x-pack/platform/plugins/shared/observability_ai_assistant/server/service/inference_endpoint.ts
#	x-pack/platform/plugins/shared/observability_ai_assistant/server/service/startup_migrations/populate_missing_semantic_text_fields.ts
@viduni94 viduni94 added the backport This PR is a backport of another PR label Jun 12, 2025
@viduni94 viduni94 requested a review from kibanamachine as a code owner June 12, 2025 19:49
@viduni94 viduni94 enabled auto-merge (squash) June 12, 2025 19:49
@botelastic botelastic bot added the Team:Obs AI Assistant Observability AI Assistant label Jun 12, 2025
@elasticmachine
Copy link
Contributor

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

@viduni94 viduni94 disabled auto-merge June 12, 2025 19:49
@viduni94
Copy link
Contributor Author

/ci

@viduni94 viduni94 closed this Jun 12, 2025
@elasticmachine
Copy link
Contributor

💔 Build Failed

Failed CI Steps

Metrics [docs]

‼️ ERROR: no builds found for mergeBase sha [b23b366]

History

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.

2 participants