diff --git a/app/main.py b/app/main.py index 70b15e4..c4c04b5 100644 --- a/app/main.py +++ b/app/main.py @@ -227,8 +227,11 @@ async def lifespan(app: FastAPI): try: await set_tenant_context(db, tenant_id) await plugin.on_activate(db, container, event_bus) + # Flush to detect any RLS errors that were swallowed by the plugin + await db.flush() except Exception as exc: - logger.error(f"[STARTUP] Failed to activate plugin {name} for tenant {tenant_id}: {exc}") + logger.warning(f"[STARTUP] Plugin {name} activation issue for tenant {tenant_id}: {exc}") + await db.rollback() activation_failed = True break