dani-garcia/vaultwarden · error
Error loading collection groups
Error message
Error loading collection groups
What it means
Panic from `.expect()` on the Diesel query in `CollectionGroup::find_by_group`, joining collections_groups with collections to fetch a group's collection assignments scoped to an org. A database failure aborts the call. It depends on three tables (collections_groups, collections, groups), so any schema drift among them can trigger it.
Solutions
- Apply all pending migrations (collections_groups table present with expected columns)
- Check DB connectivity and DATABASE_URL configuration
- Inspect server logs for the underlying Diesel error
- Verify the group UUID and org UUID reference existing rows if data integrity is in question
Example fix
// before
.load::<Self>(conn).expect("Error loading collection groups")
// after
.load::<Self>(conn).unwrap_or_else(|e| { error!("load collection groups failed: {e}"); Vec::new() }) Defensive patterns
Strategy: try-catch
Validate before calling
// verify collections_groups table is present // SELECT 1 FROM collections_groups LIMIT 1;
Try / catch
// schema and health gate before joined lookups
if !db_ok().await || !table_exists("collections_groups").await { return Vec::new(); }
CollectionGroup::find_by_group(group_uuid, org_uuid, conn).await Prevention
- Apply collections/groups migrations as a unit
- Avoid manual schema edits on join tables
- Monitor DB during org-admin operations
- Validate UUIDs reference existing rows before deep joins
When it happens
Trigger: Calling `CollectionGroup::find_by_group` with an unreachable DB, missing collections_groups table/columns, or a join clause the backend rejects.
Common situations: Pre-collections-groups schema after upgrading without migrations; DB connection dropped mid-request; SQLite locking; switching database backends with un-migrated schema.
Understand the failure class
Background: Database query failed: Internal Server Error 500s wrapping SQL, Prisma, and connection failures — what to check first — this error's family across 16 libraries.
Related errors
- Error loading user collection groups
- Error loading collections
- Error loading groups
- Error loading organization group full access information…
- Error creating organization API Key
AI-assisted analysis of dani-garcia/vaultwarden@cc67d644f6 (2026-09-19).
Data as JSON: /api/errors/9670e22661613ac0.
Report an issue: GitHub.
Appendix: source
Thrown at src/db/models/group.rs:364
.map_res("Error adding group to collection")
}
}
}
pub async fn find_by_group(group_uuid: &GroupId, org_uuid: &OrganizationId, conn: &DbConn) -> Vec<Self> {
conn.run(move |conn| {
collections_groups::table
.inner_join(groups::table.on(groups::uuid.eq(collections_groups::groups_uuid)))
.inner_join(
collections::table.on(collections::uuid
.eq(collections_groups::collections_uuid)
.and(collections::org_uuid.eq(groups::organizations_uuid))),
)
.filter(collections_groups::groups_uuid.eq(group_uuid))
.filter(collections::org_uuid.eq(org_uuid))
.select(collections_groups::all_columns)
.load::<Self>(conn)
.expect("Error loading collection groups")
})
.await
}
pub async fn find_by_user(user_uuid: &UserId, conn: &DbConn) -> Vec<Self> {
conn.run(move |conn| {
collections_groups::table
.inner_join(groups_users::table.on(groups_users::groups_uuid.eq(collections_groups::groups_uuid)))
.inner_join(
users_organizations::table.on(users_organizations::uuid.eq(groups_users::users_organizations_uuid)),
)
.inner_join(
groups::table.on(groups::uuid
.eq(collections_groups::groups_uuid)
.and(groups::organizations_uuid.eq(users_organizations::org_uuid))),
)
.inner_join(
collections::table.on(collections::uuidView on GitHub (pinned to cc67d644f6)