mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 10:58:17 -05:00
[GH-ISSUE #23942] bug: Missing greenlet dependency causes startup crash when installed via uvx #35649
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @tooke24 on GitHub (Apr 21, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/23942
Check Existing Issues
Installation Method
uvx(ephemeral environment created byuv tool run)Open WebUI Version
0.9.1
Operating System
macOS 15 (Darwin 25.4.0, aarch64)
Summary
Launching Open WebUI via
uvxfails on startup withValueError: the greenlet library is required to use this function. No module named 'greenlet'. SQLAlchemy's async code path is reached during thelifespanhook (install_tool_and_function_dependencies→Functions.get_functions), and greenlet is not in the resolved environment.The
pip/Docker install paths seem to get greenlet indirectly (probably via another transitive dep), butuvxproduces a minimal environment where that indirect inclusion doesn't happen — so the latent packaging gap becomes a hard crash.Reproduction
Error Stack Trace (abridged)
Workaround
Add greenlet explicitly to the uvx invocation:
After this, startup completes cleanly (scheduler starts, no stack trace).
Suggested Fix
In
pyproject.toml, either:Change the SQLAlchemy dependency to include its async extra:
which transitively pulls in
greenlet; orAdd
greenletas a direct dependency.Option 1 is the more conventional SQLAlchemy-recommended form.
Additional context
The
lifespanhook performs async DB queries, so any clean, minimal environment without greenlet will hit this. Docker and manypipinstalls happen to have greenlet pulled in as a side effect of other deps, hiding the bug.uvx(and any other strict resolver) surfaces it.@Classic298 commented on GitHub (Apr 21, 2026):
Thanks for the detailed report. Quick workaround while this gets addressed properly:
uvx --python 3.11 --with greenlet open-webui@latest serve
Why this happens only on uvx: SQLAlchemy 2.x's async path requires greenlet, but we currently declare plain sqlalchemy in pyproject.toml without the [asyncio] extra. On Docker and most pip installs, greenlet gets pulled in transitively by other dependencies (chromadb/posthog chain, etc.), so the missing declaration is invisible. uvx creates a strict, minimal environment without those incidental transitive deps, so it surfaces the gap as a hard crash.
Proper fix on our end is to change the dependency to sqlalchemy[asyncio], which transitively pulls greenlet in.
@mdouglas4321-svg commented on GitHub (Apr 22, 2026):
uvx --python 3.11 --with greenlet open-webui@latest serve overwrote erased my users, history, etc, and made me start over as a new install, I don't recommend.
@csloz commented on GitHub (Apr 22, 2026):
Same issue with a fresh install with uv pip install open-webui as per https://www.jjude.com/tech-notes/run-owui-on-mac/
tail webui.log
File "/Users/ent/openwebui/.venv/lib/python3.11/site-packages/sqlalchemy/ext/asyncio/session.py", line 1016, in close
await greenlet_spawn(self.sync_session.close)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/ent/openwebui/.venv/lib/python3.11/site-packages/sqlalchemy/util/concurrency.py", line 101, in greenlet_spawn
_not_implemented()
File "/Users/ent/openwebui/.venv/lib/python3.11/site-packages/sqlalchemy/util/concurrency.py", line 81, in _not_implemented
raise ValueError(
ValueError: the greenlet library is required to use this function. No module named 'greenlet'
running the obvious fixed it for me, but its a new clean install, so no users to nuke
uv pip install greenlet
@Classic298 commented on GitHub (Apr 22, 2026):
@mdouglas4321-svg well you have to add your data dir etc. of course. The above is a sample command - one which is evidently missing any information on the data directory or other environment vars