-
Notifications
You must be signed in to change notification settings - Fork 19
pymysql.err.OperationalError: (1055, "tabEnergy Point Log.creation' isn't in GROUP BY") #16
Description
Description of the issue
When opening the /app/user-profile page, Frappe throws the following SQL error: pymysql.err.OperationalError: (1055, "tabEnergy Point Log.creation' isn't in GROUP BY").
This happens because my MariaDB/MySQL instance is running with the SQL mode ONLY_FULL_GROUP_BY enabled.
In this mode, MySQL requires that all selected fields be either aggregated or included in the GROUP BY clause.
The problematic query is generated inside: /apps/frappe/frappe/desk/page/user_profile/user_profile.py => get_energy_points_heatmap_data method.
This query selects:
UnixTimestamp(Date(eps_log.creation))(not aggregated)Sum(eps_log.points)(aggregated)
…but only groups by Date(eps_log.creation), which results in SQL error 1055 under strict mode.
Possible solutions
- Disable
ONLY_FULL_GROUP_BYin the SQL server configuration (workaround). - Adjust the query so that the selected fields comply with strict SQL rules
(e.g., usingMAX()around the timestamp expression or grouping by the exact expression used in the SELECT).
Context information (for bug reports)
Output of bench version
"frappe": "15.99.0",
Steps to reproduce the issue
- Enable
ONLY_FULL_GROUP_BYin MariaDB/MySQL SQL mode. - Log in to Frappe.
- Open
/app/user-profile. - The Energy Points heatmap fails to load and triggers SQL error 1055.
The page fails to render the Energy Points heatmap and raises an SQL OperationalError (1055) due to a GROUP BY mismatch.
Expected result
The /app/user-profile page should load without SQL errors, and the Energy Points heatmap should compute correctly regardless of SQL mode.