You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: VersionedDatabaseTaskStore get() and delete() fail with "no such table" when initialize() was not called #1356
VersionedDatabaseTaskStore (src/a2a/server/cluster/database_task_store.py, added in #1281) creates its tables lazily, like DatabaseTaskStore: save() calls self._db._ensure_initialized() and then self._ensure_cluster_tables() before touching the database. get() and delete() only initialize the underlying DatabaseTaskStore, so on that path the task_versions table is never created.
If the store is used without calling initialize() first and the first operation is a get() or a delete(), the query on task_versions fails instead of returning None for a missing task:
store=VersionedDatabaseTaskStore(engine=create_async_engine('sqlite+aiosqlite:///:memory:'))
awaitstore.get('missing', ServerCallContext())
# sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) no such table: task_versionsawaitstore.delete('missing', ServerCallContext())
# sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) no such table: task_versions
The cluster sample and the existing tests call initialize() explicitly, so this only shows up when relying on the lazy initialization that save() and DatabaseTaskStore already provide.
Suggested fix: call self._ensure_cluster_tables() in get() and delete() after initializing the underlying store, as save() does.
I have a fix ready and I'm opening a PR alongside this issue.
Hi @cchinchilla-dev , thanks for reporting this and I was able to reproduce the issue.
Thanks for contributing towards a fix with #1357. The approach looks correct. Assigning this issue to you till the PR gets reviewed.
Till then as a workaround you can explicitly call await store.initialize() directly after instantiation to eagerly provision all tables before any read or delete calls.
Activity
rohityan commentedon Oct 21, 2026
Hi @cchinchilla-dev , thanks for reporting this and I was able to reproduce the issue.
Thanks for contributing towards a fix with #1357. The approach looks correct. Assigning this issue to you till the PR gets reviewed.
Till then as a workaround you can explicitly call
await store.initialize()directly after instantiation to eagerly provision all tables before any read or delete calls.fix(server): create the cluster tables lazily in VersionedDatabaseTas…