# \[IGN-4941\]Stale Schema Records

**URL:** <https://forum.inductiveautomation.com/t/ign-4941-stale-schema-records/40202>\
**Category:** Ignition\
**Created:** [November 2, 2020, 12:44pm UTC](https://forum.inductiveautomation.com/t/ign-4941-stale-schema-records/40202 "2020-11-02T12:44:27Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![mcgheeiv](https://avatars.discourse-cdn.com/v4/letter/m/71c47a/32.png) [@mcgheeiv](https://forum.inductiveautomation.com/u/mcgheeiv)\
**Post date:** [November 2, 2020, 12:44pm UTC](https://forum.inductiveautomation.com/t/ign-4941-stale-schema-records/40202/1 "2020-11-02T12:44:27Z")

</div>

New installation of 8.0.16.

Any ideas on how to fix the issue causing the logger to show the following message every 30 minutes?

Error thrown while attempting to cleanup stale schema records

```auto
java.sql.SQLNonTransientConnectionException: connection exception: closed

at org.hsqldb.jdbc.JDBCUtil.sqlException(Unknown Source)

at org.hsqldb.jdbc.JDBCUtil.sqlException(Unknown Source)

at org.hsqldb.jdbc.JDBCPreparedStatement.(Unknown Source)

at org.hsqldb.jdbc.JDBCConnection.prepareStatement(Unknown Source)

at org.apache.commons.dbcp2.DelegatingConnection.prepareStatement(DelegatingConnection.java:292)

at org.apache.commons.dbcp2.DelegatingConnection.prepareStatement(DelegatingConnection.java:292)

at com.inductiveautomation.ignition.gateway.localdb.DelegatingDataSource$DelegatingConnection.prepareStatement(DelegatingDataSource.java:281)

at com.inductiveautomation.ignition.gateway.history.stores.AbstractDatasourceStore.cleanupSchemas(AbstractDatasourceStore.java:455)

at com.inductiveautomation.ignition.common.execution.impl.BasicExecutionEngine$TrackedTask.run(BasicExecutionEngine.java:565)

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)

Caused by: org.hsqldb.HsqlException: connection exception: closed

at org.hsqldb.error.Error.error(Unknown Source)

at org.hsqldb.error.Error.error(Unknown Source)

at org.hsqldb.Session.execute(Unknown Source)

... 13 common frames omitted

```

---

<div class="post-metadata">

**Author:** ![mcgheeiv](https://avatars.discourse-cdn.com/v4/letter/m/71c47a/32.png) [@mcgheeiv](https://forum.inductiveautomation.com/u/mcgheeiv)\
**Post date:** [November 2, 2020, 12:47pm UTC](https://forum.inductiveautomation.com/t/ign-4941-stale-schema-records/40202/2 "2020-11-02T12:47:19Z")

</div>

A bit more information…

This license does NOT include SQL Bridge and the error started after a project was imported. The project does NOT use transaction groups.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [November 2, 2020, 12:55pm UTC](https://forum.inductiveautomation.com/t/ign-4941-stale-schema-records/40202/3 "2020-11-02T12:55:02Z")

</div>

That trace looks like it comes from the Tag Historian, not any leftover from the SQL Bridge module.

---

<div class="post-metadata">

**Author:** ![mcgheeiv](https://avatars.discourse-cdn.com/v4/letter/m/71c47a/32.png) [@mcgheeiv](https://forum.inductiveautomation.com/u/mcgheeiv)\
**Post date:** [November 2, 2020, 12:57pm UTC](https://forum.inductiveautomation.com/t/ign-4941-stale-schema-records/40202/4 "2020-11-02T12:57:56Z")

</div>

There are no tags in this gateway either…

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [November 2, 2020, 1:27pm UTC](https://forum.inductiveautomation.com/t/ign-4941-stale-schema-records/40202/5 "2020-11-02T13:27:13Z")

</div>

Got nothing else. Might need someone at IA to look closer at the code around that call stack. You may be asked to try a nightly or RC, though. Or wait for a release today. (:

---

<div class="post-metadata">

**Author:** ![mcgheeiv](https://avatars.discourse-cdn.com/v4/letter/m/71c47a/32.png) [@mcgheeiv](https://forum.inductiveautomation.com/u/mcgheeiv)\
**Post date:** [November 2, 2020, 1:40pm UTC](https://forum.inductiveautomation.com/t/ign-4941-stale-schema-records/40202/6 "2020-11-02T13:40:03Z")

</div>

Version is 8. **0**.16.

The tag provider for the project was set to None, I changed it to default, error is still being thrown.

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [November 2, 2020, 1:43pm UTC](https://forum.inductiveautomation.com/t/ign-4941-stale-schema-records/40202/7 "2020-11-02T13:43:56Z")

</div>

> [@mcgheeiv](#):
>
> Version is 8. **0**.16.

8.0.17 RC1 is avaiable now.

---

<div class="post-metadata">

**Author:** ![mcgheeiv](https://avatars.discourse-cdn.com/v4/letter/m/71c47a/32.png) [@mcgheeiv](https://forum.inductiveautomation.com/u/mcgheeiv)\
**Post date:** [November 2, 2020, 3:59pm UTC](https://forum.inductiveautomation.com/t/ign-4941-stale-schema-records/40202/8 "2020-11-02T15:59:58Z")

</div>

The development system uses the same Ignition version with no errors. Development is a Linux box, Production is a Windows box if that makes a difference.

Hovering over the error in Logs displays “StoreAndForward.Sink.HsqlDataStore”

---

<div class="post-metadata">

**Author:** ![ryanjmclaughlin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ryanjmclaughlin/32/4318_2.png) [@ryanjmclaughlin](https://forum.inductiveautomation.com/u/ryanjmclaughlin)\
**Post date:** [December 7, 2020, 1:30pm UTC](https://forum.inductiveautomation.com/t/ign-4941-stale-schema-records/40202/9 "2020-12-07T13:30:01Z")

</div>

Did you ever find anything on this? I am seeing the same error. I was having some issues with Store and Forward and manually cleared SF by deleting the cache files, but after starting services back up I am seeing this error.

---

<div class="post-metadata">

**Author:** ![mcgheeiv](https://avatars.discourse-cdn.com/v4/letter/m/71c47a/32.png) [@mcgheeiv](https://forum.inductiveautomation.com/u/mcgheeiv)\
**Post date:** [December 7, 2020, 2:28pm UTC](https://forum.inductiveautomation.com/t/ign-4941-stale-schema-records/40202/10 "2020-12-07T14:28:38Z")

</div>

I started seeing the error after configuring the gateway, before importing any projects or transaction groups. Exporting and importing the gateway cleared up the issue.

---

<div class="post-metadata">

**Author:** ![Rusty](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/rusty/32/19859_2.png) [@Rusty](https://forum.inductiveautomation.com/u/Rusty)\
**Post date:** [March 3, 2021, 2:06pm UTC](https://forum.inductiveautomation.com/t/ign-4941-stale-schema-records/40202/11 "2021-03-03T14:06:41Z")

</div>

I am getting this error every 30 minutes too. It started yesterday when I deleted an unused database connection I had deactivated about a year ago.

```auto
HsqlDataStore	03Mar2021 08:48:42	Error thrown while attempting to cleanup stale schema records
java.sql.SQLNonTransientConnectionException: connection exception: closed

at org.hsqldb.jdbc.JDBCUtil.sqlException(Unknown Source)

at org.hsqldb.jdbc.JDBCUtil.sqlException(Unknown Source)

at org.hsqldb.jdbc.JDBCPreparedStatement.(Unknown Source)

at org.hsqldb.jdbc.JDBCConnection.prepareStatement(Unknown Source)

at org.apache.commons.dbcp2.DelegatingConnection.prepareStatement(DelegatingConnection.java:292)

at org.apache.commons.dbcp2.DelegatingConnection.prepareStatement(DelegatingConnection.java:292)

at com.inductiveautomation.ignition.gateway.localdb.DelegatingDataSource$DelegatingConnection.prepareStatement(DelegatingDataSource.java:281)

at com.inductiveautomation.ignition.gateway.history.stores.AbstractDatasourceStore.cleanupSchemas(AbstractDatasourceStore.java:455)

at com.inductiveautomation.ignition.common.execution.impl.BasicExecutionEngine$TrackedTask.run(BasicExecutionEngine.java:565)

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)

Caused by: org.hsqldb.HsqlException: connection exception: closed

at org.hsqldb.error.Error.error(Unknown Source)

at org.hsqldb.error.Error.error(Unknown Source)

at org.hsqldb.Session.execute(Unknown Source)

```

---

<div class="post-metadata">

**Author:** ![fleclerc](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/fleclerc/32/20480_2.png) [@fleclerc](https://forum.inductiveautomation.com/u/fleclerc)\
**Post date:** [March 29, 2021, 8:37pm UTC](https://forum.inductiveautomation.com/t/ign-4941-stale-schema-records/40202/12 "2021-03-29T20:37:47Z")

</div>

Yes, in my case, it seems related to adding and disabling a new database connection.

When it started after disabling a connection.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/7/c70abe83388048119dd950b3aebceee159b2f072.png)  
So instead of disabling it, I just deleted it.  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/9/b939ad9a5e7d3915873c84eb73b05413d6ae634e.png)

---

<div class="post-metadata">

**Author:** ![Rusty](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/rusty/32/19859_2.png) [@Rusty](https://forum.inductiveautomation.com/u/Rusty)\
**Post date:** [March 30, 2021, 12:38pm UTC](https://forum.inductiveautomation.com/t/ign-4941-stale-schema-records/40202/13 "2021-03-30T12:38:36Z")

</div>

Yes, I disabled and then deleted the database connection, but am still getting the periodic (every 30 minutes) error messages about it. I’m not sure how to fix it and get rid of the “HsqlDataStore” “Error thrown while attempting to cleanup stale records” error.

---

<div class="post-metadata">

**Author:** ![mcgheeiv](https://avatars.discourse-cdn.com/v4/letter/m/71c47a/32.png) [@mcgheeiv](https://forum.inductiveautomation.com/u/mcgheeiv)\
**Post date:** [March 30, 2021, 12:56pm UTC](https://forum.inductiveautomation.com/t/ign-4941-stale-schema-records/40202/14 "2021-03-30T12:56:13Z")

</div>

I found that creating and restoring a gateway backup resolves the issue.

Does your gateway have SQL bridge licensed? The client where I have the issue does NOT have a SQL bridge license, other clients on the same version (8.1.0) that DO have SQL bridge do not have the issue.

---

<div class="post-metadata">

**Author:** ![Rusty](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/rusty/32/19859_2.png) [@Rusty](https://forum.inductiveautomation.com/u/Rusty)\
**Post date:** [March 30, 2021, 2:59pm UTC](https://forum.inductiveautomation.com/t/ign-4941-stale-schema-records/40202/15 "2021-03-30T14:59:04Z")

</div>

Yes, the gateway with the issue has a licensed SQL bridge, it is running Ignition 8.1.1 and SQL bridge 10.1.1.

I can try to restore a backup, I’ll have to plan in the downtime though, so It’ll likely be a few days until I can try it out. I’ll let you know if it works for me. Thanks

For now it looks like this:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/1/c10b24eff856b8e43a3992feb2197533cc6c9646.png)

---

<div class="post-metadata">

**Author:** ![fleclerc](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/fleclerc/32/20480_2.png) [@fleclerc](https://forum.inductiveautomation.com/u/fleclerc)\
**Post date:** [March 30, 2021, 8:36pm UTC](https://forum.inductiveautomation.com/t/ign-4941-stale-schema-records/40202/16 "2021-03-30T20:36:02Z")

</div>

This is the solution, mcgheeiv.  
Doing the backup and restore of the gateway solved the recurring HsqlDataStore error every 30 minutes. Deleting my disabled database connection is not enough to stop the error.

---

<div class="post-metadata">

**Author:** ![richardNZ15](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/richardnz15/32/33373_2.png) [@richardNZ15](https://forum.inductiveautomation.com/u/richardNZ15)\
**Post date:** [July 22, 2021, 8:49pm UTC](https://forum.inductiveautomation.com/t/ign-4941-stale-schema-records/40202/17 "2021-07-22T20:49:14Z")

</div>

For reference, I have had this same error. Due to deleting a database connection, which did not delete the Store and Forward entry, nor the Historical Tag Provider entry…

I tried rebooting the gateway which did not fix it. I then tried the backup/restore suggestion.  
This did seem to stop the HsqlDataStore error from showing up, but unfortunately the gateway still has references to the deleted database connection…

---

<div class="post-metadata">

**Author:** ![zxcslo](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/zxcslo/32/61610_2.png) [@zxcslo](https://forum.inductiveautomation.com/u/zxcslo)\
**Post date:** [October 20, 2021, 5:50am UTC](https://forum.inductiveautomation.com/t/ign-4941-stale-schema-records/40202/18 "2021-10-20T05:50:57Z")

</div>

I have a new, few days old, installation of v8.1.10 (and today upgraded to v8.1.11) Ignition gateway in my office for a new project. I’ve never deleted any database connection (I have two: one for PostgreSQL and one for MSSQL), and I have no history tags and nothing in Store&Forward…  
And this is my log:

 ![ignition_error_hsqldatastore](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/3/d3ceb3d4cfdc36e873cdc954f54e15c6837b6384.png)  
I did not try backup&restore yet…  
And it’s strange that no one from IA has commented on this…

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [October 20, 2021, 12:42pm UTC](https://forum.inductiveautomation.com/t/ign-4941-stale-schema-records/40202/19 "2021-10-20T12:42:30Z")

</div>

That looks like the internal DB, not one of your two connections.

---

<div class="post-metadata">

**Author:** ![zxcslo](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/zxcslo/32/61610_2.png) [@zxcslo](https://forum.inductiveautomation.com/u/zxcslo)\
**Post date:** [October 20, 2021, 5:20pm UTC](https://forum.inductiveautomation.com/t/ign-4941-stale-schema-records/40202/20 "2021-10-20T17:20:42Z")

</div>

Well, the previous comments suggested that it has something to do with DB connections…  
And from these logs, you can’t figure it out…

[Next page](https://forum.inductiveautomation.com/t/ign-4941-stale-schema-records/40202.md?page=2)
