Known issue with MySQL database settings
If you have an issue with MySQL database settings, you need to change some database configuration in case you see the following in your logs, after a MySQL DB upgrade.
/rest/insight/1.0/config/role/161 [c.r.j.p.i.c.w.a.r.exception.mapper.DefaultMapper] Unexpected exception was thrown while processing the request com.riadalabs.jira.plugins.insight.common.exception.RuntimeInsightException: InsightRuntimeException: nested exception is: There was a SQL exception thrown by the Active Objects library: Database: name:MySQL version:5.7.27 minor version:7 major version:5 Driver: name:MySQL Connector Java version:mysql-connector-java-5.1.47 ( Revision: fe1903b1ecb4a96a917f7ed3190d80c049b1de29 ) com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '0' for key 'PRIMARY' com.atlassian.activeobjects.internal.ActiveObjectsSqlException: There was a SQL exception thrown by the Active
Run the following script:
SELECT @@GLOBAL.sql_mode; SELECT @@SESSION.sql_mode;
If MySQL reports that NO_AUTO_VALUE_ON_ZERO option is set, then remove it, and re-index Insight. The issue should be remedied and your records won't be affected.