ddgs >= 9.x changed the API: ddgs.text() now returns None instead of an empty list when the backend is unavailable, rate-limited, or encounters other errors. The existing code assumed it always returns a list, causing:
TypeError: 'NoneType' object is not iterable
Changes
backend/open_webui/retrieval/web/duckduckgo.py:
# Before (buggy)try:search_results=ddgs.text(query,...)exceptRatelimitExceptionase:log.error(f"RatelimitException: {e}")iffilter_list:search_results=get_filtered_results(search_results,filter_list)# crashes if None# After (fixed)try:results=ddgs.text(query,...)search_results=resultsifresultsisnotNoneelse[]exceptRatelimitExceptionase:log.error(f"RatelimitException: {e}")search_results=[]iffilter_list:search_results=get_filtered_results(search_results,filter_list)
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/24192
Author: @PHclaw
Created: 4/28/2026
Status: 🔄 Open
Base:
main← Head:fix/ddgs-none-check📝 Commits (1)
f7ce612fix: handle ddgs.text() returning None (ddgs >= 9.x API change)📊 Changes
1 file changed (+4 additions, -1 deletions)
View changed files
📝
backend/open_webui/retrieval/web/duckduckgo.py(+4 -1)📄 Description
Summary
ddgs >= 9.x changed the API:
ddgs.text()now returnsNoneinstead of an empty list when the backend is unavailable, rate-limited, or encounters other errors. The existing code assumed it always returns a list, causing:Changes
backend/open_webui/retrieval/web/duckduckgo.py:Closes #24188
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.