Skip to content

Fixes #31878: return 400 for a search against an index OpenMetadata does not manage (backport 2.0 #35516) - #35517

Merged
manerow merged 1 commit into
2.0from
fix/31878-unknown-index-400-2.0
Oct 16, 2026
Merged

manerow merged 1 commit into
2.0from
fix/31878-unknown-index-400-2.0

Conversation

@manerow

@manerow manerow commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

Issue

Cherry-pick of PR #35516 (Fixes #31878)

On 2.0.x, a search against an index name OpenMetadata does not have, such as GET /api/v1/search/query?index=nope_search_index, returns a 500 and is logged as a server error, although the caller made the mistake. This backport brings main's fix to 2.0, so it ships in 2.0.6. It completes #31878 on 2.0, next to the other cases that PR #35440 already brought over.

What this PR changes

The same change as on main: when the engine says an index is missing, a name OpenMetadata does not manage gives a 400 Unknown search index [...], and a managed index that is missing from the cluster keeps the 500 Failed to find index ..., so a real outage still alerts. See PR #35516 for the full explanation.

The cherry-pick had two conflicts, both caused by main-only context around the new lines: a Javadoc in SearchRepository about column indexing, and tests plus a helper in SearchResourceIT that 2.0 already has from PR #35302. Only this PR's own lines were kept. Every file now applies main's change line for line.

How it was tested

On this branch:

  • The search unit tests, including the new SearchIndexUtilsTest and SearchEngineErrorsTest cases: 354 tests, all passing.
  • SearchResourceIT on Elasticsearch and on OpenSearch: an unknown index returns 400, a missing document in a real index still returns 404, and the existing malformed-input tests still pass (12 of 12 on each engine).

@manerow
manerow requested a review from a team as a code owner October 15, 2026 09:12
@manerow
manerow requested review from mohityadav766 and removed request for a team October 15, 2026 09:12
@manerow manerow added safe to test Add this label to run secure Github workflows on PRs backend skip-pr-checks Bypass PR metadata validation check labels Oct 15, 2026
@gitar-bot

gitar-bot Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Code Review ✅ Approved

🟡 Medium risk · Reclassifying unknown search-index failures from 500 to 400 could alter client error handling for requests using unmanaged index names.

Backports the unknown-index search fix to 2.0: a search against an index name OpenMetadata does not manage now returns 400 Unknown search index [...] instead of a 500, while a managed index missing from the cluster still returns 500 Failed to find index .... No issues found.

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

For more verification details, comment gitar display:verbose.

Options

Display: compact → Showing compact verification results.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source

@sonarqubecloud

Copy link
Copy Markdown

@manerow
manerow merged commit c437e3d into 2.0 Oct 16, 2026
97 of 110 checks passed
@manerow
manerow deleted the fix/31878-unknown-index-400-2.0 branch October 16, 2026 06:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend safe to test Add this label to run secure Github workflows on PRs skip-pr-checks Bypass PR metadata validation check

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants