# Error initializing data sink

**URL:** <https://forum.inductiveautomation.com/t/error-initializing-data-sink/1627>\
**Category:** Ignition\
**Created:** [March 11, 2010, 3:26pm UTC](https://forum.inductiveautomation.com/t/error-initializing-data-sink/1627 "2010-03-11T15:26:12Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![mws2674](https://avatars.discourse-cdn.com/v4/letter/m/958977/32.png) [@mws2674](https://forum.inductiveautomation.com/u/mws2674)\
**Post date:** [March 11, 2010, 3:26pm UTC](https://forum.inductiveautomation.com/t/error-initializing-data-sink/1627/1 "2010-03-11T15:26:12Z")

</div>

This is one of a long list of errors I am seeing while either writing tag values, or refreshing devices.

Is this a db issue on my end, as I see it reference MySQLConn1.backup and .data

I noticed this because I am getting timeout errors when writing to tags.

[quote]com.inductiveautomation.ignition.gateway.web.pages.config.systemconsole.LogViewer$SerializableLoggingEvent$ClonedThrowable: error in script file line: 20 file input/output errorerror file input/output error C:\PROGRA~2\INDUCT~1\Ignition\contexts\main\datacache\MySQLConn1\MySQLConn1.data (The requested operation cannot be performed on a file with a user-mapped section open) C:\PROGRA~2\INDUCT~1\Ignition\contexts\main\datacache/MySQLConn1/MySQLConn1.backup opening file - file C:\PROGRA~2\INDUCT~1\Ignition\contexts\main\datacache/MySQLConn1/MySQLConn1.data  
org.hsqldb.jdbc.Util.sqlException(Util.java:363)  
org.hsqldb.jdbc.Util.sqlException(Util.java:103)  
org.hsqldb.jdbc.JDBCConnection.(JDBCConnection.java:3233)  
org.hsqldb.jdbc.JDBCDriver.getConnection(JDBCDriver.java:285)  
org.hsqldb.jdbc.JDBCDriver.connect(JDBCDriver.java:245)  
java.sql.DriverManager.getConnection(Unknown Source)  
java.sql.DriverManager.getConnection(Unknown Source)  
com.inductiveautomation.ignition.gateway.history.stores.HSQLDataStore.createInitialDatabase(HSQLDataStore.java:124)  
com.inductiveautomation.ignition.gateway.history.stores.HSQLDataStore.initialize(HSQLDataStore.java:54)  
com.inductiveautomation.ignition.gateway.history.sinks.AbstractSink.tryToInit(AbstractSink.java:81)  
com.inductiveautomation.ignition.gateway.history.sinks.AbstractSink.isAccepting(AbstractSink.java:98)  
com.inductiveautomation.ignition.gateway.history.ForwarderThread.run(ForwarderThread.java:74)  
com.inductiveautomation.ignition.gateway.web.pages.config.systemconsole.LogViewer$SerializableLoggingEvent$ClonedThrowable: error in script file line: 20 file input/output errorerror file input/output error C:\PROGRA~2\INDUCT~1\Ignition\contexts\main\datacache\MySQLConn1\MySQLConn1.data (The requested operation cannot be performed on a file with a user-mapped section open) C:\PROGRA~2\INDUCT~1\Ignition\contexts\main\datacache/MySQLConn1/MySQLConn1.backup opening file - file C:\PROGRA~2\INDUCT~1\Ignition\contexts\main\datacache/MySQLConn1/MySQLConn1.data  
org.hsqldb.error.Error.error(Error.java:112)  
org.hsqldb.scriptio.ScriptReaderText.readDDL(ScriptReaderText.java:129)  
org.hsqldb.scriptio.ScriptReaderBase.readAll(ScriptReaderBase.java:65)  
org.hsqldb.persist.Log.processScript(Log.java:786)  
org.hsqldb.persist.Log.open(Log.java:223)  
org.hsqldb.persist.Logger.openPersistence(Logger.java:233)  
org.hsqldb.Database.reopen(Database.java:265)  
org.hsqldb.Database.open(Database.java:237)  
org.hsqldb.DatabaseManager.getDatabase(DatabaseManager.java:225)  
org.hsqldb.DatabaseManager.newSession(DatabaseManager.java:148)  
org.hsqldb.jdbc.JDBCConnection.(JDBCConnection.java:3216)  
org.hsqldb.jdbc.JDBCDriver.getConnection(JDBCDriver.java:285)  
org.hsqldb.jdbc.JDBCDriver.connect(JDBCDriver.java:245)  
java.sql.DriverManager.getConnection(Unknown Source)  
java.sql.DriverManager.getConnection(Unknown Source)  
com.inductiveautomation.ignition.gateway.history.stores.HSQLDataStore.createInitialDatabase(HSQLDataStore.java:124)  
com.inductiveautomation.ignition.gateway.history.stores.HSQLDataStore.initialize(HSQLDataStore.java:54)  
com.inductiveautomation.ignition.gateway.history.sinks.AbstractSink.tryToInit(AbstractSink.java:81)  
com.inductiveautomation.ignition.gateway.history.sinks.AbstractSink.isAccepting(AbstractSink.java:98)  
com.inductiveautomation.ignition.gateway.history.ForwarderThread.run(ForwarderThread.java:74)[/quote]

---

<div class="post-metadata">

**Author:** ![Carl.Gould](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/carl.gould/32/7262_2.png) [@Carl.Gould](https://forum.inductiveautomation.com/u/Carl.Gould)\
**Post date:** [March 11, 2010, 5:00pm UTC](https://forum.inductiveautomation.com/t/error-initializing-data-sink/1627/2 "2010-03-11T17:00:09Z")

</div>

No, this is an issue with the datacache system’s persistent storage. It looks like it was corrupted. You’ll need to delete all of the folders under %Install\_Dir%/contexts/main/datacache and restart your Gateway.

There is currently a problem in the soft-restart system (which is used by actions like restoring a gateway backup) that can cause this problem. We will have it resolved soon.

---

<div class="post-metadata">

**Author:** ![mws2674](https://avatars.discourse-cdn.com/v4/letter/m/958977/32.png) [@mws2674](https://forum.inductiveautomation.com/u/mws2674)\
**Post date:** [March 11, 2010, 5:43pm UTC](https://forum.inductiveautomation.com/t/error-initializing-data-sink/1627/3 "2010-03-11T17:43:01Z")

</div>

That did the trick!!! Thank you very much!

---

<div class="post-metadata">

**Author:** ![mws2674](https://avatars.discourse-cdn.com/v4/letter/m/958977/32.png) [@mws2674](https://forum.inductiveautomation.com/u/mws2674)\
**Post date:** [March 12, 2010, 2:15pm UTC](https://forum.inductiveautomation.com/t/error-initializing-data-sink/1627/4 "2010-03-12T14:15:11Z")

</div>

Is it possible that writing too many tag values at one time could also corrupt this?

I am loading tag values with one button click:

[code]if valid:  
# Selects the machineNumber, and writes the values to the corresponding tag

```
value = event.source.parent.getComponent('mb_select').value
machineNumber = event.source.parent.parent.getComponent('DropDown_UnitSelect').selectedValue
tagPath = 'Unit%s/mb_select' %(machineNumber)
system.tag.writeToTag(tagPath, value)

value = event.source.parent.getComponent('drum_spd_val').text
machineNumber = event.source.parent.parent.getComponent('DropDown_UnitSelect').selectedValue
tagPath = 'Unit%s/Drum_SPD' %(machineNumber)
system.tag.writeToTag(tagPath, value)

value = event.source.parent.getComponent('trav_fast_val').text
machineNumber = event.source.parent.parent.getComponent('DropDown_UnitSelect').selectedValue
tagPath = 'Unit%s/Trav_Fast' %(machineNumber)
system.tag.writeToTag(tagPath, value)

value = event.source.parent.getComponent('trav_slow_val').text
machineNumber = event.source.parent.parent.getComponent('DropDown_UnitSelect').selectedValue
tagPath = 'Unit%s/Trav_Slow' %(machineNumber)
system.tag.writeToTag(tagPath, value)

value = event.source.parent.getComponent('trav_slow_val').text
machineNumber = event.source.parent.parent.getComponent('DropDown_UnitSelect').selectedValue
tagPath = 'Unit%s/Trav_Slow_SP' %(machineNumber)
system.tag.writeToTag(tagPath, value)

value = event.source.parent.getComponent('trav_slow_val 1').text
machineNumber = event.source.parent.parent.getComponent('DropDown_UnitSelect').selectedValue
tagPath = 'Unit%s/Trav_Slow_2_SP' %(machineNumber)
system.tag.writeToTag(tagPath, value)

value = event.source.parent.getComponent('Total_Weight').value
machineNumber = event.source.parent.parent.getComponent('DropDown_UnitSelect').selectedValue
tagPath = 'Unit%s/TTMW' %(machineNumber)
system.tag.writeToTag(tagPath, value)

# Slow pass count goes to PassCountSlow.PRE, and Body 1 Slow Cycle -- (Multibody Functionality)
value = event.source.parent.getComponent('slow_cyc_val').text
machineNumber = event.source.parent.parent.getComponent('DropDown_UnitSelect').selectedValue
tagPath = 'Unit%s/Pass_Count_Slow' %(machineNumber)
system.tag.writeToTag(tagPath, value)

value = event.source.parent.getComponent('slow_cyc_val').text
machineNumber = event.source.parent.parent.getComponent('DropDown_UnitSelect').selectedValue
tagPath = 'Unit%s/Body_1_Slow_Cycle' %(machineNumber)
system.tag.writeToTag(tagPath, value)

# Fast Pass count goes to PassCountFast.PRE, and Body 1 Fast Cycle -- (Multibody Functionality)
value = event.source.parent.getComponent('fast_cyc_val').text
machineNumber = event.source.parent.parent.getComponent('DropDown_UnitSelect').selectedValue
tagPath = 'Unit%s/Pass_Count_Fast' %(machineNumber)
system.tag.writeToTag(tagPath, value)

value = event.source.parent.getComponent('fast_cyc_val').text
machineNumber = event.source.parent.parent.getComponent('DropDown_UnitSelect').selectedValue
tagPath = 'Unit%s/Body_1_Fast_Cycle' %(machineNumber)
system.tag.writeToTag(tagPath, value)

value = event.source.parent.getComponent('slow_cyc_val 1').text
machineNumber = event.source.parent.parent.getComponent('DropDown_UnitSelect').selectedValue
tagPath = 'Unit%s/Body_2_Slow_Cycle' %(machineNumber)
system.tag.writeToTag(tagPath, value)

value = event.source.parent.getComponent('fast_cyc_val 1').text
machineNumber = event.source.parent.parent.getComponent('DropDown_UnitSelect').selectedValue
tagPath = 'Unit%s/Body_2_fast_Cycle' %(machineNumber)
system.tag.writeToTag(tagPath, value)

value = event.source.parent.getComponent('slow_cyc_val 2').text
machineNumber = event.source.parent.parent.getComponent('DropDown_UnitSelect').selectedValue
tagPath = 'Unit%s/Body_3_slow_Cycle' %(machineNumber)
system.tag.writeToTag(tagPath, value)

value = event.source.parent.getComponent('fast_cyc_val 2').text
machineNumber = event.source.parent.parent.getComponent('DropDown_UnitSelect').selectedValue
tagPath = 'Unit%s/Body_3_fast_Cycle' %(machineNumber)
system.tag.writeToTag(tagPath, value)

value = event.source.parent.getComponent('slow_cyc_val 3').text
machineNumber = event.source.parent.parent.getComponent('DropDown_UnitSelect').selectedValue
tagPath = 'Unit%s/Body_4_slow_Cycle' %(machineNumber)
system.tag.writeToTag(tagPath, value)

value = event.source.parent.getComponent('fast_cyc_val 3').text
machineNumber = event.source.parent.parent.getComponent('DropDown_UnitSelect').selectedValue
tagPath = 'Unit%s/Body_4_fast_Cycle' %(machineNumber)
system.tag.writeToTag(tagPath, value)

value = event.source.parent.getComponent('Body1_Weight').value
machineNumber = event.source.parent.parent.getComponent('DropDown_UnitSelect').selectedValue
tagPath = 'Unit%s/Body' %(machineNumber)
system.tag.writeToTag(tagPath, value)
	
value = event.source.parent.getComponent('Body2_Weight').value
machineNumber = event.source.parent.parent.getComponent('DropDown_UnitSelect').selectedValue
tagPath = 'Unit%s/Body_2_Weight' %(machineNumber)
system.tag.writeToTag(tagPath, value)

value = event.source.parent.getComponent('Body3_Weight').value
machineNumber = event.source.parent.parent.getComponent('DropDown_UnitSelect').selectedValue
tagPath = 'Unit%s/Body_3_Weight' %(machineNumber)
system.tag.writeToTag(tagPath, value)

value = event.source.parent.getComponent('Body4_Weight').value
machineNumber = event.source.parent.parent.getComponent('DropDown_UnitSelect').selectedValue
tagPath = 'Unit%s/Body_4_Weight' %(machineNumber)
system.tag.writeToTag(tagPath, value)

value = event.source.parent.parent.getComponent('PCODE_Display').getComponent('Label').text
machineNumber = event.source.parent.parent.getComponent('DropDown_UnitSelect').selectedValue
tagPath = 'Unit%s/STRING' %(machineNumber)
system.tag.writeToTag(tagPath, value)

value = event.source.parent.getComponent('Body1_Weight').value
machineNumber = event.source.parent.parent.getComponent('DropDown_UnitSelect').selectedValue
tagPath = 'Unit%s/b_weight1' %(machineNumber)
system.tag.writeToTag(tagPath, value)

value = event.source.parent.getComponent('Body2_Weight').value
machineNumber = event.source.parent.parent.getComponent('DropDown_UnitSelect').selectedValue
tagPath = 'Unit%s/Body_2_Weight' %(machineNumber)
system.tag.writeToTag(tagPath, value)

value = event.source.parent.getComponent('Begin_Weight 1').value
machineNumber = event.source.parent.parent.getComponent('DropDown_UnitSelect').selectedValue
tagPath = 'Unit%s/Beginning_Fast' %(machineNumber)
system.tag.writeToTag(tagPath, value)

value = event.source.parent.getComponent('End_Weight 1').value
machineNumber = event.source.parent.parent.getComponent('DropDown_UnitSelect').selectedValue
tagPath = 'Unit%s/Ending_Fast_Weight' %(machineNumber)
system.tag.writeToTag(tagPath, value)

value = event.source.parent.getComponent('Color_ID').text
machineNumber = event.source.parent.parent.getComponent('DropDown_UnitSelect').selectedValue
tagPath = 'Unit%s/CLR_Select' %(machineNumber)
system.tag.writeToTag(tagPath, value)

value = event.source.parent.getComponent('Color_Percent_Value').text
machineNumber = event.source.parent.parent.getComponent('DropDown_UnitSelect').selectedValue
tagPath = 'Unit%s/Color_Percent' %(machineNumber)
system.tag.writeToTag(tagPath, value)

fpmi.gui.messageBox("Data Loaded To Controller")[/code]

```

When I click on the load button, I get:

> [@](#):
>
> Error: Write timed out [C]

Once I get the write timed out error, I can no longer write tag values to the controller until the gateway is restarted. When the gateway is simply restarted, however, it still will not work, and the errors mentioned in the beginning of this post start. The only way to get it running again is to stop the gateway, delete the data cache, and then restart.  
Also, when this occurs, the gateway takes quite some time to actually stop, and generates the following message:

> [@](#):
>
> The Ignition Gateway is stopping ................................ A Specific error occurred: 1. The Ignition Gateway Service was stopped successfully More help is available by typing NET HELPMSG 3347

My guess is that too many values are trying to be written at one time, causing corruption of the data cache... ?

To test this theory, I split up the tag load by placing the following in two places:

import time  
time.sleep(1)

I thought that by doing this, it would allow a group of tags to be written before sending the next batch.

This does work, and all the tag values are being written. Unfortunately, this has caused a new problem. Now when I click the load button to write the tag values, I get to error messages, but they do not contain any information. Basically, just blank error messages. I would assume that I am way off base by using the time.sleep and that is the reason why these error messages appear.

If you can shed any light on this, it would be greatly appreciated.

Added:

I see that there is an output to the console associated with this blank error message:

[quote]ERROR [ClientTagUtilities$WriteListener-AWT-EventQueue-0]  
[/quote]

---

<div class="post-metadata">

**Author:** ![Carl.Gould](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/carl.gould/32/7262_2.png) [@Carl.Gould](https://forum.inductiveautomation.com/u/Carl.Gould)\
**Post date:** [March 12, 2010, 5:51pm UTC](https://forum.inductiveautomation.com/t/error-initializing-data-sink/1627/5 "2010-03-12T17:51:18Z")

</div>

Thanks for the detailed report. I don’t think that the writing of tags has anything to do with the datacache corruption - I think the datacache is getting corrupted when you do the restart to try and fix the blockage caused by the bulk tag write.

We will investigate the bulk tag write problem on our end and let you know what we find.

---

<div class="post-metadata">

**Author:** ![Carl.Gould](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/carl.gould/32/7262_2.png) [@Carl.Gould](https://forum.inductiveautomation.com/u/Carl.Gould)\
**Post date:** [March 12, 2010, 5:51pm UTC](https://forum.inductiveautomation.com/t/error-initializing-data-sink/1627/6 "2010-03-12T17:51:54Z")

</div>

Can you describe what kind of PLC you’re using, and what OPC Server (if not Ignition OPC-UA)

---

<div class="post-metadata">

**Author:** ![mws2674](https://avatars.discourse-cdn.com/v4/letter/m/958977/32.png) [@mws2674](https://forum.inductiveautomation.com/u/mws2674)\
**Post date:** [March 12, 2010, 6:08pm UTC](https://forum.inductiveautomation.com/t/error-initializing-data-sink/1627/7 "2010-03-12T18:08:20Z")

</div>

CompactLogix L35E and Ignition OPC-UA

---

<div class="post-metadata">

**Author:** ![Carl.Gould](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/carl.gould/32/7262_2.png) [@Carl.Gould](https://forum.inductiveautomation.com/u/Carl.Gould)\
**Post date:** [March 12, 2010, 6:21pm UTC](https://forum.inductiveautomation.com/t/error-initializing-data-sink/1627/8 "2010-03-12T18:21:03Z")

</div>

What version of Ignition are you running, and what are the settings on your device (write timeouts, etc)

---

<div class="post-metadata">

**Author:** ![mws2674](https://avatars.discourse-cdn.com/v4/letter/m/958977/32.png) [@mws2674](https://forum.inductiveautomation.com/u/mws2674)\
**Post date:** [March 12, 2010, 6:27pm UTC](https://forum.inductiveautomation.com/t/error-initializing-data-sink/1627/9 "2010-03-12T18:27:22Z")

</div>

Ignition Version 7.0.4 (b4594)

Browse Timeout - 30000  
Read Timeout - 30000  
Write Timeout - 30000

Communication Timeout - 2000  
Browse Cache Timeout - 0

---

<div class="post-metadata">

**Author:** ![Carl.Gould](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/carl.gould/32/7262_2.png) [@Carl.Gould](https://forum.inductiveautomation.com/u/Carl.Gould)\
**Post date:** [March 13, 2010, 12:42am UTC](https://forum.inductiveautomation.com/t/error-initializing-data-sink/1627/10 "2010-03-13T00:42:58Z")

</div>

We have identified the problem with the bulk tag writing, and it has been fixed for the upcoming 7.0.5 release.

The sink-corruption problem is totally separate, and has to do with the soft-restarts.

---

<div class="post-metadata">

**Author:** ![mws2674](https://avatars.discourse-cdn.com/v4/letter/m/958977/32.png) [@mws2674](https://forum.inductiveautomation.com/u/mws2674)\
**Post date:** [March 15, 2010, 4:05pm UTC](https://forum.inductiveautomation.com/t/error-initializing-data-sink/1627/11 "2010-03-15T16:05:08Z")

</div>

Thank you Carl.

Do you have an ETA for the 7.0.5 release?

---

<div class="post-metadata">

**Author:** ![Carl.Gould](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/carl.gould/32/7262_2.png) [@Carl.Gould](https://forum.inductiveautomation.com/u/Carl.Gould)\
**Post date:** [March 15, 2010, 7:08pm UTC](https://forum.inductiveautomation.com/t/error-initializing-data-sink/1627/12 "2010-03-15T19:08:00Z")

</div>

This afternoon if all goes well.

---

<div class="post-metadata">

**Author:** ![mws2674](https://avatars.discourse-cdn.com/v4/letter/m/958977/32.png) [@mws2674](https://forum.inductiveautomation.com/u/mws2674)\
**Post date:** [March 16, 2010, 1:00pm UTC](https://forum.inductiveautomation.com/t/error-initializing-data-sink/1627/13 "2010-03-16T13:00:33Z")

</div>

Got the new version, and the bulk tag write works perfect. Thank you guys!
