Skip to content

python-api container fails to start: greenlet missing with SQLAlchemy 2.1 #377

Open

Description

@anshuly0720

Describe the bug
On a fresh build, the python-api container exits with status 1 on startup. src/database/engine.py imports sqlalchemy.ext.asyncio, which needs greenlet, but greenlet is not installed:

ImportError: The SQLAlchemy asyncio module requires that the Python 'greenlet' library is installed. In order to ensure this dependency is available, use the 'sqlalchemy[asyncio]' install target: 'pip install sqlalchemy[asyncio]'

Since SQLAlchemy 2.1, greenlet is only installed with the asyncio extra (Requires-Dist: greenlet>=1; extra == "asyncio"). pyproject.toml lists plain sqlalchemy, so any new environment resolves to 2.1.x without greenlet.

To Reproduce

  1. Fresh clone of main (621da17)
  2. docker compose up -d database python-api
  3. docker compose ps -a shows python-api as Exited (1); docker compose logs python-api shows the error above.

Versions in the image: SQLAlchemy 2.1.7, greenlet not installed.
Environment: Ubuntu 26.04 in WSL2, Docker 29.1.3.

Expected behavior
The python-api container starts and serves the API on port 8000.

Additional context
Changing "sqlalchemy" to "sqlalchemy[asyncio]" in pyproject.toml fixes it for me: after rebuilding, the container starts and /docs loads. I'm happy to open a PR with this one-line change if that's welcome.

Activity

  1. Jayant-kernel commented on Nov 20, 2026

    @Jayant-kernel

    @anshuly0720
    Hi, if you’re still planning to submit the fix, I’d be happy to help verify it.
    Otherwise, I can pick it up if that works for you.

  2. anshuly0720 commented on Nov 21, 2026

    @anshuly0720
    Author

    Thanks @Jayant-kernel! I've opened the fix as #380. Happy to have you test it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriageneeds triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions