[GH-ISSUE #20320] [Bug]: Crash loop when loading filter functions with dependencies in restricted environments (uv/nixpkgs) #19149

Closed
opened 2026-04-20 01:29:03 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @fractuscontext on GitHub (Jan 2, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/20320

Check Existing Issues

  • I have searched for any existing and/or related issues.
  • I have searched for any existing and/or related discussions.
  • I have also searched in the CLOSED issues AND CLOSED discussions and found no related items (your issue might already be addressed on the development branch!).
  • I am using the latest version of Open WebUI.

Installation Method

Pip Install

Open WebUI Version

v0.6.43

Ollama Version (if applicable)

No response

Operating System

macOS Seqouia

Browser (if applicable)

No response

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 provided every relevant configuration, setting, and environment variable used in my setup.
  • I have clearly listed every relevant configuration, custom setting, environment variable, and command-line option that influences my setup (such as Docker Compose overrides, .env values, browser settings, authentication configurations, etc).
  • I have documented step-by-step reproduction instructions that are precise, sequential, and leave nothing to interpretation. My steps:
  • Start with the initial platform/version/OS and dependencies used,
  • Specify exact install/launch/configure commands,
  • List URLs visited, user input (incl. example values/emails/passwords if needed),
  • Describe all options and toggles enabled or changed,
  • Include any files or environmental changes,
  • Identify the expected and actual result at each stage,
  • Ensure any reasonably skilled user can follow and hit the same issue.

Expected Behavior

When loading a filter function with a requirements frontmatter (e.g., requirements: httpx>=0.24.0), the system should check if the package is already installed in the current environment. If the package exists and satisfies the version requirement, it should skip the installation process

Actual Behavior

The system unconditionally attempts to run pip install via subprocess for every requirement listed in the frontmatter, regardless of whether it is already installed.

In environments managed by tools like uv or nix, shelling out to pip often fails (returning exit code 1) because the environment is locked or pip is not available in the expected path. This causes the backend to crash with a subprocess.CalledProcessError, even if the required package (e.g., httpx) is already present in site-packages.

Steps to Reproduce

  1. Setup a clean environment using uv on Python 3.11:
uv venv venv --python 3.11
source .venv/bin/activate
  1. Install httpx
uv pip install https==0.26
  1. Launch the server:
DATA_DIR=./data open-webui serve
  1. Import or load a Filter/Tool that has requirements in the frontmatter (e.g., requirements: httpx>=0.24.0), via Admin Panel → Functions → + (Add Function) → {Paste Code} i.e.
```python
"""
title: Placeholder Filter
author: fractuscontext
version: 0.1.0
requirements: httpx>=0.24.0 # HERE!!
"""

from typing import Optional
from pydantic import BaseModel, Field
import logging

# code omitted (imports)

log = logging.getLogger(__name__)

class Filter:
    class Valves(BaseModel):
        priority: int = Field(default=0, description="Priority level.")
        # code omitted (other valves)

    def __init__(self):
        self.valves = self.Valves()
        # code omitted (initialization logic)

    async def inlet(
        self,
        body: dict,
        __user__: Optional[dict] = None,
        __metadata__: Optional[dict] = None,
        __request__: Optional[object] = None,
    ) -> dict:
        
        log.info("Filter inlet triggered")
        
        # code omitted (timestamp fetching)
        # code omitted (filtering logic)
        
        return body

    async def outlet(
        self,
        body: dict,
        __user__: Optional[dict] = None,
        __metadata__: Optional[dict] = None,
        __request__: Optional[object] = None,
    ) -> dict:
        
        # code omitted (outlet logic)
        
        return body
  1. Error!
subprocess.CalledProcessError: Command '['/Users/haruka/Desktop/openwebui/.venv/bin/python3', '-m', 'pip', 'install', 'httpx>=0.24.0']' returned non-zero exit status 1.

Logs & Screenshots

2026-01-02 15:11:35.743 | INFO     | uvicorn.protocols.http.httptools_impl:send:476 - 127.0.0.1:50505 - "GET /api/models HTTP/1.1" 200
2026-01-02 15:11:35.767 | INFO     | uvicorn.protocols.http.httptools_impl:send:476 - 127.0.0.1:50507 - "GET /api/changelog HTTP/1.1" 200
2026-01-02 15:11:35.789 | INFO     | uvicorn.protocols.http.httptools_impl:send:476 - 127.0.0.1:50507 - "GET /api/v1/functions/ HTTP/1.1" 200
2026-01-02 15:11:35.814 | INFO     | uvicorn.protocols.http.httptools_impl:send:476 - 127.0.0.1:50507 - "GET /api/v1/functions/list HTTP/1.1" 200
2026-01-02 15:11:36.146 | INFO     | uvicorn.protocols.http.httptools_impl:send:476 - 127.0.0.1:50505 - "GET /api/version/updates HTTP/1.1" 200
2026-01-02 15:11:56.850 | INFO     | uvicorn.protocols.http.httptools_impl:send:476 - 127.0.0.1:50521 - "POST /api/v1/functions/load/url HTTP/1.1" 200
2026-01-02 15:12:00.197 | INFO     | uvicorn.protocols.http.httptools_impl:send:476 - 127.0.0.1:50521 - "POST /api/v1/utils/code/format HTTP/1.1" 200
2026-01-02 15:12:00.239 | INFO     | open_webui.utils.plugin:install_frontmatter_requirements:270 - Installing requirements: httpx>=0.24.0
/Users/haruka/Desktop/open-webui-fix-deps/backend/venv/bin/python3: No module named pip
2026-01-02 15:12:00.334 | ERROR    | open_webui.utils.plugin:install_frontmatter_requirements:278 - Error installing packages: httpx>=0.24.0
2026-01-02 15:12:00.334 | ERROR    | open_webui.routers.functions:create_new_function:222 - Failed to create a new function: Command '['/Users/haruka/Desktop/open-webui-fix-deps/backend/venv/bin/python3', '-m', 'pip', 'install', 'httpx>=0.24.0']' returned non-zero exit status 1.
Traceback (most recent call last):

  File "<string>", line 1, in <module>
  File "/Users/haruka/.local/share/uv/python/cpython-3.11.14-macos-aarch64-none/lib/python3.11/multiprocessing/spawn.py", line 122, in spawn_main
    exitcode = _main(fd, parent_sentinel)
               │     │   └ 4
               │     └ 7
               └ <function _main at 0x1051a91c0>
  File "/Users/haruka/.local/share/uv/python/cpython-3.11.14-macos-aarch64-none/lib/python3.11/multiprocessing/spawn.py", line 135, in _main
    return self._bootstrap(parent_sentinel)
           │    │          └ 4
           │    └ <function BaseProcess._bootstrap at 0x105016a20>
           └ <SpawnProcess name='SpawnProcess-1' parent=5691 started>
  File "/Users/haruka/.local/share/uv/python/cpython-3.11.14-macos-aarch64-none/lib/python3.11/multiprocessing/process.py", line 314, in _bootstrap
    self.run()
    │    └ <function BaseProcess.run at 0x105015f80>
    └ <SpawnProcess name='SpawnProcess-1' parent=5691 started>
  File "/Users/haruka/.local/share/uv/python/cpython-3.11.14-macos-aarch64-none/lib/python3.11/multiprocessing/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
    │    │        │    │        │    └ {'config': <uvicorn.config.Config object at 0x105150990>, 'target': <bound method Server.run of <uvicorn.server.Server object...
    │    │        │    │        └ <SpawnProcess name='SpawnProcess-1' parent=5691 started>
    │    │        │    └ ()
    │    │        └ <SpawnProcess name='SpawnProcess-1' parent=5691 started>
    │    └ <function subprocess_started at 0x105665300>
    └ <SpawnProcess name='SpawnProcess-1' parent=5691 started>
  File "/Users/haruka/Desktop/open-webui-fix-deps/backend/venv/lib/python3.11/site-packages/uvicorn/_subprocess.py", line 80, in subprocess_started
    target(sockets=sockets)
    │              └ [<socket.socket fd=3, family=2, type=1, proto=0, laddr=('0.0.0.0', 8080)>]
    └ <bound method Server.run of <uvicorn.server.Server object at 0x1058b2ad0>>
  File "/Users/haruka/Desktop/open-webui-fix-deps/backend/venv/lib/python3.11/site-packages/uvicorn/server.py", line 67, in run
    return asyncio_run(self.serve(sockets=sockets), loop_factory=self.config.get_loop_factory())
           │           │    │             │                      │    │      └ <function Config.get_loop_factory at 0x105613ec0>
           │           │    │             │                      │    └ <uvicorn.config.Config object at 0x105150990>
           │           │    │             │                      └ <uvicorn.server.Server object at 0x1058b2ad0>
           │           │    │             └ [<socket.socket fd=3, family=2, type=1, proto=0, laddr=('0.0.0.0', 8080)>]
           │           │    └ <function Server.serve at 0x105664180>
           │           └ <uvicorn.server.Server object at 0x1058b2ad0>
           └ <function asyncio_run at 0x105664040>
  File "/Users/haruka/Desktop/open-webui-fix-deps/backend/venv/lib/python3.11/site-packages/uvicorn/_compat.py", line 23, in asyncio_run
    return runner.run(main)
           │      │   └ <coroutine object Server.serve at 0x105011a80>
           │      └ <function Runner.run at 0x1052e7060>
           └ <asyncio.runners.Runner object at 0x10562bc10>
  File "/Users/haruka/.local/share/uv/python/cpython-3.11.14-macos-aarch64-none/lib/python3.11/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           │    │     │                  └ <Task pending name='Task-1' coro=<Server.serve() running at /Users/haruka/Desktop/open-webui-fix-deps/backend/venv/lib/python...
           │    │     └ <cyfunction Loop.run_until_complete at 0x10579ff40>
           │    └ <uvloop.Loop running=True closed=False debug=False>
           └ <asyncio.runners.Runner object at 0x10562bc10>
  File "/Users/haruka/Desktop/open-webui-fix-deps/backend/venv/lib/python3.11/site-packages/starlette/middleware/base.py", line 144, in coro
    await self.app(scope, receive_or_disconnect, send_no_error)
          │    │   │      │                      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.send_no_error at 0x3125f2de0>
          │    │   │      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x3125f04a0>
          │    │   └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('127.0.0.1', 8080), 'cl...
          │    └ <starlette_compress.CompressMiddleware object at 0x30f0383b0>
          └ <open_webui.main.RedirectMiddleware object at 0x178b0a0d0>
  File "/Users/haruka/Desktop/open-webui-fix-deps/backend/venv/lib/python3.11/site-packages/starlette_compress/__init__.py", line 92, in __call__
    return await self._zstd(scope, receive, send)
                 │    │     │      │        └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.send_no_error at 0x3125f2de0>
                 │    │     │      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x3125f04a0>
                 │    │     └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('127.0.0.1', 8080), 'cl...
                 │    └ <member '_zstd' of 'CompressMiddleware' objects>
                 └ <starlette_compress.CompressMiddleware object at 0x30f0383b0>
  File "/Users/haruka/Desktop/open-webui-fix-deps/backend/venv/lib/python3.11/site-packages/starlette_compress/_zstd_legacy.py", line 100, in __call__
    await self.app(scope, receive, wrapper)
          │    │   │      │        └ <function ZstdResponder.__call__.<locals>.wrapper at 0x3125f0ae0>
          │    │   │      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x3125f04a0>
          │    │   └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('127.0.0.1', 8080), 'cl...
          │    └ <member 'app' of 'ZstdResponder' objects>
          └ <starlette_compress._zstd_legacy.ZstdResponder object at 0x30aa16880>
  File "/Users/haruka/Desktop/open-webui-fix-deps/backend/venv/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 63, in __call__
    await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
          │                            │    │    │     │      │        └ <function ZstdResponder.__call__.<locals>.wrapper at 0x3125f0ae0>
          │                            │    │    │     │      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x3125f04a0>
          │                            │    │    │     └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('127.0.0.1', 8080), 'cl...
          │                            │    │    └ <starlette.requests.Request object at 0x30f508710>
          │                            │    └ <fastapi.middleware.asyncexitstack.AsyncExitStackMiddleware object at 0x30eed7790>
          │                            └ <starlette.middleware.exceptions.ExceptionMiddleware object at 0x30ef09410>
          └ <function wrap_app_handling_exceptions at 0x108c4d580>
  File "/Users/haruka/Desktop/open-webui-fix-deps/backend/venv/lib/python3.11/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app
    await app(scope, receive, sender)
          │   │      │        └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0x3125f0220>
          │   │      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x3125f04a0>
          │   └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('127.0.0.1', 8080), 'cl...
          └ <fastapi.middleware.asyncexitstack.AsyncExitStackMiddleware object at 0x30eed7790>
  File "/Users/haruka/Desktop/open-webui-fix-deps/backend/venv/lib/python3.11/site-packages/fastapi/middleware/asyncexitstack.py", line 18, in __call__
    await self.app(scope, receive, send)
          │    │   │      │        └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0x3125f0220>
          │    │   │      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x3125f04a0>
          │    │   └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('127.0.0.1', 8080), 'cl...
          │    └ <fastapi.routing.APIRouter object at 0x30aa066d0>
          └ <fastapi.middleware.asyncexitstack.AsyncExitStackMiddleware object at 0x30eed7790>
  File "/Users/haruka/Desktop/open-webui-fix-deps/backend/venv/lib/python3.11/site-packages/starlette/routing.py", line 716, in __call__
    await self.middleware_stack(scope, receive, send)
          │    │                │      │        └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0x3125f0220>
          │    │                │      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x3125f04a0>
          │    │                └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('127.0.0.1', 8080), 'cl...
          │    └ <bound method Router.app of <fastapi.routing.APIRouter object at 0x30aa066d0>>
          └ <fastapi.routing.APIRouter object at 0x30aa066d0>
  File "/Users/haruka/Desktop/open-webui-fix-deps/backend/venv/lib/python3.11/site-packages/starlette/routing.py", line 736, in app
    await route.handle(scope, receive, send)
          │     │      │      │        └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0x3125f0220>
          │     │      │      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x3125f04a0>
          │     │      └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('127.0.0.1', 8080), 'cl...
          │     └ <function Route.handle at 0x108c4ec00>
          └ APIRoute(path='/api/v1/functions/create', name='create_new_function', methods=['POST'])
  File "/Users/haruka/Desktop/open-webui-fix-deps/backend/venv/lib/python3.11/site-packages/starlette/routing.py", line 290, in handle
    await self.app(scope, receive, send)
          │    │   │      │        └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0x3125f0220>
          │    │   │      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x3125f04a0>
          │    │   └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('127.0.0.1', 8080), 'cl...
          │    └ <function request_response.<locals>.app at 0x30ef27060>
          └ APIRoute(path='/api/v1/functions/create', name='create_new_function', methods=['POST'])
  File "/Users/haruka/Desktop/open-webui-fix-deps/backend/venv/lib/python3.11/site-packages/fastapi/routing.py", line 117, in app
    await wrap_app_handling_exceptions(app, request)(scope, receive, send)
          │                            │    │        │      │        └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0x3125f0220>
          │                            │    │        │      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x3125f04a0>
          │                            │    │        └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('127.0.0.1', 8080), 'cl...
          │                            │    └ <starlette.requests.Request object at 0x30f435410>
          │                            └ <function request_response.<locals>.app.<locals>.app at 0x3125f1d00>
          └ <function wrap_app_handling_exceptions at 0x108c4d580>
  File "/Users/haruka/Desktop/open-webui-fix-deps/backend/venv/lib/python3.11/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app
    await app(scope, receive, sender)
          │   │      │        └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0x3125f1800>
          │   │      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x3125f04a0>
          │   └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('127.0.0.1', 8080), 'cl...
          └ <function request_response.<locals>.app.<locals>.app at 0x3125f1d00>
  File "/Users/haruka/Desktop/open-webui-fix-deps/backend/venv/lib/python3.11/site-packages/fastapi/routing.py", line 103, in app
    response = await f(request)
                     │ └ <starlette.requests.Request object at 0x30f435410>
                     └ <function get_request_handler.<locals>.app at 0x30ef26fc0>
  File "/Users/haruka/Desktop/open-webui-fix-deps/backend/venv/lib/python3.11/site-packages/fastapi/routing.py", line 424, in app
    raw_response = await run_endpoint_function(
                         └ <function run_endpoint_function at 0x108c64c20>
  File "/Users/haruka/Desktop/open-webui-fix-deps/backend/venv/lib/python3.11/site-packages/fastapi/routing.py", line 310, in run_endpoint_function
    return await dependant.call(**values)
                 │         │      └ {'user': UserModel(id='128acccc-e7a2-46cb-a095-0ed2f243c848', email='harukafractus@posteo.de', username=None, role='admin', n...
                 │         └ <function create_new_function at 0x308c15760>
                 └ Dependant(path_params=[], query_params=[], header_params=[], cookie_params=[], body_params=[ModelField(field_info=Body(Pydant...

> File "/Users/haruka/Desktop/open-webui-fix-deps/backend/open_webui/routers/functions.py", line 197, in create_new_function
    function_module, function_type, frontmatter = load_function_module_by_id(
                                                  └ <function load_function_module_by_id at 0x17fb807c0>

  File "/Users/haruka/Desktop/open-webui-fix-deps/backend/open_webui/utils/plugin.py", line 128, in load_function_module_by_id
    install_frontmatter_requirements(frontmatter.get("requirements", ""))
    │                                │           └ <method 'get' of 'dict' objects>
    │                                └ {'title': 'context_aware_filter', 'author': 'fractuscontext', 'author_url': 'https://github.com/fractuscontext', 'license': '...
    └ <function install_frontmatter_requirements at 0x17fb81ee0>

  File "/Users/haruka/Desktop/open-webui-fix-deps/backend/open_webui/utils/plugin.py", line 279, in install_frontmatter_requirements
    raise e

  File "/Users/haruka/Desktop/open-webui-fix-deps/backend/open_webui/utils/plugin.py", line 271, in install_frontmatter_requirements
    subprocess.check_call(
    │          └ <function check_call at 0x1051822a0>
    └ <module 'subprocess' from '/Users/haruka/.local/share/uv/python/cpython-3.11.14-macos-aarch64-none/lib/python3.11/subprocess....

  File "/Users/haruka/.local/share/uv/python/cpython-3.11.14-macos-aarch64-none/lib/python3.11/subprocess.py", line 413, in check_call
    raise CalledProcessError(retcode, cmd)
          │                  │        └ ['/Users/haruka/Desktop/open-webui-fix-deps/backend/venv/bin/python3', '-m', 'pip', 'install', 'httpx>=0.24.0']
          │                  └ 1
          └ <class 'subprocess.CalledProcessError'>

subprocess.CalledProcessError: Command '['/Users/haruka/Desktop/open-webui-fix-deps/backend/venv/bin/python3', '-m', 'pip', 'install', 'httpx>=0.24.0']' returned non-zero exit status 1.

Additional Information

It seems to caused by install_frontmatter_requirements in open_webui/utils/plugin.py (or similar loader logic) calling subprocess.check_call without verifying importlib.metadata first.

Originally created by @fractuscontext on GitHub (Jan 2, 2026). Original GitHub issue: https://github.com/open-webui/open-webui/issues/20320 ### Check Existing Issues - [x] I have searched for any existing and/or related issues. - [x] I have searched for any existing and/or related discussions. - [x] I have also searched in the CLOSED issues AND CLOSED discussions and found no related items (your issue might already be addressed on the development branch!). - [x] I am using the latest version of Open WebUI. ### Installation Method Pip Install ### Open WebUI Version v0.6.43 ### Ollama Version (if applicable) _No response_ ### Operating System macOS Seqouia ### Browser (if applicable) _No response_ ### 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 **provided every relevant configuration, setting, and environment variable used in my setup.** - [x] I have clearly **listed every relevant configuration, custom setting, environment variable, and command-line option that influences my setup** (such as Docker Compose overrides, .env values, browser settings, authentication configurations, etc). - [x] I have documented **step-by-step reproduction instructions that are precise, sequential, and leave nothing to interpretation**. My steps: - Start with the initial platform/version/OS and dependencies used, - Specify exact install/launch/configure commands, - List URLs visited, user input (incl. example values/emails/passwords if needed), - Describe all options and toggles enabled or changed, - Include any files or environmental changes, - Identify the expected and actual result at each stage, - Ensure any reasonably skilled user can follow and hit the same issue. ### Expected Behavior When loading a filter function with a `requirements` frontmatter (e.g., `requirements: httpx>=0.24.0`), the system should check if the package is already installed in the current environment. If the package exists and satisfies the version requirement, it should skip the installation process ### Actual Behavior The system unconditionally attempts to run `pip install` via `subprocess` for every requirement listed in the frontmatter, regardless of whether it is already installed. In environments managed by tools like `uv` or `nix`, shelling out to `pip` often fails (returning exit code 1) because the environment is locked or `pip` is not available in the expected path. This causes the backend to crash with a `subprocess.CalledProcessError`, even if the required package (e.g., `httpx`) is already present in site-packages. ### Steps to Reproduce 1. Setup a clean environment using uv on Python 3.11: ```bash uv venv venv --python 3.11 source .venv/bin/activate ``` 3. Install `httpx` ```bash uv pip install https==0.26 ``` 2. Launch the server: ```bash DATA_DIR=./data open-webui serve ``` 3. Import or load a Filter/Tool that has requirements in the frontmatter (e.g., `requirements: httpx>=0.24.0`), via `Admin Panel → Functions → + (Add Function) → {Paste Code}` i.e. ``` ```python """ title: Placeholder Filter author: fractuscontext version: 0.1.0 requirements: httpx>=0.24.0 # HERE!! """ from typing import Optional from pydantic import BaseModel, Field import logging # code omitted (imports) log = logging.getLogger(__name__) class Filter: class Valves(BaseModel): priority: int = Field(default=0, description="Priority level.") # code omitted (other valves) def __init__(self): self.valves = self.Valves() # code omitted (initialization logic) async def inlet( self, body: dict, __user__: Optional[dict] = None, __metadata__: Optional[dict] = None, __request__: Optional[object] = None, ) -> dict: log.info("Filter inlet triggered") # code omitted (timestamp fetching) # code omitted (filtering logic) return body async def outlet( self, body: dict, __user__: Optional[dict] = None, __metadata__: Optional[dict] = None, __request__: Optional[object] = None, ) -> dict: # code omitted (outlet logic) return body ``` 4. Error! ``` subprocess.CalledProcessError: Command '['/Users/haruka/Desktop/openwebui/.venv/bin/python3', '-m', 'pip', 'install', 'httpx>=0.24.0']' returned non-zero exit status 1. ``` ### Logs & Screenshots ``` 2026-01-02 15:11:35.743 | INFO | uvicorn.protocols.http.httptools_impl:send:476 - 127.0.0.1:50505 - "GET /api/models HTTP/1.1" 200 2026-01-02 15:11:35.767 | INFO | uvicorn.protocols.http.httptools_impl:send:476 - 127.0.0.1:50507 - "GET /api/changelog HTTP/1.1" 200 2026-01-02 15:11:35.789 | INFO | uvicorn.protocols.http.httptools_impl:send:476 - 127.0.0.1:50507 - "GET /api/v1/functions/ HTTP/1.1" 200 2026-01-02 15:11:35.814 | INFO | uvicorn.protocols.http.httptools_impl:send:476 - 127.0.0.1:50507 - "GET /api/v1/functions/list HTTP/1.1" 200 2026-01-02 15:11:36.146 | INFO | uvicorn.protocols.http.httptools_impl:send:476 - 127.0.0.1:50505 - "GET /api/version/updates HTTP/1.1" 200 2026-01-02 15:11:56.850 | INFO | uvicorn.protocols.http.httptools_impl:send:476 - 127.0.0.1:50521 - "POST /api/v1/functions/load/url HTTP/1.1" 200 2026-01-02 15:12:00.197 | INFO | uvicorn.protocols.http.httptools_impl:send:476 - 127.0.0.1:50521 - "POST /api/v1/utils/code/format HTTP/1.1" 200 2026-01-02 15:12:00.239 | INFO | open_webui.utils.plugin:install_frontmatter_requirements:270 - Installing requirements: httpx>=0.24.0 /Users/haruka/Desktop/open-webui-fix-deps/backend/venv/bin/python3: No module named pip 2026-01-02 15:12:00.334 | ERROR | open_webui.utils.plugin:install_frontmatter_requirements:278 - Error installing packages: httpx>=0.24.0 2026-01-02 15:12:00.334 | ERROR | open_webui.routers.functions:create_new_function:222 - Failed to create a new function: Command '['/Users/haruka/Desktop/open-webui-fix-deps/backend/venv/bin/python3', '-m', 'pip', 'install', 'httpx>=0.24.0']' returned non-zero exit status 1. Traceback (most recent call last): File "<string>", line 1, in <module> File "/Users/haruka/.local/share/uv/python/cpython-3.11.14-macos-aarch64-none/lib/python3.11/multiprocessing/spawn.py", line 122, in spawn_main exitcode = _main(fd, parent_sentinel) │ │ └ 4 │ └ 7 └ <function _main at 0x1051a91c0> File "/Users/haruka/.local/share/uv/python/cpython-3.11.14-macos-aarch64-none/lib/python3.11/multiprocessing/spawn.py", line 135, in _main return self._bootstrap(parent_sentinel) │ │ └ 4 │ └ <function BaseProcess._bootstrap at 0x105016a20> └ <SpawnProcess name='SpawnProcess-1' parent=5691 started> File "/Users/haruka/.local/share/uv/python/cpython-3.11.14-macos-aarch64-none/lib/python3.11/multiprocessing/process.py", line 314, in _bootstrap self.run() │ └ <function BaseProcess.run at 0x105015f80> └ <SpawnProcess name='SpawnProcess-1' parent=5691 started> File "/Users/haruka/.local/share/uv/python/cpython-3.11.14-macos-aarch64-none/lib/python3.11/multiprocessing/process.py", line 108, in run self._target(*self._args, **self._kwargs) │ │ │ │ │ └ {'config': <uvicorn.config.Config object at 0x105150990>, 'target': <bound method Server.run of <uvicorn.server.Server object... │ │ │ │ └ <SpawnProcess name='SpawnProcess-1' parent=5691 started> │ │ │ └ () │ │ └ <SpawnProcess name='SpawnProcess-1' parent=5691 started> │ └ <function subprocess_started at 0x105665300> └ <SpawnProcess name='SpawnProcess-1' parent=5691 started> File "/Users/haruka/Desktop/open-webui-fix-deps/backend/venv/lib/python3.11/site-packages/uvicorn/_subprocess.py", line 80, in subprocess_started target(sockets=sockets) │ └ [<socket.socket fd=3, family=2, type=1, proto=0, laddr=('0.0.0.0', 8080)>] └ <bound method Server.run of <uvicorn.server.Server object at 0x1058b2ad0>> File "/Users/haruka/Desktop/open-webui-fix-deps/backend/venv/lib/python3.11/site-packages/uvicorn/server.py", line 67, in run return asyncio_run(self.serve(sockets=sockets), loop_factory=self.config.get_loop_factory()) │ │ │ │ │ │ └ <function Config.get_loop_factory at 0x105613ec0> │ │ │ │ │ └ <uvicorn.config.Config object at 0x105150990> │ │ │ │ └ <uvicorn.server.Server object at 0x1058b2ad0> │ │ │ └ [<socket.socket fd=3, family=2, type=1, proto=0, laddr=('0.0.0.0', 8080)>] │ │ └ <function Server.serve at 0x105664180> │ └ <uvicorn.server.Server object at 0x1058b2ad0> └ <function asyncio_run at 0x105664040> File "/Users/haruka/Desktop/open-webui-fix-deps/backend/venv/lib/python3.11/site-packages/uvicorn/_compat.py", line 23, in asyncio_run return runner.run(main) │ │ └ <coroutine object Server.serve at 0x105011a80> │ └ <function Runner.run at 0x1052e7060> └ <asyncio.runners.Runner object at 0x10562bc10> File "/Users/haruka/.local/share/uv/python/cpython-3.11.14-macos-aarch64-none/lib/python3.11/asyncio/runners.py", line 118, in run return self._loop.run_until_complete(task) │ │ │ └ <Task pending name='Task-1' coro=<Server.serve() running at /Users/haruka/Desktop/open-webui-fix-deps/backend/venv/lib/python... │ │ └ <cyfunction Loop.run_until_complete at 0x10579ff40> │ └ <uvloop.Loop running=True closed=False debug=False> └ <asyncio.runners.Runner object at 0x10562bc10> File "/Users/haruka/Desktop/open-webui-fix-deps/backend/venv/lib/python3.11/site-packages/starlette/middleware/base.py", line 144, in coro await self.app(scope, receive_or_disconnect, send_no_error) │ │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.send_no_error at 0x3125f2de0> │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x3125f04a0> │ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('127.0.0.1', 8080), 'cl... │ └ <starlette_compress.CompressMiddleware object at 0x30f0383b0> └ <open_webui.main.RedirectMiddleware object at 0x178b0a0d0> File "/Users/haruka/Desktop/open-webui-fix-deps/backend/venv/lib/python3.11/site-packages/starlette_compress/__init__.py", line 92, in __call__ return await self._zstd(scope, receive, send) │ │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.send_no_error at 0x3125f2de0> │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x3125f04a0> │ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('127.0.0.1', 8080), 'cl... │ └ <member '_zstd' of 'CompressMiddleware' objects> └ <starlette_compress.CompressMiddleware object at 0x30f0383b0> File "/Users/haruka/Desktop/open-webui-fix-deps/backend/venv/lib/python3.11/site-packages/starlette_compress/_zstd_legacy.py", line 100, in __call__ await self.app(scope, receive, wrapper) │ │ │ │ └ <function ZstdResponder.__call__.<locals>.wrapper at 0x3125f0ae0> │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x3125f04a0> │ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('127.0.0.1', 8080), 'cl... │ └ <member 'app' of 'ZstdResponder' objects> └ <starlette_compress._zstd_legacy.ZstdResponder object at 0x30aa16880> File "/Users/haruka/Desktop/open-webui-fix-deps/backend/venv/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 63, in __call__ await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send) │ │ │ │ │ │ └ <function ZstdResponder.__call__.<locals>.wrapper at 0x3125f0ae0> │ │ │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x3125f04a0> │ │ │ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('127.0.0.1', 8080), 'cl... │ │ │ └ <starlette.requests.Request object at 0x30f508710> │ │ └ <fastapi.middleware.asyncexitstack.AsyncExitStackMiddleware object at 0x30eed7790> │ └ <starlette.middleware.exceptions.ExceptionMiddleware object at 0x30ef09410> └ <function wrap_app_handling_exceptions at 0x108c4d580> File "/Users/haruka/Desktop/open-webui-fix-deps/backend/venv/lib/python3.11/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app await app(scope, receive, sender) │ │ │ └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0x3125f0220> │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x3125f04a0> │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('127.0.0.1', 8080), 'cl... └ <fastapi.middleware.asyncexitstack.AsyncExitStackMiddleware object at 0x30eed7790> File "/Users/haruka/Desktop/open-webui-fix-deps/backend/venv/lib/python3.11/site-packages/fastapi/middleware/asyncexitstack.py", line 18, in __call__ await self.app(scope, receive, send) │ │ │ │ └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0x3125f0220> │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x3125f04a0> │ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('127.0.0.1', 8080), 'cl... │ └ <fastapi.routing.APIRouter object at 0x30aa066d0> └ <fastapi.middleware.asyncexitstack.AsyncExitStackMiddleware object at 0x30eed7790> File "/Users/haruka/Desktop/open-webui-fix-deps/backend/venv/lib/python3.11/site-packages/starlette/routing.py", line 716, in __call__ await self.middleware_stack(scope, receive, send) │ │ │ │ └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0x3125f0220> │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x3125f04a0> │ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('127.0.0.1', 8080), 'cl... │ └ <bound method Router.app of <fastapi.routing.APIRouter object at 0x30aa066d0>> └ <fastapi.routing.APIRouter object at 0x30aa066d0> File "/Users/haruka/Desktop/open-webui-fix-deps/backend/venv/lib/python3.11/site-packages/starlette/routing.py", line 736, in app await route.handle(scope, receive, send) │ │ │ │ └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0x3125f0220> │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x3125f04a0> │ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('127.0.0.1', 8080), 'cl... │ └ <function Route.handle at 0x108c4ec00> └ APIRoute(path='/api/v1/functions/create', name='create_new_function', methods=['POST']) File "/Users/haruka/Desktop/open-webui-fix-deps/backend/venv/lib/python3.11/site-packages/starlette/routing.py", line 290, in handle await self.app(scope, receive, send) │ │ │ │ └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0x3125f0220> │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x3125f04a0> │ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('127.0.0.1', 8080), 'cl... │ └ <function request_response.<locals>.app at 0x30ef27060> └ APIRoute(path='/api/v1/functions/create', name='create_new_function', methods=['POST']) File "/Users/haruka/Desktop/open-webui-fix-deps/backend/venv/lib/python3.11/site-packages/fastapi/routing.py", line 117, in app await wrap_app_handling_exceptions(app, request)(scope, receive, send) │ │ │ │ │ └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0x3125f0220> │ │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x3125f04a0> │ │ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('127.0.0.1', 8080), 'cl... │ │ └ <starlette.requests.Request object at 0x30f435410> │ └ <function request_response.<locals>.app.<locals>.app at 0x3125f1d00> └ <function wrap_app_handling_exceptions at 0x108c4d580> File "/Users/haruka/Desktop/open-webui-fix-deps/backend/venv/lib/python3.11/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app await app(scope, receive, sender) │ │ │ └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0x3125f1800> │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x3125f04a0> │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('127.0.0.1', 8080), 'cl... └ <function request_response.<locals>.app.<locals>.app at 0x3125f1d00> File "/Users/haruka/Desktop/open-webui-fix-deps/backend/venv/lib/python3.11/site-packages/fastapi/routing.py", line 103, in app response = await f(request) │ └ <starlette.requests.Request object at 0x30f435410> └ <function get_request_handler.<locals>.app at 0x30ef26fc0> File "/Users/haruka/Desktop/open-webui-fix-deps/backend/venv/lib/python3.11/site-packages/fastapi/routing.py", line 424, in app raw_response = await run_endpoint_function( └ <function run_endpoint_function at 0x108c64c20> File "/Users/haruka/Desktop/open-webui-fix-deps/backend/venv/lib/python3.11/site-packages/fastapi/routing.py", line 310, in run_endpoint_function return await dependant.call(**values) │ │ └ {'user': UserModel(id='128acccc-e7a2-46cb-a095-0ed2f243c848', email='harukafractus@posteo.de', username=None, role='admin', n... │ └ <function create_new_function at 0x308c15760> └ Dependant(path_params=[], query_params=[], header_params=[], cookie_params=[], body_params=[ModelField(field_info=Body(Pydant... > File "/Users/haruka/Desktop/open-webui-fix-deps/backend/open_webui/routers/functions.py", line 197, in create_new_function function_module, function_type, frontmatter = load_function_module_by_id( └ <function load_function_module_by_id at 0x17fb807c0> File "/Users/haruka/Desktop/open-webui-fix-deps/backend/open_webui/utils/plugin.py", line 128, in load_function_module_by_id install_frontmatter_requirements(frontmatter.get("requirements", "")) │ │ └ <method 'get' of 'dict' objects> │ └ {'title': 'context_aware_filter', 'author': 'fractuscontext', 'author_url': 'https://github.com/fractuscontext', 'license': '... └ <function install_frontmatter_requirements at 0x17fb81ee0> File "/Users/haruka/Desktop/open-webui-fix-deps/backend/open_webui/utils/plugin.py", line 279, in install_frontmatter_requirements raise e File "/Users/haruka/Desktop/open-webui-fix-deps/backend/open_webui/utils/plugin.py", line 271, in install_frontmatter_requirements subprocess.check_call( │ └ <function check_call at 0x1051822a0> └ <module 'subprocess' from '/Users/haruka/.local/share/uv/python/cpython-3.11.14-macos-aarch64-none/lib/python3.11/subprocess.... File "/Users/haruka/.local/share/uv/python/cpython-3.11.14-macos-aarch64-none/lib/python3.11/subprocess.py", line 413, in check_call raise CalledProcessError(retcode, cmd) │ │ └ ['/Users/haruka/Desktop/open-webui-fix-deps/backend/venv/bin/python3', '-m', 'pip', 'install', 'httpx>=0.24.0'] │ └ 1 └ <class 'subprocess.CalledProcessError'> subprocess.CalledProcessError: Command '['/Users/haruka/Desktop/open-webui-fix-deps/backend/venv/bin/python3', '-m', 'pip', 'install', 'httpx>=0.24.0']' returned non-zero exit status 1. ``` ### Additional Information It seems to caused by install_frontmatter_requirements in `open_webui/utils/plugin.py` (or similar loader logic) calling subprocess.check_call without verifying importlib.metadata first.
GiteaMirror added the bug label 2026-04-20 01:29:03 -05:00
Author
Owner

@owui-terminator[bot] commented on GitHub (Jan 2, 2026):

🔍 Similar Issues Found

I found some existing issues that might be related to this one. Please check if any of these are duplicates or contain helpful solutions:

  1. #20128 issue: Characters are broken in 0.6.43
    by frenzybiscuit • Dec 22, 2025 • bug

  2. #20155 issue:
    by dhaern • Dec 24, 2025 • bug

  3. #20196 issue:
    by dhaern • Dec 27, 2025 • bug

  4. #20107 issue:
    by mengdeer589 • Dec 22, 2025 • bug

  5. #19844 bug: logs truncated on crash in containerized setting, Dockerfile missing ENV PYTHONUNBUFFERED=1
    by wilson0x4d • Dec 09, 2025 • bug

Show 5 more related issues
  1. #19877 issue:
    by dotmobo • Dec 11, 2025 • bug

  2. #19777 issue:
    by Yaute7 • Dec 05, 2025 • bug

  3. #19861 issue:
    by QuitHub • Dec 10, 2025 • bug

  4. #19438 issue: Icon loading regression
    by JoelShepard • Nov 24, 2025 • bug

  5. #19211 issue:
    by Byrnes9 • Nov 16, 2025 • bug


💡 Tips:

  • If this is a duplicate, please consider closing this issue and adding any additional details to the existing one
  • If you found a solution in any of these issues, please share it here to help others

This comment was generated automatically by a bot. Please react with a 👍 if this comment was helpful, or a 👎 if it was not.

<!-- gh-comment-id:3704497483 --> @owui-terminator[bot] commented on GitHub (Jan 2, 2026): 🔍 **Similar Issues Found** I found some existing issues that might be related to this one. Please check if any of these are duplicates or contain helpful solutions: 1. [#20128](https://github.com/open-webui/open-webui/issues/20128) **issue: Characters are broken in 0.6.43** *by frenzybiscuit • Dec 22, 2025 • `bug`* 2. [#20155](https://github.com/open-webui/open-webui/issues/20155) **issue:** *by dhaern • Dec 24, 2025 • `bug`* 3. [#20196](https://github.com/open-webui/open-webui/issues/20196) **issue:** *by dhaern • Dec 27, 2025 • `bug`* 4. [#20107](https://github.com/open-webui/open-webui/issues/20107) **issue:** *by mengdeer589 • Dec 22, 2025 • `bug`* 5. [#19844](https://github.com/open-webui/open-webui/issues/19844) **bug: logs truncated on crash in containerized setting, Dockerfile missing `ENV PYTHONUNBUFFERED=1`** *by wilson0x4d • Dec 09, 2025 • `bug`* <details> <summary>Show 5 more related issues</summary> 6. [#19877](https://github.com/open-webui/open-webui/issues/19877) **issue:** *by dotmobo • Dec 11, 2025 • `bug`* 7. [#19777](https://github.com/open-webui/open-webui/issues/19777) **issue:** *by Yaute7 • Dec 05, 2025 • `bug`* 8. [#19861](https://github.com/open-webui/open-webui/issues/19861) **issue:** *by QuitHub • Dec 10, 2025 • `bug`* 9. [#19438](https://github.com/open-webui/open-webui/issues/19438) **issue: Icon loading regression** *by JoelShepard • Nov 24, 2025 • `bug`* 10. [#19211](https://github.com/open-webui/open-webui/issues/19211) **issue:** *by Byrnes9 • Nov 16, 2025 • `bug`* </details> --- 💡 **Tips:** - If this is a duplicate, please consider closing this issue and adding any additional details to the existing one - If you found a solution in any of these issues, please share it here to help others *This comment was generated automatically by a bot.* Please react with a 👍 if this comment was helpful, or a 👎 if it was not.
Author
Owner

@tjbck commented on GitHub (Jan 4, 2026):

OFFLINE_MODE introduced in dev will bypass this check!

<!-- gh-comment-id:3707918778 --> @tjbck commented on GitHub (Jan 4, 2026): `OFFLINE_MODE` introduced in dev will bypass this check!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#19149