[PR #22416] [CLOSED] fix: handle missing XML elements in Yandex search results #97711

Closed
opened 2026-05-16 00:20:11 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/22416
Author: @gambletan
Created: 3/8/2026
Status: Closed

Base: mainHead: fix/yandex-search-nonetype-crash


📝 Commits (1)

  • 956ba6c fix: handle missing XML elements in Yandex search results

📊 Changes

1 file changed (+4 additions, -1 deletions)

View changed files

📝 backend/open_webui/retrieval/web/yandex.py (+4 -1)

📄 Description

Summary

  • Adds a None guard to xml_element_contents_to_string() in backend/open_webui/retrieval/web/yandex.py
  • Element.find() returns None when the XPath does not match (e.g., a search result lacks a doc/passages/passage element), and passing None to this function causes AttributeError: 'NoneType' object has no attribute 'text'
  • This crashes the entire Yandex web search for any query where at least one result is missing a passage, title, or URL element

Test plan

  • Perform a Yandex web search with a query that returns results with and without passage snippets
  • Verify the search completes without errors and results without passages show empty snippets
  • Verify normal Yandex search results still display correctly

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/open-webui/open-webui/pull/22416 **Author:** [@gambletan](https://github.com/gambletan) **Created:** 3/8/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/yandex-search-nonetype-crash` --- ### 📝 Commits (1) - [`956ba6c`](https://github.com/open-webui/open-webui/commit/956ba6c8e6a5586e43441310643bb0a1fdb64607) fix: handle missing XML elements in Yandex search results ### 📊 Changes **1 file changed** (+4 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `backend/open_webui/retrieval/web/yandex.py` (+4 -1) </details> ### 📄 Description ## Summary - Adds a `None` guard to `xml_element_contents_to_string()` in `backend/open_webui/retrieval/web/yandex.py` - `Element.find()` returns `None` when the XPath does not match (e.g., a search result lacks a `doc/passages/passage` element), and passing `None` to this function causes `AttributeError: 'NoneType' object has no attribute 'text'` - This crashes the entire Yandex web search for any query where at least one result is missing a passage, title, or URL element ## Test plan - [ ] Perform a Yandex web search with a query that returns results with and without passage snippets - [ ] Verify the search completes without errors and results without passages show empty snippets - [ ] Verify normal Yandex search results still display correctly --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-05-16 00:20:11 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#97711