Specified historical sink 'DB' does not exist

I installed the latest version of 8.0.4 Ignition. I’m using the a MySQL 5.6 database and have a valid connection. I have a UDT that has a few Simulated tags, that I am trying to set up a history on. When I do set the History setting to true in the UDT, all the tags try to record history, but there’s no data being saved. In the Gateway Logs I see the following -

java.lang.IllegalArgumentException: Specified historical sink 'DB' does not exist.

at com.inductiveautomation.ignition.gateway.history.HistoryManagerImpl.storeHistory(HistoryManagerImpl.java:166)

at com.inductiveautomation.gateway.tags.history.actor.HistoryActorFactory$DelayedEvaluationContainer.process(HistoryActorFactory.java:887)

at com.inductiveautomation.gateway.tags.history.actor.HistoryActorFactory$DelayedEvaluationContainer.run(HistoryActorFactory.java:848)

at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)

at java.base/java.util.concurrent.FutureTask.runAndReset(Unknown Source)

at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)

at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

at java.base/java.lang.Thread.run(Unknown Source)

I just tried granting all privileges to the MySQL User that Ignition logs in as but that has not helped. Unsure how to proceed from here.

Interestingly, when I uninstalled 8.0.4 and installed 8.0.2, when I tried making a connection to the MySQL Database , I got a JBDC driver missing error. I am not sure if 8.0.4 came with the driver, or maybe it somehow is missing the fact I don’t have it and is causing the issue?

Wrapper had an addition line of error at the top -

INFO   | jvm 2    | 2019/10/04 10:41:16 | E [t.e.a.history                 ] [14:41:16]: Error storing tag history data store-forward-name=DB
INFO   | jvm 2    | 2019/10/04 10:41:16 | java.lang.IllegalArgumentException: Specified historical sink 'DB' does not exist.
INFO   | jvm 2    | 2019/10/04 10:41:16 | 	at com.inductiveautomation.ignition.gateway.history.HistoryManagerImpl.storeHistory(HistoryManagerImpl.java:166)
INFO   | jvm 2    | 2019/10/04 10:41:16 | 	at com.inductiveautomation.gateway.tags.history.actor.HistoryActorFactory$DelayedEvaluationContainer.process(HistoryActorFactory.java:882)
INFO   | jvm 2    | 2019/10/04 10:41:16 | 	at com.inductiveautomation.gateway.tags.history.actor.HistoryActorFactory$DelayedEvaluationContainer.run(HistoryActorFactory.java:843)
INFO   | jvm 2    | 2019/10/04 10:41:16 | 	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
INFO   | jvm 2    | 2019/10/04 10:41:16 | 	at java.base/java.util.concurrent.FutureTask.runAndReset(Unknown Source)
INFO   | jvm 2    | 2019/10/04 10:41:16 | 	at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
INFO   | jvm 2    | 2019/10/04 10:41:16 | 	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
INFO   | jvm 2    | 2019/10/04 10:41:16 | 	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
INFO   | jvm 2    | 2019/10/04 10:41:16 | 	at java.base/java.lang.Thread.run(Unknown Source)

When I went to config->Store and Forward, the only thing I saw was “Server:Error”. I clicked edit configuration, I saw my datase stuff, clicked save, and then it appeared normally. However, in my logs, I then saw this new error after the gateway implemented the changes and it looks like it may be related

java.lang.AbstractMethodError: Receiver class com.mysql.jdbc.Connection does not define or inherit an implementation of the resolved method abstract getSchema()Ljava/lang/String; of interface java.sql.Connection.

at org.apache.commons.dbcp2.DelegatingConnection.getSchema(DelegatingConnection.java:941)

at org.apache.commons.dbcp2.DelegatingConnection.getSchema(DelegatingConnection.java:941)

at com.inductiveautomation.ignition.gateway.datasource.SRConnectionWrapper.getSchema(SRConnectionWrapper.java:546)

at com.inductiveautomation.ignition.gateway.db.schema.DBTableSchema.refreshTableState(DBTableSchema.java:187)

at com.inductiveautomation.ignition.gateway.db.schema.DBTableSchema.verifyAndUpdate(DBTableSchema.java:87)

at com.inductiveautomation.gateway.tags.history.storage.TagHistoryDatasourceSink.checkTables(TagHistoryDatasourceSink.java:1110)

at com.inductiveautomation.gateway.tags.history.storage.TagHistoryDatasourceSink.initialize(TagHistoryDatasourceSink.java:237)

at com.inductiveautomation.ignition.gateway.history.sf.sinks.AbstractSink.tryToInit(AbstractSink.java:94)

at com.inductiveautomation.gateway.tags.history.storage.TagHistoryDatasourceSink.tryToInit(TagHistoryDatasourceSink.java:218)

