# Error "TagHistoryDatasourceSink" caused by wrong storage provider

**URL:** <https://forum.inductiveautomation.com/t/error-taghistorydatasourcesink-caused-by-wrong-storage-provider/93731>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [July 25, 2024, 8:09am UTC](https://forum.inductiveautomation.com/t/error-taghistorydatasourcesink-caused-by-wrong-storage-provider/93731 "2024-07-25T08:09:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aiasa21](https://avatars.discourse-cdn.com/v4/letter/a/aeb1de/32.png) [@Aiasa21](https://forum.inductiveautomation.com/u/Aiasa21)\
**Post date:** [July 25, 2024, 8:09am UTC](https://forum.inductiveautomation.com/t/error-taghistorydatasourcesink-caused-by-wrong-storage-provider/93731/1 "2024-07-25T08:09:09Z")

</div>

Hi, I wrongly set the "History storage provider" property of some tags to the wrong database.

As soon as I noticed the mistake I change the storage provider to the right one; since then I have this errors in the log

```python
There is a problem checking the tag history database tables during initialization of the store and forward engine which could prevent tag history data from being forwarded properly. Trying again in 60 seconds.

```

I checked in the wrapper logs and I have this error

```python
INFO | jvm 1 | 2024/07/25 09:59:12 | W [S.S.TagHistoryDatasourceSink] [09:59:12.730]: There is a problem checking the tag history database tables during initialization of the store and forward engine which could prevent tag history data from being forwarded properly. Trying again in 60 seconds. 
INFO | jvm 1 | 2024/07/25 09:59:12 | java.lang.Exception: Error running query: CREATE TABLE sqlth_drv ("id" int IDENTITY(1,1),"name" nvarchar(255),"provider" nvarchar(255),PRIMARY KEY CLUSTERED ("id"))
INFO | jvm 1 | 2024/07/25 09:59:12 | at com.inductiveautomation.ignition.gateway.db.schema.DBTableSchema.executeCommandSet(DBTableSchema.java:140)
INFO | jvm 1 | 2024/07/25 09:59:12 | at com.inductiveautomation.ignition.gateway.db.schema.DBTableSchema.createTable(DBTableSchema.java:109)
INFO | jvm 1 | 2024/07/25 09:59:12 | at com.inductiveautomation.ignition.gateway.db.schema.DBTableSchema.verifyAndUpdate(DBTableSchema.java:91)
INFO | jvm 1 | 2024/07/25 09:59:12 | at com.inductiveautomation.gateway.tags.history.storage.TagHistoryDatasourceSink.checkTables(TagHistoryDatasourceSink.java:1655)
INFO | jvm 1 | 2024/07/25 09:59:12 | at com.inductiveautomation.gateway.tags.history.storage.TagHistoryDatasourceSink.initialize(TagHistoryDatasourceSink.java:295)
INFO | jvm 1 | 2024/07/25 09:59:12 | at com.inductiveautomation.ignition.common.execution.impl.BasicExecutionEngine$ThrowableCatchingRunnable.run(BasicExecutionEngine.java:550)
INFO | jvm 1 | 2024/07/25 09:59:12 | at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
INFO | jvm 1 | 2024/07/25 09:59:12 | at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
INFO | jvm 1 | 2024/07/25 09:59:12 | at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
INFO | jvm 1 | 2024/07/25 09:59:12 | at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
INFO | jvm 1 | 2024/07/25 09:59:12 | at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
INFO | jvm 1 | 2024/07/25 09:59:12 | at java.base/java.lang.Thread.run(Unknown Source)
INFO | jvm 1 | 2024/07/25 09:59:12 | Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: CREATE TABLE permission denied in database ' **myName**'.

```

How can I fix this?

Thank you for the support

---

<div class="post-metadata">

**Author:** ![Aiasa21](https://avatars.discourse-cdn.com/v4/letter/a/aeb1de/32.png) [@Aiasa21](https://forum.inductiveautomation.com/u/Aiasa21)\
**Post date:** [July 25, 2024, 9:52am UTC](https://forum.inductiveautomation.com/t/error-taghistorydatasourcesink-caused-by-wrong-storage-provider/93731/2 "2024-07-25T09:52:05Z")

</div>

At the end I checked all the tags and everything seems ok so I reboot the gateway server and the alarms in the log disappear.

---

<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:** [July 25, 2024, 1:10pm UTC](https://forum.inductiveautomation.com/t/error-taghistorydatasourcesink-caused-by-wrong-storage-provider/93731/3 "2024-07-25T13:10:21Z")

</div>

> [@Aiasa21](#):
>
> `CREATE TABLE permission denied in database ' **myName**'.`

The error, for posterity, was this. Entirely on the MSSQL side of things; this means your DB was connected, and the server was explicitly rejecting Ignition trying to create tables.

---

<div class="post-metadata">

**Author:** ![Aiasa21](https://avatars.discourse-cdn.com/v4/letter/a/aeb1de/32.png) [@Aiasa21](https://forum.inductiveautomation.com/u/Aiasa21)\
**Post date:** [July 25, 2024, 1:14pm UTC](https://forum.inductiveautomation.com/t/error-taghistorydatasourcesink-caused-by-wrong-storage-provider/93731/4 "2024-07-25T13:14:34Z")

</div>

Thanks for the answer, ok this but I don't understand why since the moment I change the database provider to the correct one I had that alarm every minute until I reboot the server.
