I'm getting a repeated error in a gateway scheduled script that doesn't make sense to me. Starting over the weekend, an hourly scheduled script just stopped finding the project library script and errors every time it runs.
Here are some screenshots and the relevant callstack trace:
com.inductiveautomation.ignition.common.script.JythonExecException: Traceback (most recent call last): File "", line 6, in onScheduledEvent NameError: global name 'OEE_Metrics' is not defined
at org.python.core.Py.NameError(Py.java:261)
at org.python.core.PyFrame.getglobal(PyFrame.java:265)
at org.python.pycode._pyx3369.onScheduledEvent$1(:6)
at org.python.pycode._pyx3369.call_function()
at org.python.core.PyTableCode.call(PyTableCode.java:173)
at org.python.core.PyBaseCode.call(PyBaseCode.java:306)
at org.python.core.PyFunction.function___call__(PyFunction.java:474)
at org.python.core.PyFunction.__call__(PyFunction.java:469)
at org.python.core.PyFunction.__call__(PyFunction.java:464)
at com.inductiveautomation.ignition.common.script.ScriptManager.runFunction(ScriptManager.java:846)
at com.inductiveautomation.ignition.common.script.ScriptManager.runFunction(ScriptManager.java:828)
at com.inductiveautomation.ignition.gateway.project.ProjectScriptLifecycle$TrackingProjectScriptManager.runFunction(ProjectScriptLifecycle.java:832)
at com.inductiveautomation.ignition.common.script.ScriptManager$ScriptFunctionImpl.invoke(ScriptManager.java:1009)
at com.inductiveautomation.ignition.gateway.project.ProjectScriptLifecycle$AutoRecompilingScriptFunction.invoke(ProjectScriptLifecycle.java:897)
at com.inductiveautomation.ignition.common.script.ScheduledScriptManager$ScheduledScriptTask.run(ScheduledScriptManager.java:173)
at com.inductiveautomation.ignition.common.util.ExecutionQueue$PollAndExecute.run(ExecutionQueue.java:239)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
Caused by: org.python.core.PyException: NameError: global name 'OEE_Metrics' is not defined
... 19 common frames omitted
I'm not sure why this is happening, because I think the project library scripts should be in scope automatically. It's also weird because it was working just fine last week, and I can't find any change made that could've caused this issue.
Any ideas on how to fix this?
Should I just try a gateway restart (undesirable on this production gateway)?
Is this a bug in Ignition?
Ignition v8.1.27 (b2023042509)