[GH-ISSUE #16037] issue: Saving tools as a group user fails due to automatically appending "Loading click Loaded click" at the beginning #17761

Closed
opened 2026-04-19 23:38:15 -05:00 by GiteaMirror · 32 comments
Owner

Originally created by @vincent0408 on GitHub (Jul 26, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/16037

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.18

Ollama Version (if applicable)

No response

Operating System

Windows 11/Debian

Browser (if applicable)

Firefox/Edge

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 giving tools permission to group users, users should be able to simply save their tools.

Actual Behavior

It formats the code correctly, then adds "Loading click Loaded click" at the beginning.

Steps to Reproduce

  1. Create a user and assign them to a group
  2. Give workspace permissions to said group
  3. Login as the user and navigate to Tools
  4. Create a tool(default template works) and try saving
  5. The code successfully formats but "Loading click Loaded click" appears.

Logs & Screenshots

2025-07-26 13:05:31.425 | 2025-07-26 05:05:31.425 | INFO     | open_webui.utils.plugin:install_frontmatter_requirements:241 - No requirements found in frontmatter. - {}
2025-07-26 13:05:31.425 | 2025-07-26 05:05:31.425 | ERROR    | open_webui.utils.plugin:load_tool_module_by_id:111 - Error loading module: f: invalid syntax (<string>, line 1) - {}
2025-07-26 13:05:31.433 | 2025-07-26 05:05:31.431 | ERROR    | open_webui.routers.tools:create_new_tools:241 - Failed to load the tool by id f: invalid syntax (<string>, line 1) - {}
2025-07-26 13:05:31.433 | Traceback (most recent call last):
2025-07-26 13:05:31.433 | 
2025-07-26 13:05:31.433 |   File "<frozen runpy>", line 198, in _run_module_as_main
2025-07-26 13:05:31.433 |   File "<frozen runpy>", line 88, in _run_code
2025-07-26 13:05:31.433 |   File "/usr/local/lib/python3.11/site-packages/uvicorn/__main__.py", line 4, in <module>
2025-07-26 13:05:31.433 |     uvicorn.main()
2025-07-26 13:05:31.433 |     │       └ <Command main>
2025-07-26 13:05:31.433 |     └ <module 'uvicorn' from '/usr/local/lib/python3.11/site-packages/uvicorn/__init__.py'>
2025-07-26 13:05:31.433 |   File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1442, in __call__
2025-07-26 13:05:31.433 |     return self.main(*args, **kwargs)
2025-07-26 13:05:31.433 |            │    │     │       └ {}
2025-07-26 13:05:31.433 |            │    │     └ ()
2025-07-26 13:05:31.433 |            │    └ <function Command.main at 0x73ee01436ac0>
2025-07-26 13:05:31.433 |            └ <Command main>
2025-07-26 13:05:31.433 |   File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1363, in main
2025-07-26 13:05:31.433 |     rv = self.invoke(ctx)
2025-07-26 13:05:31.433 |          │    │      └ <click.core.Context object at 0x73ee021c07d0>
2025-07-26 13:05:31.433 |          │    └ <function Command.invoke at 0x73ee014367a0>
2025-07-26 13:05:31.433 |          └ <Command main>
2025-07-26 13:05:31.433 |   File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1226, in invoke
2025-07-26 13:05:31.433 |     return ctx.invoke(self.callback, **ctx.params)
2025-07-26 13:05:31.433 |            │   │      │    │           │   └ {'host': '0.0.0.0', 'port': 8080, 'forwarded_allow_ips': '*', 'workers': 1, 'app': 'open_webui.main:app', 'uds': None, 'fd': ...
2025-07-26 13:05:31.433 |            │   │      │    │           └ <click.core.Context object at 0x73ee021c07d0>
2025-07-26 13:05:31.433 |            │   │      │    └ <function main at 0x73ee010f0fe0>
2025-07-26 13:05:31.433 |            │   │      └ <Command main>
2025-07-26 13:05:31.433 |            │   └ <function Context.invoke at 0x73ee014359e0>
2025-07-26 13:05:31.433 |            └ <click.core.Context object at 0x73ee021c07d0>
2025-07-26 13:05:31.433 |   File "/usr/local/lib/python3.11/site-packages/click/core.py", line 794, in invoke
2025-07-26 13:05:31.433 |     return callback(*args, **kwargs)
2025-07-26 13:05:31.433 |            │         │       └ {'host': '0.0.0.0', 'port': 8080, 'forwarded_allow_ips': '*', 'workers': 1, 'app': 'open_webui.main:app', 'uds': None, 'fd': ...
2025-07-26 13:05:31.433 |            │         └ ()
2025-07-26 13:05:31.433 |            └ <function main at 0x73ee010f0fe0>
2025-07-26 13:05:31.433 |   File "/usr/local/lib/python3.11/site-packages/uvicorn/main.py", line 413, in main
2025-07-26 13:05:31.433 |     run(
2025-07-26 13:05:31.433 |     └ <function run at 0x73ee01517b00>
2025-07-26 13:05:31.433 |   File "/usr/local/lib/python3.11/site-packages/uvicorn/main.py", line 580, in run
2025-07-26 13:05:31.433 |     server.run()
2025-07-26 13:05:31.433 |     │      └ <function Server.run at 0x73ee0139cc20>
2025-07-26 13:05:31.433 |     └ <uvicorn.server.Server object at 0x73ee0151bdd0>
2025-07-26 13:05:31.433 |   File "/usr/local/lib/python3.11/site-packages/uvicorn/server.py", line 67, in run
2025-07-26 13:05:31.433 |     return asyncio.run(self.serve(sockets=sockets))
2025-07-26 13:05:31.433 |            │       │   │    │             └ None
2025-07-26 13:05:31.433 |            │       │   │    └ <function Server.serve at 0x73ee0139ccc0>
2025-07-26 13:05:31.433 |            │       │   └ <uvicorn.server.Server object at 0x73ee0151bdd0>
2025-07-26 13:05:31.433 |            │       └ <function run at 0x73ee01869440>
2025-07-26 13:05:31.433 |            └ <module 'asyncio' from '/usr/local/lib/python3.11/asyncio/__init__.py'>
2025-07-26 13:05:31.433 |   File "/usr/local/lib/python3.11/asyncio/runners.py", line 190, in run
2025-07-26 13:05:31.433 |     return runner.run(main)
2025-07-26 13:05:31.433 |            │      │   └ <coroutine object Server.serve at 0x73ee012b48b0>
2025-07-26 13:05:31.433 |            │      └ <function Runner.run at 0x73ee016dcfe0>
2025-07-26 13:05:31.433 |            └ <asyncio.runners.Runner object at 0x73ee010f7250>
2025-07-26 13:05:31.433 |   File "/usr/local/lib/python3.11/asyncio/runners.py", line 118, in run
2025-07-26 13:05:31.433 |     return self._loop.run_until_complete(task)
2025-07-26 13:05:31.433 |            │    │     │                  └ <Task pending name='Task-1' coro=<Server.serve() running at /usr/local/lib/python3.11/site-packages/uvicorn/server.py:71> wai...
2025-07-26 13:05:31.433 |            │    │     └ <cyfunction Loop.run_until_complete at 0x73ee010db2a0>
2025-07-26 13:05:31.433 |            │    └ <uvloop.Loop running=True closed=False debug=False>
2025-07-26 13:05:31.433 |            └ <asyncio.runners.Runner object at 0x73ee010f7250>
2025-07-26 13:05:31.433 |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 141, in coro
2025-07-26 13:05:31.433 |     await self.app(scope, receive_or_disconnect, send_no_error)
2025-07-26 13:05:31.433 |           │    │   │      │                      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.send_no_error at 0x73ed4f07e480>
2025-07-26 13:05:31.433 |           │    │   │      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x73ed4f07d580>
2025-07-26 13:05:31.433 |           │    │   └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.17.0.2', 8080), 'c...
2025-07-26 13:05:31.433 |           │    └ <starlette_compress.CompressMiddleware object at 0x73ee01121120>
2025-07-26 13:05:31.433 |           └ <open_webui.main.RedirectMiddleware object at 0x73ed4fcc4f10>
2025-07-26 13:05:31.433 |   File "/usr/local/lib/python3.11/site-packages/starlette_compress/__init__.py", line 92, in __call__
2025-07-26 13:05:31.433 |     return await self._zstd(scope, receive, send)
2025-07-26 13:05:31.433 |                  │    │     │      │        └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.send_no_error at 0x73ed4f07e480>
2025-07-26 13:05:31.433 |                  │    │     │      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x73ed4f07d580>
2025-07-26 13:05:31.433 |                  │    │     └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.17.0.2', 8080), 'c...
2025-07-26 13:05:31.433 |                  │    └ <member '_zstd' of 'CompressMiddleware' objects>
2025-07-26 13:05:31.433 |                  └ <starlette_compress.CompressMiddleware object at 0x73ee01121120>
2025-07-26 13:05:31.433 |   File "/usr/local/lib/python3.11/site-packages/starlette_compress/_zstd_legacy.py", line 100, in __call__
2025-07-26 13:05:31.433 |     await self.app(scope, receive, wrapper)
2025-07-26 13:05:31.433 |           │    │   │      │        └ <function ZstdResponder.__call__.<locals>.wrapper at 0x73ed4f07fba0>
2025-07-26 13:05:31.433 |           │    │   │      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x73ed4f07d580>
2025-07-26 13:05:31.433 |           │    │   └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.17.0.2', 8080), 'c...
2025-07-26 13:05:31.433 |           │    └ <member 'app' of 'ZstdResponder' objects>
2025-07-26 13:05:31.433 |           └ <starlette_compress._zstd_legacy.ZstdResponder object at 0x73ed4f80db40>
2025-07-26 13:05:31.433 |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 62, in __call__
2025-07-26 13:05:31.433 |     await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
2025-07-26 13:05:31.433 |           │                            │    │    │     │      │        └ <function ZstdResponder.__call__.<locals>.wrapper at 0x73ed4f07fba0>
2025-07-26 13:05:31.433 |           │                            │    │    │     │      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x73ed4f07d580>
2025-07-26 13:05:31.433 |           │                            │    │    │     └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.17.0.2', 8080), 'c...
2025-07-26 13:05:31.433 |           │                            │    │    └ <starlette.requests.Request object at 0x73ed4f091990>
2025-07-26 13:05:31.433 |           │                            │    └ <fastapi.routing.APIRouter object at 0x73eda2ba2790>
2025-07-26 13:05:31.433 |           │                            └ <starlette.middleware.exceptions.ExceptionMiddleware object at 0x73ed4fb46e90>
2025-07-26 13:05:31.433 |           └ <function wrap_app_handling_exceptions at 0x73edfe765bc0>
2025-07-26 13:05:31.433 |   File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app
2025-07-26 13:05:31.433 |     await app(scope, receive, sender)
2025-07-26 13:05:31.433 |           │   │      │        └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0x73ed4f595620>
2025-07-26 13:05:31.433 |           │   │      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x73ed4f07d580>
2025-07-26 13:05:31.433 |           │   └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.17.0.2', 8080), 'c...
2025-07-26 13:05:31.433 |           └ <fastapi.routing.APIRouter object at 0x73eda2ba2790>
2025-07-26 13:05:31.433 |   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 715, in __call__
2025-07-26 13:05:31.433 |     await self.middleware_stack(scope, receive, send)
2025-07-26 13:05:31.433 |           │    │                │      │        └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0x73ed4f595620>
2025-07-26 13:05:31.433 |           │    │                │      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x73ed4f07d580>
2025-07-26 13:05:31.433 |           │    │                └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.17.0.2', 8080), 'c...
2025-07-26 13:05:31.433 |           │    └ <bound method Router.app of <fastapi.routing.APIRouter object at 0x73eda2ba2790>>
2025-07-26 13:05:31.433 |           └ <fastapi.routing.APIRouter object at 0x73eda2ba2790>
2025-07-26 13:05:31.433 |   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 735, in app
2025-07-26 13:05:31.433 |     await route.handle(scope, receive, send)
2025-07-26 13:05:31.433 |           │     │      │      │        └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0x73ed4f595620>
2025-07-26 13:05:31.433 |           │     │      │      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x73ed4f07d580>
2025-07-26 13:05:31.433 |           │     │      └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.17.0.2', 8080), 'c...
2025-07-26 13:05:31.433 |           │     └ <function Route.handle at 0x73edfe767240>
2025-07-26 13:05:31.433 |           └ APIRoute(path='/api/v1/tools/create', name='create_new_tools', methods=['POST'])
2025-07-26 13:05:31.433 |   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 288, in handle
2025-07-26 13:05:31.433 |     await self.app(scope, receive, send)
2025-07-26 13:05:31.433 |           │    │   │      │        └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0x73ed4f595620>
2025-07-26 13:05:31.433 |           │    │   │      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x73ed4f07d580>
2025-07-26 13:05:31.433 |           │    │   └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.17.0.2', 8080), 'c...
2025-07-26 13:05:31.433 |           │    └ <function request_response.<locals>.app at 0x73ed4fa332e0>
2025-07-26 13:05:31.433 |           └ APIRoute(path='/api/v1/tools/create', name='create_new_tools', methods=['POST'])
2025-07-26 13:05:31.433 |   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 76, in app
2025-07-26 13:05:31.433 |     await wrap_app_handling_exceptions(app, request)(scope, receive, send)
2025-07-26 13:05:31.433 |           │                            │    │        │      │        └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0x73ed4f595620>
2025-07-26 13:05:31.433 |           │                            │    │        │      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x73ed4f07d580>
2025-07-26 13:05:31.433 |           │                            │    │        └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.17.0.2', 8080), 'c...
2025-07-26 13:05:31.433 |           │                            │    └ <starlette.requests.Request object at 0x73ed4f3e4fd0>
2025-07-26 13:05:31.433 |           │                            └ <function request_response.<locals>.app.<locals>.app at 0x73ed4f5963e0>
2025-07-26 13:05:31.433 |           └ <function wrap_app_handling_exceptions at 0x73edfe765bc0>
2025-07-26 13:05:31.433 |   File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app
2025-07-26 13:05:31.433 |     await app(scope, receive, sender)
2025-07-26 13:05:31.433 |           │   │      │        └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0x73ed4f596e80>
2025-07-26 13:05:31.433 |           │   │      └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x73ed4f07d580>
2025-07-26 13:05:31.433 |           │   └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.17.0.2', 8080), 'c...
2025-07-26 13:05:31.433 |           └ <function request_response.<locals>.app.<locals>.app at 0x73ed4f5963e0>
2025-07-26 13:05:31.433 |   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 73, in app
2025-07-26 13:05:31.433 |     response = await f(request)
2025-07-26 13:05:31.433 |                      │ └ <starlette.requests.Request object at 0x73ed4f3e4fd0>
2025-07-26 13:05:31.433 |                      └ <function get_request_handler.<locals>.app at 0x73ed4fa33100>
2025-07-26 13:05:31.433 |   File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 301, in app
2025-07-26 13:05:31.433 |     raw_response = await run_endpoint_function(
2025-07-26 13:05:31.433 |                          └ <function run_endpoint_function at 0x73edfe6f5080>
2025-07-26 13:05:31.433 |   File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 212, in run_endpoint_function
2025-07-26 13:05:31.433 |     return await dependant.call(**values)
2025-07-26 13:05:31.433 |                  │         │      └ {'user': UserModel(id='d8256140-1e0c-4946-a6e1-b8b4f38d9c53', name='user1', email='user1@fake.com', role='user', profile_imag...
2025-07-26 13:05:31.433 |                  │         └ <function create_new_tools at 0x73eda91c42c0>
2025-07-26 13:05:31.433 |                  └ Dependant(path_params=[], query_params=[], header_params=[], cookie_params=[], body_params=[ModelField(field_info=Body(Pydant...
2025-07-26 13:05:31.433 | 
2025-07-26 13:05:31.433 | > File "/app/backend/open_webui/routers/tools.py", line 219, in create_new_tools
2025-07-26 13:05:31.433 |     tool_module, frontmatter = load_tool_module_by_id(
2025-07-26 13:05:31.433 |                                └ <function load_tool_module_by_id at 0x73eda9932de0>
2025-07-26 13:05:31.433 | 
2025-07-26 13:05:31.433 |   File "/app/backend/open_webui/utils/plugin.py", line 113, in load_tool_module_by_id
2025-07-26 13:05:31.433 |     raise e
2025-07-26 13:05:31.433 | 
2025-07-26 13:05:31.433 |   File "/app/backend/open_webui/utils/plugin.py", line 101, in load_tool_module_by_id
2025-07-26 13:05:31.433 |     exec(content, module.__dict__)
2025-07-26 13:05:31.433 |          │        │      └ <member '__dict__' of 'module' objects>
2025-07-26 13:05:31.433 |          │        └ <module 'tool_f' from '/tmp/tmpo6ozn3vs'>
2025-07-26 13:05:31.433 |          └ 'Loading click\nLoaded click\nimport os\nimport requests\nfrom datetime import datetime\nfrom pydantic import BaseModel, Fiel...
2025-07-26 13:05:31.433 | 
2025-07-26 13:05:31.433 |   File "<string>", line 1
2025-07-26 13:05:31.433 |     Loading click
2025-07-26 13:05:31.433 |             ^^^^^
2025-07-26 13:05:31.433 | 
2025-07-26 13:05:31.433 | SyntaxError: invalid syntax

Additional Information

Image
Originally created by @vincent0408 on GitHub (Jul 26, 2025). Original GitHub issue: https://github.com/open-webui/open-webui/issues/16037 ### 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.18 ### Ollama Version (if applicable) _No response_ ### Operating System Windows 11/Debian ### Browser (if applicable) Firefox/Edge ### 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 giving tools permission to group users, users should be able to simply save their tools. ### Actual Behavior It formats the code correctly, then adds "Loading click Loaded click" at the beginning. ### Steps to Reproduce 1. Create a user and assign them to a group 2. Give workspace permissions to said group 3. Login as the user and navigate to Tools 4. Create a tool(default template works) and try saving 5. The code successfully formats but "Loading click Loaded click" appears. ### Logs & Screenshots ``` 2025-07-26 13:05:31.425 | 2025-07-26 05:05:31.425 | INFO | open_webui.utils.plugin:install_frontmatter_requirements:241 - No requirements found in frontmatter. - {} 2025-07-26 13:05:31.425 | 2025-07-26 05:05:31.425 | ERROR | open_webui.utils.plugin:load_tool_module_by_id:111 - Error loading module: f: invalid syntax (<string>, line 1) - {} 2025-07-26 13:05:31.433 | 2025-07-26 05:05:31.431 | ERROR | open_webui.routers.tools:create_new_tools:241 - Failed to load the tool by id f: invalid syntax (<string>, line 1) - {} 2025-07-26 13:05:31.433 | Traceback (most recent call last): 2025-07-26 13:05:31.433 | 2025-07-26 13:05:31.433 | File "<frozen runpy>", line 198, in _run_module_as_main 2025-07-26 13:05:31.433 | File "<frozen runpy>", line 88, in _run_code 2025-07-26 13:05:31.433 | File "/usr/local/lib/python3.11/site-packages/uvicorn/__main__.py", line 4, in <module> 2025-07-26 13:05:31.433 | uvicorn.main() 2025-07-26 13:05:31.433 | │ └ <Command main> 2025-07-26 13:05:31.433 | └ <module 'uvicorn' from '/usr/local/lib/python3.11/site-packages/uvicorn/__init__.py'> 2025-07-26 13:05:31.433 | File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1442, in __call__ 2025-07-26 13:05:31.433 | return self.main(*args, **kwargs) 2025-07-26 13:05:31.433 | │ │ │ └ {} 2025-07-26 13:05:31.433 | │ │ └ () 2025-07-26 13:05:31.433 | │ └ <function Command.main at 0x73ee01436ac0> 2025-07-26 13:05:31.433 | └ <Command main> 2025-07-26 13:05:31.433 | File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1363, in main 2025-07-26 13:05:31.433 | rv = self.invoke(ctx) 2025-07-26 13:05:31.433 | │ │ └ <click.core.Context object at 0x73ee021c07d0> 2025-07-26 13:05:31.433 | │ └ <function Command.invoke at 0x73ee014367a0> 2025-07-26 13:05:31.433 | └ <Command main> 2025-07-26 13:05:31.433 | File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1226, in invoke 2025-07-26 13:05:31.433 | return ctx.invoke(self.callback, **ctx.params) 2025-07-26 13:05:31.433 | │ │ │ │ │ └ {'host': '0.0.0.0', 'port': 8080, 'forwarded_allow_ips': '*', 'workers': 1, 'app': 'open_webui.main:app', 'uds': None, 'fd': ... 2025-07-26 13:05:31.433 | │ │ │ │ └ <click.core.Context object at 0x73ee021c07d0> 2025-07-26 13:05:31.433 | │ │ │ └ <function main at 0x73ee010f0fe0> 2025-07-26 13:05:31.433 | │ │ └ <Command main> 2025-07-26 13:05:31.433 | │ └ <function Context.invoke at 0x73ee014359e0> 2025-07-26 13:05:31.433 | └ <click.core.Context object at 0x73ee021c07d0> 2025-07-26 13:05:31.433 | File "/usr/local/lib/python3.11/site-packages/click/core.py", line 794, in invoke 2025-07-26 13:05:31.433 | return callback(*args, **kwargs) 2025-07-26 13:05:31.433 | │ │ └ {'host': '0.0.0.0', 'port': 8080, 'forwarded_allow_ips': '*', 'workers': 1, 'app': 'open_webui.main:app', 'uds': None, 'fd': ... 2025-07-26 13:05:31.433 | │ └ () 2025-07-26 13:05:31.433 | └ <function main at 0x73ee010f0fe0> 2025-07-26 13:05:31.433 | File "/usr/local/lib/python3.11/site-packages/uvicorn/main.py", line 413, in main 2025-07-26 13:05:31.433 | run( 2025-07-26 13:05:31.433 | └ <function run at 0x73ee01517b00> 2025-07-26 13:05:31.433 | File "/usr/local/lib/python3.11/site-packages/uvicorn/main.py", line 580, in run 2025-07-26 13:05:31.433 | server.run() 2025-07-26 13:05:31.433 | │ └ <function Server.run at 0x73ee0139cc20> 2025-07-26 13:05:31.433 | └ <uvicorn.server.Server object at 0x73ee0151bdd0> 2025-07-26 13:05:31.433 | File "/usr/local/lib/python3.11/site-packages/uvicorn/server.py", line 67, in run 2025-07-26 13:05:31.433 | return asyncio.run(self.serve(sockets=sockets)) 2025-07-26 13:05:31.433 | │ │ │ │ └ None 2025-07-26 13:05:31.433 | │ │ │ └ <function Server.serve at 0x73ee0139ccc0> 2025-07-26 13:05:31.433 | │ │ └ <uvicorn.server.Server object at 0x73ee0151bdd0> 2025-07-26 13:05:31.433 | │ └ <function run at 0x73ee01869440> 2025-07-26 13:05:31.433 | └ <module 'asyncio' from '/usr/local/lib/python3.11/asyncio/__init__.py'> 2025-07-26 13:05:31.433 | File "/usr/local/lib/python3.11/asyncio/runners.py", line 190, in run 2025-07-26 13:05:31.433 | return runner.run(main) 2025-07-26 13:05:31.433 | │ │ └ <coroutine object Server.serve at 0x73ee012b48b0> 2025-07-26 13:05:31.433 | │ └ <function Runner.run at 0x73ee016dcfe0> 2025-07-26 13:05:31.433 | └ <asyncio.runners.Runner object at 0x73ee010f7250> 2025-07-26 13:05:31.433 | File "/usr/local/lib/python3.11/asyncio/runners.py", line 118, in run 2025-07-26 13:05:31.433 | return self._loop.run_until_complete(task) 2025-07-26 13:05:31.433 | │ │ │ └ <Task pending name='Task-1' coro=<Server.serve() running at /usr/local/lib/python3.11/site-packages/uvicorn/server.py:71> wai... 2025-07-26 13:05:31.433 | │ │ └ <cyfunction Loop.run_until_complete at 0x73ee010db2a0> 2025-07-26 13:05:31.433 | │ └ <uvloop.Loop running=True closed=False debug=False> 2025-07-26 13:05:31.433 | └ <asyncio.runners.Runner object at 0x73ee010f7250> 2025-07-26 13:05:31.433 | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/base.py", line 141, in coro 2025-07-26 13:05:31.433 | await self.app(scope, receive_or_disconnect, send_no_error) 2025-07-26 13:05:31.433 | │ │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.send_no_error at 0x73ed4f07e480> 2025-07-26 13:05:31.433 | │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x73ed4f07d580> 2025-07-26 13:05:31.433 | │ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.17.0.2', 8080), 'c... 2025-07-26 13:05:31.433 | │ └ <starlette_compress.CompressMiddleware object at 0x73ee01121120> 2025-07-26 13:05:31.433 | └ <open_webui.main.RedirectMiddleware object at 0x73ed4fcc4f10> 2025-07-26 13:05:31.433 | File "/usr/local/lib/python3.11/site-packages/starlette_compress/__init__.py", line 92, in __call__ 2025-07-26 13:05:31.433 | return await self._zstd(scope, receive, send) 2025-07-26 13:05:31.433 | │ │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.send_no_error at 0x73ed4f07e480> 2025-07-26 13:05:31.433 | │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x73ed4f07d580> 2025-07-26 13:05:31.433 | │ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.17.0.2', 8080), 'c... 2025-07-26 13:05:31.433 | │ └ <member '_zstd' of 'CompressMiddleware' objects> 2025-07-26 13:05:31.433 | └ <starlette_compress.CompressMiddleware object at 0x73ee01121120> 2025-07-26 13:05:31.433 | File "/usr/local/lib/python3.11/site-packages/starlette_compress/_zstd_legacy.py", line 100, in __call__ 2025-07-26 13:05:31.433 | await self.app(scope, receive, wrapper) 2025-07-26 13:05:31.433 | │ │ │ │ └ <function ZstdResponder.__call__.<locals>.wrapper at 0x73ed4f07fba0> 2025-07-26 13:05:31.433 | │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x73ed4f07d580> 2025-07-26 13:05:31.433 | │ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.17.0.2', 8080), 'c... 2025-07-26 13:05:31.433 | │ └ <member 'app' of 'ZstdResponder' objects> 2025-07-26 13:05:31.433 | └ <starlette_compress._zstd_legacy.ZstdResponder object at 0x73ed4f80db40> 2025-07-26 13:05:31.433 | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 62, in __call__ 2025-07-26 13:05:31.433 | await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send) 2025-07-26 13:05:31.433 | │ │ │ │ │ │ └ <function ZstdResponder.__call__.<locals>.wrapper at 0x73ed4f07fba0> 2025-07-26 13:05:31.433 | │ │ │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x73ed4f07d580> 2025-07-26 13:05:31.433 | │ │ │ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.17.0.2', 8080), 'c... 2025-07-26 13:05:31.433 | │ │ │ └ <starlette.requests.Request object at 0x73ed4f091990> 2025-07-26 13:05:31.433 | │ │ └ <fastapi.routing.APIRouter object at 0x73eda2ba2790> 2025-07-26 13:05:31.433 | │ └ <starlette.middleware.exceptions.ExceptionMiddleware object at 0x73ed4fb46e90> 2025-07-26 13:05:31.433 | └ <function wrap_app_handling_exceptions at 0x73edfe765bc0> 2025-07-26 13:05:31.433 | File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app 2025-07-26 13:05:31.433 | await app(scope, receive, sender) 2025-07-26 13:05:31.433 | │ │ │ └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0x73ed4f595620> 2025-07-26 13:05:31.433 | │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x73ed4f07d580> 2025-07-26 13:05:31.433 | │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.17.0.2', 8080), 'c... 2025-07-26 13:05:31.433 | └ <fastapi.routing.APIRouter object at 0x73eda2ba2790> 2025-07-26 13:05:31.433 | File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 715, in __call__ 2025-07-26 13:05:31.433 | await self.middleware_stack(scope, receive, send) 2025-07-26 13:05:31.433 | │ │ │ │ └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0x73ed4f595620> 2025-07-26 13:05:31.433 | │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x73ed4f07d580> 2025-07-26 13:05:31.433 | │ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.17.0.2', 8080), 'c... 2025-07-26 13:05:31.433 | │ └ <bound method Router.app of <fastapi.routing.APIRouter object at 0x73eda2ba2790>> 2025-07-26 13:05:31.433 | └ <fastapi.routing.APIRouter object at 0x73eda2ba2790> 2025-07-26 13:05:31.433 | File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 735, in app 2025-07-26 13:05:31.433 | await route.handle(scope, receive, send) 2025-07-26 13:05:31.433 | │ │ │ │ └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0x73ed4f595620> 2025-07-26 13:05:31.433 | │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x73ed4f07d580> 2025-07-26 13:05:31.433 | │ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.17.0.2', 8080), 'c... 2025-07-26 13:05:31.433 | │ └ <function Route.handle at 0x73edfe767240> 2025-07-26 13:05:31.433 | └ APIRoute(path='/api/v1/tools/create', name='create_new_tools', methods=['POST']) 2025-07-26 13:05:31.433 | File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 288, in handle 2025-07-26 13:05:31.433 | await self.app(scope, receive, send) 2025-07-26 13:05:31.433 | │ │ │ │ └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0x73ed4f595620> 2025-07-26 13:05:31.433 | │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x73ed4f07d580> 2025-07-26 13:05:31.433 | │ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.17.0.2', 8080), 'c... 2025-07-26 13:05:31.433 | │ └ <function request_response.<locals>.app at 0x73ed4fa332e0> 2025-07-26 13:05:31.433 | └ APIRoute(path='/api/v1/tools/create', name='create_new_tools', methods=['POST']) 2025-07-26 13:05:31.433 | File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 76, in app 2025-07-26 13:05:31.433 | await wrap_app_handling_exceptions(app, request)(scope, receive, send) 2025-07-26 13:05:31.433 | │ │ │ │ │ └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0x73ed4f595620> 2025-07-26 13:05:31.433 | │ │ │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x73ed4f07d580> 2025-07-26 13:05:31.433 | │ │ │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.17.0.2', 8080), 'c... 2025-07-26 13:05:31.433 | │ │ └ <starlette.requests.Request object at 0x73ed4f3e4fd0> 2025-07-26 13:05:31.433 | │ └ <function request_response.<locals>.app.<locals>.app at 0x73ed4f5963e0> 2025-07-26 13:05:31.433 | └ <function wrap_app_handling_exceptions at 0x73edfe765bc0> 2025-07-26 13:05:31.433 | File "/usr/local/lib/python3.11/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app 2025-07-26 13:05:31.433 | await app(scope, receive, sender) 2025-07-26 13:05:31.433 | │ │ │ └ <function wrap_app_handling_exceptions.<locals>.wrapped_app.<locals>.sender at 0x73ed4f596e80> 2025-07-26 13:05:31.433 | │ │ └ <function BaseHTTPMiddleware.__call__.<locals>.call_next.<locals>.receive_or_disconnect at 0x73ed4f07d580> 2025-07-26 13:05:31.433 | │ └ {'type': 'http', 'asgi': {'version': '3.0', 'spec_version': '2.3'}, 'http_version': '1.1', 'server': ('172.17.0.2', 8080), 'c... 2025-07-26 13:05:31.433 | └ <function request_response.<locals>.app.<locals>.app at 0x73ed4f5963e0> 2025-07-26 13:05:31.433 | File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 73, in app 2025-07-26 13:05:31.433 | response = await f(request) 2025-07-26 13:05:31.433 | │ └ <starlette.requests.Request object at 0x73ed4f3e4fd0> 2025-07-26 13:05:31.433 | └ <function get_request_handler.<locals>.app at 0x73ed4fa33100> 2025-07-26 13:05:31.433 | File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 301, in app 2025-07-26 13:05:31.433 | raw_response = await run_endpoint_function( 2025-07-26 13:05:31.433 | └ <function run_endpoint_function at 0x73edfe6f5080> 2025-07-26 13:05:31.433 | File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 212, in run_endpoint_function 2025-07-26 13:05:31.433 | return await dependant.call(**values) 2025-07-26 13:05:31.433 | │ │ └ {'user': UserModel(id='d8256140-1e0c-4946-a6e1-b8b4f38d9c53', name='user1', email='user1@fake.com', role='user', profile_imag... 2025-07-26 13:05:31.433 | │ └ <function create_new_tools at 0x73eda91c42c0> 2025-07-26 13:05:31.433 | └ Dependant(path_params=[], query_params=[], header_params=[], cookie_params=[], body_params=[ModelField(field_info=Body(Pydant... 2025-07-26 13:05:31.433 | 2025-07-26 13:05:31.433 | > File "/app/backend/open_webui/routers/tools.py", line 219, in create_new_tools 2025-07-26 13:05:31.433 | tool_module, frontmatter = load_tool_module_by_id( 2025-07-26 13:05:31.433 | └ <function load_tool_module_by_id at 0x73eda9932de0> 2025-07-26 13:05:31.433 | 2025-07-26 13:05:31.433 | File "/app/backend/open_webui/utils/plugin.py", line 113, in load_tool_module_by_id 2025-07-26 13:05:31.433 | raise e 2025-07-26 13:05:31.433 | 2025-07-26 13:05:31.433 | File "/app/backend/open_webui/utils/plugin.py", line 101, in load_tool_module_by_id 2025-07-26 13:05:31.433 | exec(content, module.__dict__) 2025-07-26 13:05:31.433 | │ │ └ <member '__dict__' of 'module' objects> 2025-07-26 13:05:31.433 | │ └ <module 'tool_f' from '/tmp/tmpo6ozn3vs'> 2025-07-26 13:05:31.433 | └ 'Loading click\nLoaded click\nimport os\nimport requests\nfrom datetime import datetime\nfrom pydantic import BaseModel, Fiel... 2025-07-26 13:05:31.433 | 2025-07-26 13:05:31.433 | File "<string>", line 1 2025-07-26 13:05:31.433 | Loading click 2025-07-26 13:05:31.433 | ^^^^^ 2025-07-26 13:05:31.433 | 2025-07-26 13:05:31.433 | SyntaxError: invalid syntax ``` ### Additional Information <img width="1510" height="326" alt="Image" src="https://github.com/user-attachments/assets/a5b79687-8e51-439e-b7ae-51669c9aedd8" />
GiteaMirror added the bug label 2026-04-19 23:38:15 -05:00
Author
Owner

@rgaricano commented on GitHub (Jul 26, 2025):

It's not related to users or groups; the problem is due to an incorrect import, which for some reason introduced informational tags used in the import process into the temporary file (used to add the tool/feature).
Probably due to some kind of connection/transmission error.

Does this always happen, or does it disappear if you retry the tool import?

<!-- gh-comment-id:3121591624 --> @rgaricano commented on GitHub (Jul 26, 2025): It's not related to users or groups; the problem is due to an incorrect import, which for some reason introduced informational tags used in the import process into the temporary file (used to add the tool/feature). Probably due to some kind of connection/transmission error. Does this always happen, or does it disappear if you retry the tool import?
Author
Owner

@vincent0408 commented on GitHub (Jul 26, 2025):

It does not occur when saving tool scripts as admin, and since by default users are not allowed to access workspace, I specified group user to avoid confusion. It happens to any tool script even the default one, and as for now I cannot find a method to remove the error other than promoting the user to be an admin.

<!-- gh-comment-id:3121610970 --> @vincent0408 commented on GitHub (Jul 26, 2025): It does not occur when saving tool scripts as admin, and since by default users are not allowed to access workspace, I specified group user to avoid confusion. It happens to any tool script even the default one, and as for now I cannot find a method to remove the error other than promoting the user to be an admin.
Author
Owner

@rgaricano commented on GitHub (Jul 26, 2025):

But when did this happen? By importing the tool from https://openwebui.com or by copying/pasting?
are you tried editing and removing those lines manually?

<!-- gh-comment-id:3121615558 --> @rgaricano commented on GitHub (Jul 26, 2025): But when did this happen? By importing the tool from https://openwebui.com or by copying/pasting? are you tried editing and removing those lines manually?
Author
Owner

@vincent0408 commented on GitHub (Jul 26, 2025):

It is reproducible when saving the default tool script template, that is:
Press + in Tools, type sth in title and description, save. Tested on Windows and (offline)Debian.
Removing manually was the first thing I did, the two lines came back automatically.

<!-- gh-comment-id:3121621943 --> @vincent0408 commented on GitHub (Jul 26, 2025): It is reproducible when saving the **default tool script template**, that is: Press + in Tools, type sth in title and description, save. Tested on Windows and (offline)Debian. Removing manually was the first thing I did, the two lines came back automatically.
Author
Owner

@rgaricano commented on GitHub (Jul 26, 2025):

Confirmed,
(adding tool just with default content, without add any content)
the error arise because when any content is added it try to add the content of the tool from a temporary tool file (previous ones, not related with default)....,
it's necessary recheck the logic in the tool create process.

(before try to add the default content I tried to import &| copy paste other tool & I named test1, in that case if don't do nothing, any message, any tool added, but temp file is there)

Jul 26 13:05:31 startssh.sh[137696]: SyntaxError: invalid syntax
Jul 26 13:05:31 startssh.sh[137696]:             ^^^^^
Jul 26 13:05:31 startssh.sh[137696]:     Loading click
Jul 26 13:05:31 startssh.sh[137696]:   File "<string>", line 1
Jul 26 13:05:31 startssh.sh[137696]:          └ 'Loading click\nLoaded click\n"""\ntitle: Model Web Search Enabler\nid: base_model_web_search_Enabler\ndescription: Enables w...
Jul 26 13:05:31 startssh.sh[137696]:          │        └ <module 'tool_test1' from '/tmp/tmpw4hm7s0c'>
Jul 26 13:05:31 startssh.sh[137696]:          │        │      └ <member '__dict__' of 'module' objects>
Jul 26 13:05:31 startssh.sh[137696]:     exec(content, module.__dict__)
Jul 26 13:05:31 startssh.sh[137696]:   File "/mnt/IAI/open-webui/backend/open_webui/utils/plugin.py", line 101, in load_tool_module_by_id
Jul 26 13:05:31 startssh.sh[137696]:     raise e
Jul 26 13:05:31 startssh.sh[137696]:   File "/mnt/IAI/open-webui/backend/open_webui/utils/plugin.py", line 113, in load_tool_module_by_id
Jul 26 13:05:31 startssh.sh[137696]:                                └ <function load_tool_module_by_id at 0x7e50286df380>
Jul 26 13:05:31 startssh.sh[137696]:     tool_module, frontmatter = load_tool_module_by_id(
Jul 26 13:05:31 startssh.sh[137696]: > File "/mnt/IAI/open-webui/backend/open_webui/routers/tools.py", line 219, in create_new_tools
Jul 26 13:05:31 startssh.sh[137696]:                  └ Dependant(path_params=[], query_params=[], header_params=[], cookie_params=[], body_params=[ModelField(field_info=Body(Pydant...
Jul 26 13:05:31 startssh.sh[137696]:                  │         └ <function create_new_tools at 0x7e5027f34a40>
Jul 26 13:05:31 startssh.sh[137696]:                  │         │      └ {'user': UserModel(id='5d7c457a-3e07-4fde-83d2-6d906d770470', name='Ricardo', email='rgaricano@hotmail.com', role='user', pro...
Jul 26 13:05:31 startssh.sh[137696]:     return await dependant.call(**values)
<!-- gh-comment-id:3121637217 --> @rgaricano commented on GitHub (Jul 26, 2025): Confirmed, (adding tool just with default content, without add any content) the error arise because when any content is added it try to add the content of the tool from a temporary tool file (previous ones, not related with default)...., **it's necessary recheck the logic in the tool create process.** (before try to add the default content I tried to import &| copy paste other tool & I named test1, in that case if don't do nothing, any message, any tool added, but temp file is there) ``` Jul 26 13:05:31 startssh.sh[137696]: SyntaxError: invalid syntax Jul 26 13:05:31 startssh.sh[137696]: ^^^^^ Jul 26 13:05:31 startssh.sh[137696]: Loading click Jul 26 13:05:31 startssh.sh[137696]: File "<string>", line 1 Jul 26 13:05:31 startssh.sh[137696]: └ 'Loading click\nLoaded click\n"""\ntitle: Model Web Search Enabler\nid: base_model_web_search_Enabler\ndescription: Enables w... Jul 26 13:05:31 startssh.sh[137696]: │ └ <module 'tool_test1' from '/tmp/tmpw4hm7s0c'> Jul 26 13:05:31 startssh.sh[137696]: │ │ └ <member '__dict__' of 'module' objects> Jul 26 13:05:31 startssh.sh[137696]: exec(content, module.__dict__) Jul 26 13:05:31 startssh.sh[137696]: File "/mnt/IAI/open-webui/backend/open_webui/utils/plugin.py", line 101, in load_tool_module_by_id Jul 26 13:05:31 startssh.sh[137696]: raise e Jul 26 13:05:31 startssh.sh[137696]: File "/mnt/IAI/open-webui/backend/open_webui/utils/plugin.py", line 113, in load_tool_module_by_id Jul 26 13:05:31 startssh.sh[137696]: └ <function load_tool_module_by_id at 0x7e50286df380> Jul 26 13:05:31 startssh.sh[137696]: tool_module, frontmatter = load_tool_module_by_id( Jul 26 13:05:31 startssh.sh[137696]: > File "/mnt/IAI/open-webui/backend/open_webui/routers/tools.py", line 219, in create_new_tools Jul 26 13:05:31 startssh.sh[137696]: └ Dependant(path_params=[], query_params=[], header_params=[], cookie_params=[], body_params=[ModelField(field_info=Body(Pydant... Jul 26 13:05:31 startssh.sh[137696]: │ └ <function create_new_tools at 0x7e5027f34a40> Jul 26 13:05:31 startssh.sh[137696]: │ │ └ {'user': UserModel(id='5d7c457a-3e07-4fde-83d2-6d906d770470', name='Ricardo', email='rgaricano@hotmail.com', role='user', pro... Jul 26 13:05:31 startssh.sh[137696]: return await dependant.call(**values) ```
Author
Owner

@vincent0408 commented on GitHub (Jul 26, 2025):

Would be interesting to know why admins can save properly, from the context I'm guessing admins have r/w control over the temp file but users may lack required permissions?
Also, as a group user the import function is not there, hence I never got the chance to try it.

Image
<!-- gh-comment-id:3121654371 --> @vincent0408 commented on GitHub (Jul 26, 2025): Would be interesting to know why admins can save properly, from the context I'm guessing admins have r/w control over the temp file but users may lack required permissions? Also, as a group user the import function is not there, hence I never got the chance to try it. <img width="1890" height="886" alt="Image" src="https://github.com/user-attachments/assets/83f7f43d-6200-4f5b-8f1a-8c0d782fdae6" />
Author
Owner

@rgaricano commented on GitHub (Jul 26, 2025):

I deleted the update because I make a mistake: i tried with admin account... the error still there.

<!-- gh-comment-id:3121664405 --> @rgaricano commented on GitHub (Jul 26, 2025): I deleted the update because I make a mistake: i tried with admin account... the error still there.
Author
Owner

@rgaricano commented on GitHub (Jul 26, 2025):

OK, tested and solved with this changes:

b8912aa671/src/lib/components/common/CodeEditor.svelte (L181)
changed by: ($user?.role === 'admin' || $user?.permissions?.features?.code_interpreter)

b8912aa671/backend/open_webui/routers/utils.py (L36)
changed by: async def format_code(form_data: CodeForm, user=Depends(get_verified_user)):

I added the code_interpreter permission for consistency, if user don't have permission for the code interpreter user shouldn't have it to change or format the code either. The tools permission could also be used.

PR: https://github.com/open-webui/open-webui/pull/16044

<!-- gh-comment-id:3122163982 --> @rgaricano commented on GitHub (Jul 26, 2025): OK, tested and solved with this changes: https://github.com/open-webui/open-webui/blob/b8912aa671281ee577981a2a481d8c2b233d2938/src/lib/components/common/CodeEditor.svelte#L181 changed by: `($user?.role === 'admin' || $user?.permissions?.features?.code_interpreter)` https://github.com/open-webui/open-webui/blob/b8912aa671281ee577981a2a481d8c2b233d2938/backend/open_webui/routers/utils.py#L36 changed by: `async def format_code(form_data: CodeForm, user=Depends(get_verified_user)):` I added the code_interpreter permission for consistency, if user don't have permission for the code interpreter user shouldn't have it to change or format the code either. The tools permission could also be used. PR: https://github.com/open-webui/open-webui/pull/16044
Author
Owner

@vincent0408 commented on GitHub (Jul 27, 2025):

Thanks for the PR!

<!-- gh-comment-id:3123791026 --> @vincent0408 commented on GitHub (Jul 27, 2025): Thanks for the PR!
Author
Owner

@tjbck commented on GitHub (Jul 28, 2025):

Incorrect python should not be accepted.

<!-- gh-comment-id:3127293530 --> @tjbck commented on GitHub (Jul 28, 2025): Incorrect python should not be accepted.
Author
Owner

@GamerGuy95953 commented on GitHub (Jul 28, 2025):

Pull request with the fix was closed meaning no offical fix was done yet. :(

<!-- gh-comment-id:3127984112 --> @GamerGuy95953 commented on GitHub (Jul 28, 2025): Pull request with the fix was closed meaning no offical fix was done yet. :(
Author
Owner

@tjbck commented on GitHub (Jul 28, 2025):

@GamerGuy95953 "Loading" is not a valid python syntax.

<!-- gh-comment-id:3128242623 --> @tjbck commented on GitHub (Jul 28, 2025): @GamerGuy95953 "Loading" is not a valid python syntax.
Author
Owner

@GamerGuy95953 commented on GitHub (Jul 28, 2025):

@GamerGuy95953 "Loading" is not a valid python syntax.

You are right, but the problem is that it adds those lines automatically every time we click "Save" and there is no way to remove it.

See video attatched:
https://github.com/user-attachments/assets/43ef1ece-187b-4580-85e4-bb8fa7dfd3c8

<!-- gh-comment-id:3128274839 --> @GamerGuy95953 commented on GitHub (Jul 28, 2025): > [@GamerGuy95953](https://github.com/GamerGuy95953) "Loading" is not a valid python syntax. You are right, but the problem is that it adds those lines automatically every time we click "Save" and there is no way to remove it. See video attatched: https://github.com/user-attachments/assets/43ef1ece-187b-4580-85e4-bb8fa7dfd3c8
Author
Owner

@rgaricano commented on GitHub (Jul 28, 2025):

yes, its are added by frontend because it begin the proccess of create function but fault in code formatter.
It happend in my side too, anyway, with or without that lines the tool or function isn't added, any advice message neither.

<!-- gh-comment-id:3128531918 --> @rgaricano commented on GitHub (Jul 28, 2025): yes, its are added by frontend because it begin the proccess of create function but fault in code formatter. It happend in my side too, anyway, with or without that lines the tool or function isn't added, any advice message neither.
Author
Owner

@vincent0408 commented on GitHub (Jul 29, 2025):

"Loading" is not a valid python syntax.

If you can't even bother to test this reproducible and obvious bug, why take the time to close this issue?

<!-- gh-comment-id:3131973156 --> @vincent0408 commented on GitHub (Jul 29, 2025): > "Loading" is not a valid python syntax. If you can't even bother to test this reproducible and obvious bug, why take the time to close this issue?
Author
Owner
<!-- gh-comment-id:3132061188 --> @rgaricano commented on GitHub (Jul 29, 2025): https://github.com/open-webui/open-webui/pull/16044#issuecomment-3132037012
Author
Owner

@tjbck commented on GitHub (Jul 29, 2025):

@GamerGuy95953 Thanks for the clarification, I got confused with the PR addressing an unrelated part, taking a look right now.

<!-- gh-comment-id:3132069076 --> @tjbck commented on GitHub (Jul 29, 2025): @GamerGuy95953 Thanks for the clarification, I got confused with the PR addressing an unrelated part, taking a look right now.
Author
Owner

@tjbck commented on GitHub (Jul 29, 2025):

@vincent0408 Just managed to reproduce with FF, I was extra confused because we were unable to reproduce this issue on Chromium based browsers. Are you using FF as well?

<!-- gh-comment-id:3132088731 --> @tjbck commented on GitHub (Jul 29, 2025): @vincent0408 Just managed to reproduce with FF, I was extra confused because we were unable to reproduce this issue on Chromium based browsers. Are you using FF as well?
Author
Owner

@vincent0408 commented on GitHub (Jul 29, 2025):

I experienced this issue on Firefox and Edge

<!-- gh-comment-id:3132096005 --> @vincent0408 commented on GitHub (Jul 29, 2025): I experienced this issue on Firefox and Edge
Author
Owner

@tjbck commented on GitHub (Jul 29, 2025):

@vincent0408 I'd appreciate if you could fill out the entire issues template, including the browser section, going forward. Taking a look right now!

<!-- gh-comment-id:3132103072 --> @tjbck commented on GitHub (Jul 29, 2025): @vincent0408 I'd appreciate if you could fill out the entire issues template, including the browser section, going forward. Taking a look right now!
Author
Owner

@vincent0408 commented on GitHub (Jul 29, 2025):

Updated browser section

<!-- gh-comment-id:3132110598 --> @vincent0408 commented on GitHub (Jul 29, 2025): Updated browser section
Author
Owner

@rgaricano commented on GitHub (Jul 29, 2025):

Image

<!-- gh-comment-id:3132388550 --> @rgaricano commented on GitHub (Jul 29, 2025): ![Image](https://github.com/user-attachments/assets/abc3d97d-7213-443a-ac3d-2105602ae28c)
Author
Owner

@tjbck commented on GitHub (Jul 29, 2025):

Addressed with 071a2ac835 in dev!

<!-- gh-comment-id:3132469350 --> @tjbck commented on GitHub (Jul 29, 2025): Addressed with 071a2ac83565054e96a80e45a326451a884e73d8 in dev!
Author
Owner

@rgaricano commented on GitHub (Jul 29, 2025):

Addressed with 071a2ac in dev!

Tested & working properly, just a qq:
do you know from where was the extra code, from frontend or from pyodide lib loader?
(by the way, sometimes codeformatter is a little bit slow, a event indicating that is working would be welcome)

thanks,

(NOTE: I saw that in formatPythonCodeHandler the call is await, formatPythonCode is async but formatPythonCodePyodide seem that not, I don't know it this can be a problem, formatting sometimes it's a little bit slow, I had to increase the worker timeout)

<!-- gh-comment-id:3133361446 --> @rgaricano commented on GitHub (Jul 29, 2025): > Addressed with [071a2ac](https://github.com/open-webui/open-webui/commit/071a2ac83565054e96a80e45a326451a884e73d8) in dev! Tested & working properly, just a qq: do you know from where was the extra code, from frontend or from pyodide lib loader? (by the way, sometimes codeformatter is a little bit slow, a event indicating that is working would be welcome) thanks, (NOTE: I saw that in _formatPythonCodeHandler_ the call is await, formatPythonCode is async but _formatPythonCodePyodide_ seem that not, I don't know it this can be a problem, formatting sometimes it's a little bit slow, I had to increase the worker timeout)
Author
Owner

@17jmumford commented on GitHub (Jul 29, 2025):

Thank you, we were getting the same bug. Group users were seeing a 'Click loading' 'Click loaded' inserted to the top of the file when they hit the save button.

Will watch for this fix.

<!-- gh-comment-id:3133581761 --> @17jmumford commented on GitHub (Jul 29, 2025): Thank you, we were getting the same bug. Group users were seeing a 'Click loading' 'Click loaded' inserted to the top of the file when they hit the save button. Will watch for this fix.
Author
Owner

@GamerGuy95953 commented on GitHub (Jul 30, 2025):

Addressed with 071a2ac in dev!

Can confirm that it is working again on the dev branch! Thank you!

<!-- gh-comment-id:3134504253 --> @GamerGuy95953 commented on GitHub (Jul 30, 2025): > Addressed with [071a2ac](https://github.com/open-webui/open-webui/commit/071a2ac83565054e96a80e45a326451a884e73d8) in dev! Can confirm that it is working again on the dev branch! Thank you!
Author
Owner

@Lashatabidze commented on GitHub (Aug 3, 2025):

Greetings. Is this error resolved? Because im clearly facing the same problem and dont know how to deal with it. Could anyone please help?

<!-- gh-comment-id:3148607779 --> @Lashatabidze commented on GitHub (Aug 3, 2025): Greetings. Is this error resolved? Because im clearly facing the same problem and dont know how to deal with it. Could anyone please help?
Author
Owner

@17jmumford commented on GitHub (Aug 4, 2025):

Greetings. Is this error resolved? Because im clearly facing the same problem and dont know how to deal with it. Could anyone please help?

@Lashatabidze you'll need to wait until it gets released. Note that they merged the fix in last week to the 'dev' branch, and there have been no releases in the past two weeks. Watch the releases page for an update that notes the fix. Likely v0.6.19 if I had to guess (I'm too lazy to go digging through the pre-release branches to know for sure).

In the meantime, any admin can make a tool and share it with others. It's only non-admins that are affected.

<!-- gh-comment-id:3151421443 --> @17jmumford commented on GitHub (Aug 4, 2025): > Greetings. Is this error resolved? Because im clearly facing the same problem and dont know how to deal with it. Could anyone please help? @Lashatabidze you'll need to wait until it gets released. Note that they merged the fix in last week to the 'dev' branch, and there have been no releases in the past two weeks. Watch the [releases page](https://github.com/open-webui/open-webui/releases) for an update that notes the fix. Likely v0.6.19 if I had to guess (I'm too lazy to go digging through the pre-release branches to know for sure). In the meantime, any admin can make a tool and share it with others. It's only non-admins that are affected.
Author
Owner

@rgaricano commented on GitHub (Aug 4, 2025):

if docker, also you can use some of the most recent dev builts: https://github.com/open-webui/open-webui/pkgs/container/open-webui/versions?filters%5Bversion_type%5D=tagged

<!-- gh-comment-id:3151437445 --> @rgaricano commented on GitHub (Aug 4, 2025): if docker, also you can use some of the most recent dev builts: https://github.com/open-webui/open-webui/pkgs/container/open-webui/versions?filters%5Bversion_type%5D=tagged
Author
Owner

@Lashatabidze commented on GitHub (Aug 5, 2025):

Greetings and thanks for the answer!

Just to confirm — we understand that the issue with tool creation is
already fixed in the dev branch of Open WebUI, in commit 071a2ac.

So we are currently waiting for this fix to be included in an upcoming
stable release, correct?

Once that stable version is released, we’ll be able to use the tool
creation feature without the syntax error. - is everything correct?

On Mon, 4 Aug 2025 at 20:24, 00 @.***> wrote:

rgaricano left a comment (open-webui/open-webui#16037)
https://github.com/open-webui/open-webui/issues/16037#issuecomment-3151437445

if docker, also you can use some of the most recent dev builts:
https://github.com/open-webui/open-webui/pkgs/container/open-webui/versions?filters%5Bversion_type%5D=tagged


Reply to this email directly, view it on GitHub
https://github.com/open-webui/open-webui/issues/16037#issuecomment-3151437445,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AU5UO6HNVLBPWVMPJNTWS533L6CNVAVCNFSM6AAAAACCNEJST2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTCNJRGQZTONBUGU
.
You are receiving this because you were mentioned.Message ID:
@.***>

<!-- gh-comment-id:3155518099 --> @Lashatabidze commented on GitHub (Aug 5, 2025): Greetings and thanks for the answer! Just to confirm — we understand that the issue with tool creation is already fixed in the dev branch of Open WebUI, in commit 071a2ac. So we are currently waiting for this fix to be included in an upcoming stable release, correct? Once that stable version is released, we’ll be able to use the tool creation feature without the syntax error. - is everything correct? On Mon, 4 Aug 2025 at 20:24, _00_ ***@***.***> wrote: > *rgaricano* left a comment (open-webui/open-webui#16037) > <https://github.com/open-webui/open-webui/issues/16037#issuecomment-3151437445> > > if docker, also you can use some of the most recent dev builts: > https://github.com/open-webui/open-webui/pkgs/container/open-webui/versions?filters%5Bversion_type%5D=tagged > > — > Reply to this email directly, view it on GitHub > <https://github.com/open-webui/open-webui/issues/16037#issuecomment-3151437445>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/AU5UO6HNVLBPWVMPJNTWS533L6CNVAVCNFSM6AAAAACCNEJST2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTCNJRGQZTONBUGU> > . > You are receiving this because you were mentioned.Message ID: > ***@***.***> >
Author
Owner

@Lashatabidze commented on GitHub (Aug 13, 2025):

the matter has been resolved but as im checking the problem still exists - I still can not create a tool. Can you please help?

<!-- gh-comment-id:3184849478 --> @Lashatabidze commented on GitHub (Aug 13, 2025): the matter has been resolved but as im checking the problem still exists - I still can not create a tool. Can you please help?
Author
Owner

@rgaricano commented on GitHub (Aug 13, 2025):

it's fixed in versions => 0.6.19

<!-- gh-comment-id:3184998212 --> @rgaricano commented on GitHub (Aug 13, 2025): it's fixed in versions => 0.6.19
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#17761