[GH-ISSUE #12313] issue: v0.6.0 Docker: Tool Server UI validation fails & backend logs show incorrect host.docker.internal usage #136275

Closed
opened 2026-05-25 04:05:14 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @ref21 on GitHub (Apr 1, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/12313

Check Existing Issues

  • I have searched the existing issues and discussions.
  • I am using the latest version of Open WebUI.

Installation Method

Docker

Open WebUI Version

0.6.0

Ollama Version (if applicable)

No response

Operating System

MacOS 15.3.2

Browser (if applicable)

Safari and Chrome

Confirmation

  • I have read and followed all instructions in README.md.
  • I am using the latest version of both Open WebUI and Ollama.
  • I have included the browser console logs.
  • I have included the Docker container logs.
  • I have listed steps to reproduce the bug in detail.

Expected Behavior

When adding a custom OpenAPI tool server running in a separate container on the same Docker Compose network, Open WebUI should:

  1. Successfully validate and save the connection using the container's service name as the hostname (e.g., http://filesystem-server:8000).
  2. Utilize this correct internal URL for all subsequent interactions with the tool server, including any background checks or processes.

Actual Behavior

Two distinct issues occur:

  1. UI Validation Failure: When attempting to add/save the tool server URL http://filesystem-server:8000 in the Admin Settings -> Tools section, the UI immediately displays an error: "Failed to connect to http://filesystem-server:8000 OpenAPI tool server", even though connectivity is confirmed via other methods (see steps).
  2. Incorrect Backend Connection Attempts: Despite the UI attempting the correct URL during validation, the docker logs open-webui continuously show background errors where OpenWebUI is attempting to connect to host.docker.internal:8000 (which I added by mistake at first, and now I cannot correct it no matter what I do. The UI shows the correct URL, but the backend shows it continues to attempt the incorrect first URL). This suggests a separate internal process is not using the configured URL and is stuck on an incorrect address for container-to-container communication.

Steps to Reproduce

Prepare Custom Tool Server:

  • Use the openapi-servers/servers/filesystem example from https://github.com/open-webui/openapi-servers.
  • Modify main.py to set ALLOWED_DIRECTORIES to use paths internal to the container (e.g., ["/data/inbox", "/data/memories"]).
  • Create a Dockerfile for this filesystem server (standard Python/Uvicorn setup, see example below).
  • Configure Docker Compose: Add the custom filesystem tool as a new service (filesystem) to the same docker-compose.yaml file used by OpenWebUI. Ensure:
    -- It uses build: context pointing to the filesystem server code/Dockerfile.
    -- It has a distinct container_name (e.g., filesystem-server).
    -- Example filesystem service definition:

filesystem:
build:
context: /path/to/your/openapi-servers/servers/filesystem # Adjust path
dockerfile: Dockerfile
container_name: filesystem-server
restart: unless-stopped
volumes:
- "/Users/youruser/path/to/Inbox:/data/inbox:rw" # Adjust path
- "/Users/youruser/path/to/Memories:/data/memories:rw" # Adjust path

  • I can confirm Internal Connectivity from with my open-webui container:
    docker exec -it open-webui bash
    curl http://filesystem-server:8000/openapi.json
    exit
  • Curl command successfully retrieves the JSON output, proving network connectivity.
  • Attempt to Add Tool in OpenWebUI via entering the URL: http://filesystem-server:8000. Click Save, and get UI Error: red error message "Failed to connect to http://filesystem-server:8000 OpenAPI tool server". But note below in the logs that it actually says it cannot reach host.docker.internal:8000! Very strange.

Logs & Screenshots

Image Image

2025-04-01 15:06:21 open-webui | 2025-04-01 20:06:21.282 | ERROR | open_webui.routers.openai:send_get_request:81 - Connection error: Cannot connect to host host.docker.internal:8000 ssl:default [Connect call failed ('192.###.##.###', 8000)] - {}

Additional Information

Troubleshooting steps like restarting the open-webui container and performing docker-compose down & docker-compose up -d did not resolve either issue. Neither did a shift-refresh or changing browsers.

Originally created by @ref21 on GitHub (Apr 1, 2025). Original GitHub issue: https://github.com/open-webui/open-webui/issues/12313 ### Check Existing Issues - [x] I have searched the existing issues and discussions. - [x] I am using the latest version of Open WebUI. ### Installation Method Docker ### Open WebUI Version 0.6.0 ### Ollama Version (if applicable) _No response_ ### Operating System MacOS 15.3.2 ### Browser (if applicable) Safari and Chrome ### Confirmation - [x] I have read and followed all instructions in `README.md`. - [x] I am using the latest version of **both** Open WebUI and Ollama. - [x] I have included the browser console logs. - [x] I have included the Docker container logs. - [x] I have listed steps to reproduce the bug in detail. ### Expected Behavior When adding a custom OpenAPI tool server running in a separate container on the same Docker Compose network, Open WebUI should: 1. Successfully validate and save the connection using the container's service name as the hostname (e.g., http://filesystem-server:8000). 2. Utilize this correct internal URL for all subsequent interactions with the tool server, including any background checks or processes. ### Actual Behavior Two distinct issues occur: 1. UI Validation Failure: When attempting to add/save the tool server URL http://filesystem-server:8000 in the Admin Settings -> Tools section, the UI immediately displays an error: "Failed to connect to [http://filesystem-server:8000 ](http://filesystem-server:8000/)OpenAPI tool server", even though connectivity is confirmed via other methods (see steps). 2. Incorrect Backend Connection Attempts: Despite the UI attempting the correct URL during validation, the docker logs open-webui continuously show background errors where OpenWebUI is attempting to connect to host.docker.internal:8000 (which I added by mistake at first, and now I cannot correct it no matter what I do. The UI shows the correct URL, but the backend shows it continues to attempt the incorrect first URL). This suggests a separate internal process is not using the configured URL and is stuck on an incorrect address for container-to-container communication. ### Steps to Reproduce Prepare Custom Tool Server: - Use the openapi-servers/servers/filesystem example from https://github.com/open-webui/openapi-servers. - Modify main.py to set ALLOWED_DIRECTORIES to use paths internal to the container (e.g., ["/data/inbox", "/data/memories"]). - Create a Dockerfile for this filesystem server (standard Python/Uvicorn setup, see example below). - Configure Docker Compose: Add the custom filesystem tool as a new service (filesystem) to the same docker-compose.yaml file used by OpenWebUI. Ensure: -- It uses build: context pointing to the filesystem server code/Dockerfile. -- It has a distinct container_name (e.g., filesystem-server). -- Example filesystem service definition: > filesystem: build: context: /path/to/your/openapi-servers/servers/filesystem # Adjust path dockerfile: Dockerfile container_name: filesystem-server restart: unless-stopped volumes: - "/Users/youruser/path/to/Inbox:/data/inbox:rw" # Adjust path - "/Users/youruser/path/to/Memories:/data/memories:rw" # Adjust path - I can confirm Internal Connectivity from with my open-webui container: docker exec -it open-webui bash curl http://filesystem-server:8000/openapi.json exit - Curl command successfully retrieves the JSON output, proving network connectivity. - Attempt to Add Tool in OpenWebUI via entering the URL: http://filesystem-server:8000. Click Save, and get UI Error: red error message "Failed to connect to [http://filesystem-server:8000 ](http://filesystem-server:8000/)OpenAPI tool server". But note below in the logs that it actually says it cannot reach host.docker.internal:8000! Very strange. ### Logs & Screenshots <img width="413" alt="Image" src="https://github.com/user-attachments/assets/1fd17690-f2f4-4055-baeb-f643103e156e" /> <img width="713" alt="Image" src="https://github.com/user-attachments/assets/21a5c628-413f-477d-a8cf-d11014135d3f" /> 2025-04-01 15:06:21 open-webui | 2025-04-01 20:06:21.282 | ERROR | open_webui.routers.openai:send_get_request:81 - Connection error: Cannot connect to host host.docker.internal:8000 ssl:default [Connect call failed ('192.###.##.###', 8000)] - {} ### Additional Information Troubleshooting steps like restarting the open-webui container and performing docker-compose down & docker-compose up -d did not resolve either issue. Neither did a shift-refresh or changing browsers.
GiteaMirror added the bug label 2026-05-25 04:05:15 -05:00
Author
Owner

@tjbck commented on GitHub (Apr 1, 2025):

related: https://github.com/open-webui/mcpo/issues/10#issuecomment-2770559381

TL;DR Tool servers makes outgoing requests directly from the browser, and not the backend.

<!-- gh-comment-id:2770605686 --> @tjbck commented on GitHub (Apr 1, 2025): related: https://github.com/open-webui/mcpo/issues/10#issuecomment-2770559381 TL;DR Tool servers makes outgoing requests directly from the browser, and not the backend.
Author
Owner

@pkkudo commented on GitHub (Apr 2, 2025):

Edit: Nvm below. My error was caused by mixed contents where I have OWUI over https and mcpo over http. I have setup my reverse proxy to serve mcpo over https and the issue was gone.


I have OWUI v0.6.0 running as both docker container and uvx on separate hosts. The mcpo is running on another host.I can successfully add the mcpo server on port 8000 on uvx OUWI, but fails on docker OWUI, showing the same logs reported above. I also cannot figure out why.

My browser (192.168.1.244 in the logs below) using uvx OWUI is successfully connected and using the tool. The host running docker OWUI (192.168.1.145) can also access it as shown in the log below at the bottom.

$ mcpo --port 8000 --host 0.0.0.0 -- mcp-server-time --local-timezone=Asia/Tokyo
Starting MCP OpenAPI Proxy on 0.0.0.0:8000 with command: mcp-server-time --local-timezone=Asia/Tokyo
INFO:     Started server process [7779]
INFO:     Waiting for application startup.
INFO:     Application startup complete.
INFO:     Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit)
INFO:     192.168.1.244:63004 - "GET / HTTP/1.1" 404 Not Found
INFO:     192.168.1.244:63004 - "GET /favicon.ico HTTP/1.1" 404 Not Found
INFO:     192.168.1.244:63006 - "OPTIONS /openapi.json HTTP/1.1" 200 OK
INFO:     192.168.1.244:63006 - "GET /openapi.json HTTP/1.1" 200 OK
INFO:     192.168.1.244:63066 - "OPTIONS /get_current_time HTTP/1.1" 200 OK
Calling get_current_time with arguments: {'timezone': 'Asia/Tokyo'}
INFO:     192.168.1.244:63066 - "POST /get_current_time HTTP/1.1" 200 OK
INFO:     192.168.1.145:43386 - "GET /openapi.json HTTP/1.1" 200 OK

"GET /openapi.json" was executed from the container running next to the OWUI container connected to the same docker network.

$ docker compose ps
NAME         IMAGE                                                             COMMAND                  SERVICE      CREATED          STATUS                    PORTS
open-webui   open-webui/open-webui:v0.6.0   "bash start.sh"          open-webui   17 minutes ago   Up 17 minutes (healthy)   0.0.0.0:3000->8080/tcp, [::]:3000->8080/tcp
tools        myregistry/tools:3.21.3                "/usr/local/bin/keep…"   tools        4 minutes ago    Up 4 minutes

$ docker exec tools curl 192.168.1.153:8000/openapi.json
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  2704  100  2704    0     0   {"openapi":"3.1.0","info":{"title":"mcp-time","description":"mcp-time MCP Server","version":"1.6.0"},"paths":{"/get_current_time":{"post":{"summary":"Get Current Time","description":"Get current time in a specific timezones","operationId":"tool_endpoint_get_current_time_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/get_current_time_form_model"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/convert_time":{"post":{"summary":"Convert Time","description":"Convert time between timezones","operationId":"tool_endpoint_convert_time_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/convert_time_form_model"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"convert_time_form_model":{"properties":{"source_timezone":{"type":"string","title":"Source Timezone","description":"Source IANA timezone name (e.g., 'America/New_York', 'Europe/London'). Use 'Asia/Tokyo' as local timezone if no source timezone provided by the user."},"time":{"type":"string","title":"Time","description":"Time to convert in 24-hour format (HH:MM)"},"target_timezone":{"type":"string","title":"Target Timezone","description":"Target IANA timezone name (e.g., 'Asia/Tokyo', 'America/San_Francisco'). Use 'Asia/Tokyo' as local timezone if no target timezone provided by the user."}},"type":"object","required":["source_timezone","time","target_timezone"],"title":"convert_time_form_model"},"get_current_time_form_model":{"properties":{"timezone":{"type":"string","title":"Timezone","description":"IANA timezone name (e.g., 'America/New_York', 'Europe/London'). Use 'Asia/Tokyo' as local timezone if no timezone provided by the user."}},"type":"object","required":["timezone"],"title":"get_current_time_form_model"}}}}834k      0 --:--:-- --:--:-- --:--:--  880k
<!-- gh-comment-id:2771339818 --> @pkkudo commented on GitHub (Apr 2, 2025): Edit: Nvm below. My error was caused by mixed contents where I have OWUI over https and mcpo over http. I have setup my reverse proxy to serve mcpo over https and the issue was gone. <hr/> I have OWUI v0.6.0 running as both docker container and uvx on separate hosts. The mcpo is running on another host.I can successfully add the mcpo server on port 8000 on uvx OUWI, but fails on docker OWUI, showing the same logs reported above. I also cannot figure out why. My browser (192.168.1.244 in the logs below) using uvx OWUI is successfully connected and using the tool. The host running docker OWUI (192.168.1.145) can also access it as shown in the log below at the bottom. ```sh $ mcpo --port 8000 --host 0.0.0.0 -- mcp-server-time --local-timezone=Asia/Tokyo Starting MCP OpenAPI Proxy on 0.0.0.0:8000 with command: mcp-server-time --local-timezone=Asia/Tokyo INFO: Started server process [7779] INFO: Waiting for application startup. INFO: Application startup complete. INFO: Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit) INFO: 192.168.1.244:63004 - "GET / HTTP/1.1" 404 Not Found INFO: 192.168.1.244:63004 - "GET /favicon.ico HTTP/1.1" 404 Not Found INFO: 192.168.1.244:63006 - "OPTIONS /openapi.json HTTP/1.1" 200 OK INFO: 192.168.1.244:63006 - "GET /openapi.json HTTP/1.1" 200 OK INFO: 192.168.1.244:63066 - "OPTIONS /get_current_time HTTP/1.1" 200 OK Calling get_current_time with arguments: {'timezone': 'Asia/Tokyo'} INFO: 192.168.1.244:63066 - "POST /get_current_time HTTP/1.1" 200 OK INFO: 192.168.1.145:43386 - "GET /openapi.json HTTP/1.1" 200 OK ``` "GET /openapi.json" was executed from the container running next to the OWUI container connected to the same docker network. ```sh $ docker compose ps NAME IMAGE COMMAND SERVICE CREATED STATUS PORTS open-webui open-webui/open-webui:v0.6.0 "bash start.sh" open-webui 17 minutes ago Up 17 minutes (healthy) 0.0.0.0:3000->8080/tcp, [::]:3000->8080/tcp tools myregistry/tools:3.21.3 "/usr/local/bin/keep…" tools 4 minutes ago Up 4 minutes $ docker exec tools curl 192.168.1.153:8000/openapi.json % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 2704 100 2704 0 0 {"openapi":"3.1.0","info":{"title":"mcp-time","description":"mcp-time MCP Server","version":"1.6.0"},"paths":{"/get_current_time":{"post":{"summary":"Get Current Time","description":"Get current time in a specific timezones","operationId":"tool_endpoint_get_current_time_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/get_current_time_form_model"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/convert_time":{"post":{"summary":"Convert Time","description":"Convert time between timezones","operationId":"tool_endpoint_convert_time_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/convert_time_form_model"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"convert_time_form_model":{"properties":{"source_timezone":{"type":"string","title":"Source Timezone","description":"Source IANA timezone name (e.g., 'America/New_York', 'Europe/London'). Use 'Asia/Tokyo' as local timezone if no source timezone provided by the user."},"time":{"type":"string","title":"Time","description":"Time to convert in 24-hour format (HH:MM)"},"target_timezone":{"type":"string","title":"Target Timezone","description":"Target IANA timezone name (e.g., 'Asia/Tokyo', 'America/San_Francisco'). Use 'Asia/Tokyo' as local timezone if no target timezone provided by the user."}},"type":"object","required":["source_timezone","time","target_timezone"],"title":"convert_time_form_model"},"get_current_time_form_model":{"properties":{"timezone":{"type":"string","title":"Timezone","description":"IANA timezone name (e.g., 'America/New_York', 'Europe/London'). Use 'Asia/Tokyo' as local timezone if no timezone provided by the user."}},"type":"object","required":["timezone"],"title":"get_current_time_form_model"}}}}834k 0 --:--:-- --:--:-- --:--:-- 880k ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#136275