-
Notifications
You must be signed in to change notification settings - Fork 363
Description
π Bug
When running aim up, a TypeError is raised from SQLAlchemy's create_engine. This happens because pool_size and max_overflow arguments are passed to create_engine for an SQLite database, which defaults to using NullPool and does not accept these arguments.
This issue appears to have been introduced in a version after 3.27.0, as that version did not specify these pooling arguments.
The error is present in both aim/web/api/db.py and aim/storage/structured/db.py.
TypeError: Invalid argument(s) 'pool_size','max_overflow' sent to create_engine(), using configuration SQLiteDialect_pysqlite/NullPool/Engine. Please check that the keyword arguments are appropriate for this combination of components.
To reproduce
- Install Aim ~=3.28.0 or ~=3.29.0.
- Run
aim initin a directory. - Run
aim up. - See the error below.
Expected behavior
The aim up command should start the Aim UI server without raising a TypeError.
Environment
- Aim 3.28.0, 3.29.1
- Python 3.12
- pip 24.3.1
- sqlalchemy v1.4.13
- OS Linux (Docker)
Full dependency tree (output from uv tree):
aim v3.29.1
βββ aim-ui v3.29.1
βββ aimrecords v0.0.7
β βββ base58 v2.0.1
βββ aimrocks v0.5.2
βββ aiofiles v24.1.0
βββ alembic v1.6.0
β βββ mako v1.3.10
β β βββ markupsafe v3.0.2
β βββ python-dateutil v2.9.0.post0
β β βββ six v1.17.0
β βββ python-editor v1.0.4
β βββ sqlalchemy v1.4.13
β βββ greenlet v3.2.3
βββ boto3 v1.39.3
β βββ botocore v1.39.3
β β βββ jmespath v1.0.1
β β βββ python-dateutil v2.9.0.post0
β β βββ urllib3 v2.4.0
β βββ jmespath v1.0.1
β βββ s3transfer v0.13.0
β βββ botocore v1.39.3
βββ cachetools v4.2.4
βββ click v8.1.8
βββ cryptography v45.0.5
β βββ cffi v1.17.1
β βββ pycparser v2.22
βββ fastapi v0.116.0
β βββ pydantic v2.11.5
β β βββ annotated-types v0.7.0
β β βββ pydantic-core v2.33.2
β β β βββ typing-extensions v4.14.0
β β βββ typing-extensions v4.14.0
β β βββ typing-inspection v0.4.1
β β βββ typing-extensions v4.14.0
β βββ starlette v0.46.2
β β βββ anyio v4.9.0
β β βββ idna v3.10
β β βββ sniffio v1.3.1
β β βββ typing-extensions v4.14.0
β βββ typing-extensions v4.14.0
βββ filelock v3.18.0
βββ jinja2 v3.1.6
β βββ markupsafe v3.0.2
βββ numpy v2.3.0
βββ packaging v25.0
βββ pillow v11.2.1
βββ psutil v7.0.0
βββ python-dateutil v2.9.0.post0
βββ pytz v2020.1
βββ requests v2.32.3
β βββ certifi v2025.4.26
β βββ charset-normalizer v3.4.2
β βββ idna v3.10
β βββ urllib3 v2.4.0
βββ restrictedpython v8.0
βββ sqlalchemy v1.4.13
βββ tqdm v4.67.1
βββ uvicorn v0.35.0
β βββ click v8.1.8
β βββ h11 v0.16.0
βββ watchdog v6.0.0
βββ websockets v15.0.1
Additional context
A potential fix is to explicitly set a compatible connection pool, like QueuePool, when creating the engine for SQLite, or to remove the pool_size and max_overflow arguments if pooling is not intended for the SQLite connection.
I've tried this and it appears to work:
from sqlalchemy.pool import QueuePool
engine = create_engine(
get_db_url(),
# ... other args
poolclass=QueuePool, # Explicitly set the pool class
pool_size=10,
max_overflow=20,
)I.e. it starts, but I haven't tested the app thoroughly.