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_BY in the SQL server configuration (workaround).
- Adjust the query so that the selected fields comply with strict SQL rules
(e.g., using MAX() around the timestamp expression or grouping by the exact expression used in the SELECT).
Context information (for bug reports)
Output of bench version
Steps to reproduce the issue
- Enable
ONLY_FULL_GROUP_BY in 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.
Description of the issue
When opening the
/app/user-profilepage, 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_BYenabled.In this mode, MySQL requires that all selected fields be either aggregated or included in the
GROUP BYclause.The problematic query is generated inside:
/apps/frappe/frappe/desk/page/user_profile/user_profile.py=>get_energy_points_heatmap_datamethod.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
ONLY_FULL_GROUP_BYin the SQL server configuration (workaround).(e.g., using
MAX()around the timestamp expression or grouping by the exact expression used in the SELECT).Context information (for bug reports)
Output of
bench versionSteps to reproduce the issue
ONLY_FULL_GROUP_BYin MariaDB/MySQL SQL mode./app/user-profile.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-profilepage should load without SQL errors, and the Energy Points heatmap should compute correctly regardless of SQL mode.