# System.db.runPrepUpdate error on sketchy VPN connection

**URL:** <https://forum.inductiveautomation.com/t/system-db-runprepupdate-error-on-sketchy-vpn-connection/108370>\
**Category:** Ignition\
**Created:** [July 11, 2025, 12:27pm UTC](https://forum.inductiveautomation.com/t/system-db-runprepupdate-error-on-sketchy-vpn-connection/108370 "2025-07-11T12:27:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Duffanator](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/duffanator/32/3560_2.png) [@Duffanator](https://forum.inductiveautomation.com/u/Duffanator)\
**Post date:** [July 11, 2025, 12:27pm UTC](https://forum.inductiveautomation.com/t/system-db-runprepupdate-error-on-sketchy-vpn-connection/108370/1 "2025-07-11T12:27:59Z")

</div>

Hello all,

We have a plant that is on a point to point VPN connection that is kind of flaky. They are running some Ignition clients that connect to a gateway on our main network and occasionally when they are doing some print functions and the client is trying to run an Insert query they get the following error:

```python
Caused by: java.lang.Exception: Error executing system.db.runPrepUpdate(INSERT INTO Label_TyronePrintAudit (tstamp, Username, Computer, ProductCode, Template) VALUES (?, ?, ?, ?, ?) , [Thu Jul 10 10:38:01 EDT 2025, blah, blah152, 6709, 4x3 Further Process Product - other text Tyrone], IgnitionDB, , false, false)
    ... 55 more
Caused by: com.inductiveautomation.ignition.client.gateway_interface.GatewayException: Connection reset
    at com.inductiveautomation.ignition.client.gateway_interface.GatewayInterface.newGatewayException(GatewayInterface.java:360)
    at com.inductiveautomation.ignition.client.gateway_interface.GatewayInterface.getResponse(GatewayInterface.java:556)
    at com.inductiveautomation.ignition.client.gateway_interface.GatewayInterface.sendMessage(GatewayInterface.java:292)
    at com.inductiveautomation.ignition.client.gateway_interface.GatewayInterface.sendMessage(GatewayInterface.java:287)
    at com.inductiveautomation.ignition.client.script.ClientDBUtilities._runPrepStmt(ClientDBUtilities.java:293)
    at com.inductiveautomation.ignition.common.script.builtin.AbstractDBUtilities.runPrepUpdate(AbstractDBUtilities.java:261)
    ... 53 more
Caused by: java.net.SocketException: Connection reset
    at java.base/sun.nio.ch.NioSocketImpl.implRead(Unknown Source)
    at java.base/sun.nio.ch.NioSocketImpl.read(Unknown Source)
    at java.base/sun.nio.ch.NioSocketImpl$1.read(Unknown Source)
    at java.base/java.net.Socket$SocketInputStream.read(Unknown Source)
    at java.base/java.io.BufferedInputStream.fill(Unknown Source)
    at java.base/java.io.BufferedInputStream.read1(Unknown Source)
    at java.base/java.io.BufferedInputStream.read(Unknown Source)
    at java.base/sun.net.www.http.HttpClient.parseHTTPHeader(Unknown Source)
    at java.base/sun.net.www.http.HttpClient.parseHTTP(Unknown Source)
    at java.base/sun.net.www.http.HttpClient.parseHTTP(Unknown Source)
    at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(Unknown Source)
    at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
    at java.base/java.net.HttpURLConnection.getResponseCode(Unknown Source)
    at com.inductiveautomation.ignition.client.gateway_interface.GatewayInterface.getResponse(GatewayInterface.java:450)

```

I'm sure this is because the VPN connection isn't the best because no one else that runs this same project has this issue. Long term fix is a better connection which is being worked on currently, but in the short term is there a way to code around this? Are there any timeouts that can be adjusted somewhere that may mitigate this error? I don't see anything specific called out in the help documents.

---

<div class="post-metadata">

**Author:** ![lrose](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/lrose/32/62724_2.png) [@lrose](https://forum.inductiveautomation.com/u/lrose)\
**Post date:** [July 11, 2025, 12:39pm UTC](https://forum.inductiveautomation.com/t/system-db-runprepupdate-error-on-sketchy-vpn-connection/108370/2 "2025-07-11T12:39:02Z")

</div>

I would recomend using `system.db.runSFPrepUpdate()`.

This is one of the main uses of the Store and Forward system.

> **[Store and Forward | Ignition User Manual](https://www.docs.inductiveautomation.com/docs/8.1/platform/database-connections/store-and-forward#store-and-forward-for-reliability)**
>
> The store-and-forward system provides a reliable way for Ignition to store data to the database. In Ignition, systems such as Tag Historian and SQL Bridge (Transaction Groups) use store-and-forward to ensure that data reaches its destination in the...

Otherwise, I don't know of any way to program around 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:** [July 11, 2025, 12:52pm UTC](https://forum.inductiveautomation.com/t/system-db-runprepupdate-error-on-sketchy-vpn-connection/108370/3 "2025-07-11T12:52:39Z")

</div>

> [@Duffanator](#):
>
> `Caused by: java.net.SocketException: Connection reset`

Your infra (VPN) is deliberately breaking the connection during its "glitch". If you need a return value from the insert in your script, there's no fix within Ignition. (Store and Forward gives no feedback.)

---

<div class="post-metadata">

**Author:** ![Duffanator](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/duffanator/32/3560_2.png) [@Duffanator](https://forum.inductiveautomation.com/u/Duffanator)\
**Post date:** [July 11, 2025, 1:01pm UTC](https://forum.inductiveautomation.com/t/system-db-runprepupdate-error-on-sketchy-vpn-connection/108370/4 "2025-07-11T13:01:25Z")

</div>

Ahhh, I wasn't sure if that would help or not because the clients are losing connection to the gateway, not the database. Does it store locally on the client? I guess I can try it and see if it helps at all.

@pturmel I don't need any return value, just writting some audit log information to the DB.

---

<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:** [July 11, 2025, 1:37pm UTC](https://forum.inductiveautomation.com/t/system-db-runprepupdate-error-on-sketchy-vpn-connection/108370/5 "2025-07-11T13:37:58Z")

</div>

> [@Duffanator](#):
>
> clients are losing connection to the gateway, not the database

Vision clients don't talk to databases directly. All database operations are delegated to the gateway.

> [@Duffanator](#):
>
> I don't need any return value

Use the S&F system. Presumably `system.db.runSFPrepUpdate()`. (There is no `.runSFPrepQuery`.)

S&F is fire and forget.