at com.inductiveautomation.ignition.gateway.history.sf.sinks.AbstractSink.startup(AbstractSink.java:43)

at com.inductiveautomation.gateway.tags.history.storage.TagHistoryDatasourceSink.startup(TagHistoryDatasourceSink.java:228)

at com.inductiveautomation.ignition.gateway.history.sf.sinks.AggregateSink.startup(AggregateSink.java:131)

at com.inductiveautomation.ignition.gateway.history.DefaultStoreAndForwardEngine.startup(DefaultStoreAndForwardEngine.java:187)

at com.inductiveautomation.ignition.gateway.history.StandardStoreAndForwardEngine.updateSettings(StandardStoreAndForwardEngine.java:91)

at com.inductiveautomation.ignition.gateway.history.HistoryManagerImpl.ensureStoreAndForwardEngineLoaded(HistoryManagerImpl.java:444)

at com.inductiveautomation.ignition.gateway.history.HistoryManagerImpl$1.recordUpdated(HistoryManagerImpl.java:97)

at com.inductiveautomation.ignition.gateway.history.HistoryManagerImpl$1.recordUpdated(HistoryManagerImpl.java:83)

at com.inductiveautomation.ignition.gateway.localdb.PersistenceInterfaceImpl.notifyRecordUpdated(PersistenceInterfaceImpl.java:178)

at com.inductiveautomation.ignition.gateway.redundancy.RedundantPersistenceInterfaceImpl.doNotifyRecordUpdated(RedundantPersistenceInterfaceImpl.java:88)

at com.inductiveautomation.ignition.gateway.redundancy.RedundantPersistenceInterfaceImpl$RecordUpdateListener.recordUpdated(RedundantPersistenceInterfaceImpl.java:295)

at com.inductiveautomation.ignition.gateway.redundancy.RedundantPersistenceInterfaceImpl$RecordUpdateMessage.notify(RedundantPersistenceInterfaceImpl.java:346)

at com.inductiveautomation.ignition.gateway.redundancy.RedundantPersistenceInterfaceImpl$RecordUpdateListener.receiveCall(RedundantPersistenceInterfaceImpl.java:278)

at com.inductiveautomation.ignition.gateway.redundancy.QueueableMessageReceiver.receiveCall(QueueableMessageReceiver.java:47)

at com.inductiveautomation.ignition.gateway.redundancy.RedundancyManagerImpl.dispatchMessage(RedundancyManagerImpl.java:813)

at com.inductiveautomation.ignition.gateway.redundancy.RedundancyManagerImpl$ExecuteTask.run(RedundancyManagerImpl.java:849)

at com.inductiveautomation.ignition.common.execution.impl.BasicExecutionEngine$ThrowableCatchingRunnable.run(BasicExecutionEngine.java:518)

at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)

at java.base/java.util.concurrent.FutureTask.run(Unknown Source)

at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)

at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

at java.base/java.lang.Thread.run(Unknown Source)

JDBC drivers are a bit of a confusing mess.
Here’s the backstory:
In 8.0+, we’re no longer bundling any MySQL JDBC driver with Ignition (for legal compliance reasons). Instead, we’re bundling the MariaDB JDBC driver. MariaDB is a community-owned for of MySQL, and their driver claims to be completely compatible with all MySQL 5.x versions (but not MySQL 8).

However, gateway backups contain whatever installed JDBC drivers the running system had when the backup was taken. This is for ‘least surprise’ reasons - if you had a working DB connection on one system, you would expect it to start working when you restore that backup on a new system.

Here’s where it gets really complicated:
In Ignition 8, we upgraded the base Java version from 8 to Java 11. Java 11 is much, much newer, and some very old jar files don’t really work on it - such as the bundled MySQL driver from some older installations of Ignition.

tl;dr: If your database is MySQL 5.6, try connecting with the (bundled) MariaDB driver. It works with Java 11, and shouldn’t have any problem connecting to MySQL. But, if you’ve restored a backup, you’ll have to manually install the MariaDB driver. Or, you could just update the MySQL driver on your existing system, without adding a new driver.

Just to be clear then, when I am using 8.0+, and select the MySQL database connection for a new DB connection, that IS using the MariaDB driver?

When I check my Java, it says I have Version 8 Update 144 - is this causing an issue?

If you’re on a fresh install of Ignition 8, there will be both a MySQL and a MariaDB driver available as options when making a new database connection. Once you’ve restored a gateway backup, you will only have whatever options the gateway backup had - so, presumably, only MySQL.

Your system’s Java is irrelevant in 8 - we’re bundling a runtime that’s used by the gateway, designer, and clients (specifically, Azul Systems Java 11).

Just ran into this problem while trying to do the Core test. The stop the errors you can simply create a new database connection named “DB” which will then allow Ignition to create the tables needed. I used the same settings as my primary database connection and the errors went away.