[PR #16220] [CLOSED] Handle info dictionary in opeanapi data when it does not exist #47120

Closed
opened 2026-04-29 22:12:46 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/16220
Author: @1995parham
Created: 8/2/2025
Status: Closed

Base: devHead: main


📝 Commits (1)

  • 8c8e596 chore: handle info dictionary in opeanapi data when it does not exist

📊 Changes

1 file changed (+3 additions, -0 deletions)

View changed files

📝 backend/open_webui/utils/tools.py (+3 -0)

📄 Description

For registering tool server sometimes there is not info section for setting title and description which case internal server error with the following exception:

open-webui-6b8789fd86-2rwhg open-webui     |   File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 301, in app
open-webui-6b8789fd86-2rwhg open-webui     |     raw_response = await run_endpoint_function(
open-webui-6b8789fd86-2rwhg open-webui     |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
open-webui-6b8789fd86-2rwhg open-webui     |   File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 212, in run_endpoint_function
open-webui-6b8789fd86-2rwhg open-webui     |     return await dependant.call(**values)
open-webui-6b8789fd86-2rwhg open-webui     |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
open-webui-6b8789fd86-2rwhg open-webui     |   File "/app/backend/open_webui/routers/configs.py", line 114, in set_tool2025-08-02T01:46:18.201693099Z _servers_config
open-webui-6b8789fd86-2rwhg open-webui     |     request.app.state.TOOL_SERVERS = await get_tool_servers_data(
open-webui-6b8789fd86-2rwhg open-webui     |                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
open-webui-6b8789fd86-2rwhg open-webui     |   File "/app/backend/open_webui/utils/tools.py", line 532, in get_tool_servers_data
open-webui-6b8789fd86-2rwhg open-webui     |     openapi_data["info"]["title"] = info.get("name", "Tool Server")
open-webui-6b8789fd86-2rwhg open-webui     |     ~~~~~~~~~~~~^^^^^^^^
open-webui-6b8789fd86-2rwhg open-webui     | KeyError: 'info'

The change is going to fix this by passing an empty dictionary for info when it does not exist.


🔄 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/16220 **Author:** [@1995parham](https://github.com/1995parham) **Created:** 8/2/2025 **Status:** ❌ Closed **Base:** `dev` ← **Head:** `main` --- ### 📝 Commits (1) - [`8c8e596`](https://github.com/open-webui/open-webui/commit/8c8e5963e37ab9f6aacd3ff768f997c3eea1c6fc) chore: handle info dictionary in opeanapi data when it does not exist ### 📊 Changes **1 file changed** (+3 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `backend/open_webui/utils/tools.py` (+3 -0) </details> ### 📄 Description For registering tool server sometimes there is not `info` section for setting `title` and `description` which case `internal server error` with the following exception: ``` open-webui-6b8789fd86-2rwhg open-webui | File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 301, in app open-webui-6b8789fd86-2rwhg open-webui | raw_response = await run_endpoint_function( open-webui-6b8789fd86-2rwhg open-webui | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ open-webui-6b8789fd86-2rwhg open-webui | File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 212, in run_endpoint_function open-webui-6b8789fd86-2rwhg open-webui | return await dependant.call(**values) open-webui-6b8789fd86-2rwhg open-webui | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ open-webui-6b8789fd86-2rwhg open-webui | File "/app/backend/open_webui/routers/configs.py", line 114, in set_tool2025-08-02T01:46:18.201693099Z _servers_config open-webui-6b8789fd86-2rwhg open-webui | request.app.state.TOOL_SERVERS = await get_tool_servers_data( open-webui-6b8789fd86-2rwhg open-webui | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ open-webui-6b8789fd86-2rwhg open-webui | File "/app/backend/open_webui/utils/tools.py", line 532, in get_tool_servers_data open-webui-6b8789fd86-2rwhg open-webui | openapi_data["info"]["title"] = info.get("name", "Tool Server") open-webui-6b8789fd86-2rwhg open-webui | ~~~~~~~~~~~~^^^^^^^^ open-webui-6b8789fd86-2rwhg open-webui | KeyError: 'info' ``` The change is going to fix this by passing an empty dictionary for `info` when it does not exist. --- <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-04-29 22:12:46 -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#47120