mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 19:08:59 -05:00
[PR #21478] [CLOSED] fix: resolve PostgreSQL GROUP BY error in /api/v1/groups/ endpoint #26095
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/21478
Author: @Classic298
Created: 2/16/2026
Status: ❌ Closed
Base:
dev← Head:fix-api-groups📝 Commits (4)
04e4c43fix: resolve PostgreSQL GROUP BY error in /api/v1/groups/ endpoint (#151)2586f1fMerge branch 'dev' into fix-api-groupsae056e2Fix search_groups to use get_group_member_counts_by_ids (#152)699f0c8whitespace and simplified query for psql📊 Changes
1 file changed (+35 additions, -34 deletions)
View changed files
📝
backend/open_webui/models/groups.py(+35 -34)📄 Description
Replace JOIN-based member filtering with IN subqueries across all group query methods. JOINing Group with GroupMember and using GROUP BY only on Group.id fails on PostgreSQL because all non-aggregated columns must appear in GROUP BY. Using IN subqueries avoids the JOIN entirely, preventing both the GROUP BY error and potential duplicate rows.
Also fix model_validate kwargs bug in search_groups and remove debug print statement.
Bonus fixes:
Fixes #21467
Contributor License Agreement
By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA), and I am providing my contributions under its terms.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.