System.db.runPrepUpdate error on sketchy VPN connection

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:

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.

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

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

Otherwise, I don't know of any way to program around this.

1 Like

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.)

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.

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

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

S&F is fire and forget.