# Ignition 7.9.9, Mysql 8.0.12 (Group Replication InnoDB Cluster) - error for storing data in sqlt\_data\_ table

**URL:** <https://forum.inductiveautomation.com/t/ignition-7-9-9-mysql-8-0-12-group-replication-innodb-cluster-error-for-storing-data-in-sqlt-data--table/19962>\
**Category:** Ignition\
**Tags:** ignition79\
**Created:** [October 3, 2018, 4:02pm UTC](https://forum.inductiveautomation.com/t/ignition-7-9-9-mysql-8-0-12-group-replication-innodb-cluster-error-for-storing-data-in-sqlt-data--table/19962 "2018-10-03T16:02:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mazeyrat](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mazeyrat/32/10955_2.png) [@mazeyrat](https://forum.inductiveautomation.com/u/mazeyrat)\
**Post date:** [October 3, 2018, 4:02pm UTC](https://forum.inductiveautomation.com/t/ignition-7-9-9-mysql-8-0-12-group-replication-innodb-cluster-error-for-storing-data-in-sqlt-data--table/19962/1 "2018-10-03T16:02:00Z")

</div>

Ignition 7.9.9, Mysql 8.0.12

For tag history, the store and froward engine report the following error :

The table does not comply with the requirements by an external plugin.  
All history table (sqlth\_xxx) are fine, but the sqlt\_data\_1\_2018\_10 is empty…

the logger reprot the follwing error :

```auto
DatasourceForwardTransaction	03Oct2018 17:57:41	Error forwarding data
java.sql.SQLException: The table does not comply with the requirements by an external plugin.
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:965)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3976)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3912)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2530)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2683)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2486)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1858)
at com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2079)
at com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2013)
at com.mysql.jdbc.PreparedStatement.executeLargeUpdate(PreparedStatement.java:5104)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1998)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:102)
at com.inductiveautomation.ignition.gateway.datasource.SRConnectionWrapper$SRPreparedStatement.executeUpdate(SRConnectionWrapper.java:955)
at com.inductiveautomation.ignition.gateway.datasource.SRConnectionWrapper.runPrepUpdate(SRConnectionWrapper.java:180)
at com.inductiveautomation.gateway.tags.history.storage.TagHistoryDatasourceSink.updateSCExecRecord(TagHistoryDatasourceSink.java:560)
at com.inductiveautomation.gateway.tags.history.storage.TagHistoryDatasourceSink.storeScanClassSet(TagHistoryDatasourceSink.java:476)
at com.inductiveautomation.gateway.tags.history.storage.TagHistoryDatasourceSink.storeDataToDatasource(TagHistoryDatasourceSink.java:458)
at com.inductiveautomation.ignition.gateway.history.sf.sinks.AbstractDatasourceSink.storeToDatasource(AbstractDatasourceSink.java:137)
at com.inductiveautomation.ignition.gateway.history.sf.sinks.AbstractDatasourceSink.storeData(AbstractDatasourceSink.java:115)
at com.inductiveautomation.ignition.gateway.history.sf.sinks.AggregateSink.storeData(AggregateSink.java:170)
at com.inductiveautomation.ignition.gateway.history.forwarders.ForwarderThread.run(ForwarderThread.java:149)

```

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [October 3, 2018, 4:11pm UTC](https://forum.inductiveautomation.com/t/ignition-7-9-9-mysql-8-0-12-group-replication-innodb-cluster-error-for-storing-data-in-sqlt-data--table/19962/2 "2018-10-03T16:11:39Z")

</div>

Looks like it might be related to replication requiring a primary key?  
[https://bugs.mysql.com/bug.php?id=83165](https://bugs.mysql.com/bug.php?id=83165)

---

<div class="post-metadata">

**Author:** ![mazeyrat](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mazeyrat/32/10955_2.png) [@mazeyrat](https://forum.inductiveautomation.com/u/mazeyrat)\
**Post date:** [October 3, 2018, 4:53pm UTC](https://forum.inductiveautomation.com/t/ignition-7-9-9-mysql-8-0-12-group-replication-innodb-cluster-error-for-storing-data-in-sqlt-data--table/19962/3 "2018-10-03T16:53:49Z")

</div>

@paul-griffith, I use mysql 8.0.12 with the built in Group Replication InnoDB cluster.  
My Ignition database connection go through a local mysql router connected to the master database for RW.

The issue is that sqlth\_xxx don’t have a primary key ? 😢  
Is there a workaround to add a primary key to that table (like an Auto Incremental key) ???  
or is there a solution in Ignition 8.0 ???

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [October 3, 2018, 5:32pm UTC](https://forum.inductiveautomation.com/t/ignition-7-9-9-mysql-8-0-12-group-replication-innodb-cluster-error-for-storing-data-in-sqlt-data--table/19962/4 "2018-10-03T17:32:34Z")

</div>

This sounds very familiar - I definitely feel like this has been encountered before. Unfortunately, I can’t find whatever it is I’m remembering.

There are currently no changes to this aspect of the historian in 8.0. Adding an auto-incrementing PK would probably work - however, adding that column to each monthly partition will be tricky…

---

<div class="post-metadata">

**Author:** ![mazeyrat](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mazeyrat/32/10955_2.png) [@mazeyrat](https://forum.inductiveautomation.com/u/mazeyrat)\
**Post date:** [October 4, 2018, 7:13am UTC](https://forum.inductiveautomation.com/t/ignition-7-9-9-mysql-8-0-12-group-replication-innodb-cluster-error-for-storing-data-in-sqlt-data--table/19962/5 "2018-10-04T07:13:29Z")

</div>

Hi @paul-griffith,

I’ve taken a closer look at the compatibility issue.  
**sqlt\_data\_xxxx** table has a Primary Key, but there are 2 tables in the history system with no Primary Key :  
**sqlth\_sce** and **sqlth\_partitions**.  
So, the trick is not to cumbursome as the partition data table is compatible with mysql group replication requirement.

```auto
ALTER TABLE `histo`.`sqlth_partitions` 
ADD COLUMN `pk_ai` BIGINT(20) NOT NULL AUTO_INCREMENT AFTER `flags`,
ADD PRIMARY KEY (`pk_ai`);

ALTER TABLE `histo`.`sqlth_sce` 
ADD COLUMN `pk_ai` BIGINT(20) NOT NULL AUTO_INCREMENT AFTER `rate`,
ADD PRIMARY KEY (`pk_ai`);
```

seem to solve the issue.

Audit tables are **OK**

For alarme tables

`ALTER TABLE `histo`.`alarm_event_data` 
ADD COLUMN `pk_ai` BIGINT(20) NOT NULL AUTO_INCREMENT AFTER `strvalue`,
ADD PRIMARY KEY (`pk_ai`);
`
