Getting 'Invalid use of group function' SQLException Error on MySQL 4.x

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Symptoms

Using MySQL 4.x, the following appears in the atlassian-confluence.log file:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 ERROR [http-1026-3] [atlassian.confluence.servlet.ConfluenceServletDispatcher] sendError Could not execute action -- referer: http://wiki.somedomain.com/confluence/dashboard.action | url: /confluence/dosearchsite.action | userName: admin java.lang.RuntimeException: Error rendering template for decorator root (snipped stack trace) Caused by: java.lang.RuntimeException: Error rendering template for decorator search (snipped stack trace) Caused by: org.apache.velocity.exception.MethodInvocationException: Invocation of method 'getRelatedLabels' in class com.atlassian.confluence.search.actions.SearchSiteAction threw exception org.springframework.jdbc.UncategorizedSQLException: Hibernate operation: Could not execute query; uncategorized SQLException for SQL []; SQL state [S1000]; error code [1111]; General error, message from server: "Invalid use of group function"; nested exception is java.sql.SQLException: General error, message from server: "Invalid use of group function" @ /search/searchpanel.vm[46,14] (snipped stack trace) Caused by: org.springframework.jdbc.UncategorizedSQLException: Hibernate operation: Could not execute query; uncategorized SQLException for SQL []; SQL state [S1000]; error code [1111]; General error, message from server: "Invalid use of group function"; nested exception is java.sql.SQLException: General error, message from server: "Invalid use of group function" (snipped stack trace) Caused by: java.sql.SQLException: General error, message from server: "Invalid use of group function" at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:1905) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1109) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1203) at com.mysql.jdbc.Connection.execSQL(Connection.java:2090) at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1496) at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(NewProxyPreparedStatement.java:76) at net.sf.hibernate.impl.BatcherImpl.getResultSet(BatcherImpl.java:89) at net.sf.hibernate.loader.Loader.getResultSet(Loader.java:880) at net.sf.hibernate.loader.Loader.doQuery(Loader.java:273) at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:138) at net.sf.hibernate.loader.Loader.doList(Loader.java:1063) at net.sf.hibernate.loader.Loader.list(Loader.java:1054) at net.sf.hibernate.hql.QueryTranslator.list(QueryTranslator.java:854) at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1554) at net.sf.hibernate.impl.QueryImpl.list(QueryImpl.java:49) at com.atlassian.confluence.labels.persistence.dao.hibernate.HibernateLabelDao$3.doInHibernate(HibernateLabelDao.java:378) at org.springframework.orm.hibernate.HibernateTemplate.execute(HibernateTemplate.java:370) ... 195 more

Cause

Confluence 2.9 and later no longer supports MySQL 4.x. Check the List Of Supported Databases.

Resolution

Upgrade to MySQL 5.0.28+.

There is a posted workaround, but upgrade is the supported resolution pattern. You may have limited success with the workaround, which is not supported. See Workaround For Enabling MySQL 4.1.x with Confluence 2.10.

Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.