Issue running FusionAuth on digital ocean
-
Hi all,
We're installing FusionAuth via helm chart (0.7.7) on a k8s 1.17 cluster with a DigitalOcean MySQL 8 managed instance.FusionAuth now is on Maintenance Mode because during the pod startup we have this error:Cause: java.sql.SQLException: Unable to create or change a table without a primary key, when the system variable 'sql_require_primary_key' is set. Add a primary key to the table or unset this variable to avoid this message. Note that tables without a primary key can cause performance problems in row-based replication, so please consult your DBA before changing this setting. at org.apache.ibatis.jdbc.ScriptRunner.executeFullScript(ScriptRunner.java:133) at org.apache.ibatis.jdbc.ScriptRunner.runScript(ScriptRunner.java:108) at com.inversoft.maintenance.db.SQLExecutor.executeSQLScriptWithError(SQLExecutor.java:43) at com.inversoft.maintenance.db.JDBCMaintenanceModeDatabaseService.createSchema(JDBCMaintenanceModeDatabaseService.java:139) at com.inversoft.maintenance.db.DatabaseSilentConfigurationWorkflowTask.perform(DatabaseSilentConfigurationWorkflowTask.java:64) at com.inversoft.maintenance.DefaultMaintenanceModeWorkflow.performSilentConfiguration(DefaultMaintenanceModeWorkflow.java:45) at com.inversoft.maintenance.servlet.MaintenanceModePrimeServletContextListener.contextInitialized(MaintenanceModePrimeServletContextListener.java:52) at io.fusionauth.app.primeframework.FusionAuthAppPrimeServletContextListener.contextInitialized(FusionAuthAppPrimeServletContextListener.java:26) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4689) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5155) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1412) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1402) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630) at java.base/java.lang.Thread.run(Thread.java:832)
We have also another installation which is running fine for months, on k8s 1.15 and chart 0.6.6. But DigitalOcean is complaining about the missing primary keys on the fusionauth database and they keep notify us every day about that.
Because tables without primary keys can lead to service replication issues that jeopardize performance and availability.
-
My guess is that this version of MySQL on Digital Ocean is using MySQL Group Replication which is not supported.
https://fusionauth.io/docs/v1/tech/installation-guide/system-requirements/#databaseGroup Replication performs replication under the requirement that each table have a primary key, which we do not.
You can use a managed database that uses a different strategy for replication, or use PostgreSQL.