Gateway Event Timer Script Error

I have a Gateway Timer Script set to run every 20 seconds. In the Gateway Scripts page on the Gateway, the script shows up as an Error for about 3-5 seconds and then reverts to Success. It says Success for most of the time and it takes the script about 80 milliseconds to run. What should I do to fix this?

Traceback (most recent call last):
File “<TimerScript:ParkdaleIgnition/JSON Script @20,000ms >”, line 64, in
at com.inductiveautomation.ignition.common.script.builtin.AbstractDBUtilities.error(AbstractDBUtilities.java:364)

at com.inductiveautomation.ignition.common.script.builtin.AbstractDBUtilities.execSProcCall(AbstractDBUtilities.java:492)

at sun.reflect.GeneratedMethodAccessor99.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

java.lang.Exception: java.lang.Exception: Error executing system.db.execSProcCall()

7.9.3 (b2017060210)
Oracle Corporation 1.8.0_141

Can you post the script?

Expand the details on that exception and follow the chain of cause to the SQLException thrown by your database.

Here are the details on the exception, but I’m not sure where to go from here.

com.inductiveautomation.ignition.common.script.JythonExecException: Traceback (most recent call last): File “”, line 64, in at com.inductiveautomation.ignition.common.script.builtin.AbstractDBUtilities.error(AbstractDBUtilities.java:364) at com.inductiveautomation.ignition.common.script.builtin.AbstractDBUtilities.execSProcCall(AbstractDBUtilities.java:492) at sun.reflect.GeneratedMethodAccessor99.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) java.lang.Exception: java.lang.Exception: Error executing system.db.execSProcCall()

at org.python.core.Py.JavaError(Py.java:495)

at com.inductiveautomation.ignition.common.script.builtin.AbstractDBUtilities.error(AbstractDBUtilities.java:364)

at com.inductiveautomation.ignition.common.script.builtin.AbstractDBUtilities.execSProcCall(AbstractDBUtilities.java:492)

at sun.reflect.GeneratedMethodAccessor99.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at org.python.core.PyReflectedFunction.call(PyReflectedFunction.java:186)

at com.inductiveautomation.ignition.common.script.ScriptManager$ReflectedInstanceFunction.call(ScriptManager.java:438)

at org.python.core.PyObject.call(PyObject.java:387)

at org.python.core.PyObject.call(PyObject.java:391)

at org.python.pycode._pyx44.f$0(:133)

at org.python.pycode._pyx44.call_function()

at org.python.core.PyTableCode.call(PyTableCode.java:165)

at org.python.core.PyCode.call(PyCode.java:18)

at org.python.core.Py.runCode(Py.java:1275)

at com.inductiveautomation.ignition.common.script.ScriptManager.runCode(ScriptManager.java:657)

at com.inductiveautomation.ignition.common.script.ScriptManager.runCode(ScriptManager.java:616)

at com.inductiveautomation.ignition.common.script.TimerScriptTask.run(TimerScriptTask.java:86)

at java.util.TimerThread.mainLoop(Unknown Source)

at java.util.TimerThread.run(Unknown Source)

Caused by: org.python.core.PyException: Traceback (most recent call last): File “”, line 64, in at com.inductiveautomation.ignition.common.script.builtin.AbstractDBUtilities.error(AbstractDBUtilities.java:364) at com.inductiveautomation.ignition.common.script.builtin.AbstractDBUtilities.execSProcCall(AbstractDBUtilities.java:492) at sun.reflect.GeneratedMethodAccessor99.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) java.lang.Exception: java.lang.Exception: Error executing system.db.execSProcCall()

… 20 common frames omitted

Caused by: java.lang.Exception: Error executing system.db.execSProcCall()

… 19 common frames omitted

Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: The query was canceled.

at com.microsoft.sqlserver.jdbc.TDSCommand.checkForInterrupt(IOBuffer.java:4214)

at com.microsoft.sqlserver.jdbc.TDSParser.parse(tdsparser.java:70)

at com.microsoft.sqlserver.jdbc.SQLServerStatement.getNextResult(SQLServerStatement.java:1449)

at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.doExecutePreparedStatement(SQLServerPreparedStatement.java:388)

at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement$PrepStmtExecCmd.doExecute(SQLServerPreparedStatement.java:338)

at com.microsoft.sqlserver.jdbc.TDSCommand.execute(IOBuffer.java:4026)

at com.microsoft.sqlserver.jdbc.SQLServerConnection.executeCommand(SQLServerConnection.java:1416)

at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeCommand(SQLServerStatement.java:185)

at com.microsoft.sqlserver.jdbc.SQLServerStatement.executeStatement(SQLServerStatement.java:160)

at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.execute(SQLServerPreparedStatement.java:320)

at org.apache.commons.dbcp.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:169)

at com.inductiveautomation.ignition.gateway.datasource.SRConnectionWrapper$SRPreparedStatement.execute(SRConnectionWrapper.java:934)

at com.inductiveautomation.ignition.gateway.script.GatewayDBUtilities._callSProc(GatewayDBUtilities.java:230)

at com.inductiveautomation.ignition.gateway.script.GatewayDBUtilities._call(GatewayDBUtilities.java:284)

at com.inductiveautomation.ignition.common.script.builtin.AbstractDBUtilities.execSProcCall(AbstractDBUtilities.java:490)

… 17 common frames omitted

Microsoft is pretty unhelpful here. Did it time out, by chance?

How would I figure that out? There was nothing that I could see that was wrong in the network and there was not an event that was created for this that I could see in the Event Viewer (unless I was looking in the wrong place).

I would look in your database logs. And turn on more logging in the database if it doesn’t give you the detail you need.

Also, consider extracting the actual SQL statement and running it from Microsoft’s Management Studio.