# Code in the gateway cannot run

**URL:** <https://forum.inductiveautomation.com/t/code-in-the-gateway-cannot-run/88804>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [April 15, 2024, 10:19am UTC](https://forum.inductiveautomation.com/t/code-in-the-gateway-cannot-run/88804 "2024-04-15T10:19:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ethan\_Carter](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ethan_carter/32/60139_2.png) [@Ethan\_Carter](https://forum.inductiveautomation.com/u/Ethan_Carter)\
**Post date:** [April 15, 2024, 10:19am UTC](https://forum.inductiveautomation.com/t/code-in-the-gateway-cannot-run/88804/1 "2024-04-15T10:19:55Z")

</div>

We are using version 8.1.28, and for some time today, we have been seeing errors like the following. At the same time, almost all scripts in the Gateway event scripts report the same error, but they can be executed normally in the Designer's script console.:

```auto
com.inductiveautomation.ignition.common.script.JythonExecException: Traceback (most recent call last): File "", line 1, in NameError: name 'ClockDriftDetector' is not defined

at org.python.core.Py.NameError(Py.java:261)

at org.python.core.PyFrame.getname(PyFrame.java:257)

at org.python.pycode._pyx106564.f$0(:1)

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

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

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

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

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

at com.inductiveautomation.ignition.gateway.project.ProjectScriptLifecycle$TrackingProjectScriptManager.runCode(ProjectScriptLifecycle.java:823)

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

at com.inductiveautomation.ignition.gateway.project.ProjectScriptLifecycle$TrackingProjectScriptManager.runCode(ProjectScriptLifecycle.java:804)

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

at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)

at java.base/java.util.concurrent.FutureTask.runAndReset(Unknown Source)

at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)

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: name 'ClockDriftDetector' is not defined

... 18 common frames omitted

```

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/8/b804e1bdb95e392caefac59788e76f0dfd17c96e.png)

There were no abnormal entries in the gateway logs during this time, and nobody saved the project. After about half an hour, it automatically recovered.

What issue might we have encountered?

---

<div class="post-metadata">

**Author:** ![Ethan\_Carter](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/ethan_carter/32/60139_2.png) [@Ethan\_Carter](https://forum.inductiveautomation.com/u/Ethan_Carter)\
**Post date:** [April 15, 2024, 10:23am UTC](https://forum.inductiveautomation.com/t/code-in-the-gateway-cannot-run/88804/2 "2024-04-15T10:23:21Z")

</div>

Another example.

```auto
com.inductiveautomation.ignition.common.script.JythonExecException: Traceback (most recent call last): File "", line 21, in File "", line 171, in finishModuleArray AttributeError: 'com.inductiveautomation.ignition.common.script.Pro' object has no attribute 'finishDataAppend'

at org.python.core.Py.AttributeError(Py.java:178)

at org.python.core.PyObject.noAttributeError(PyObject.java:965)

at org.python.core.PyObject. __getattr__ (PyObject.java:959)

at org.python.pycode._pyx112656.finishModuleArray$1(:37)

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

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

at org.python.core.PyBaseCode.call(PyBaseCode.java:134)

at org.python.core.PyFunction. __call__ (PyFunction.java:416)

at org.python.pycode._pyx106231.f$0(:21)

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

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

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

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

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

at com.inductiveautomation.ignition.gateway.project.ProjectScriptLifecycle$TrackingProjectScriptManager.runCode(ProjectScriptLifecycle.java:823)

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

at com.inductiveautomation.ignition.gateway.project.ProjectScriptLifecycle$TrackingProjectScriptManager.runCode(ProjectScriptLifecycle.java:804)

at com.inductiveautomation.ignition.common.script.TagChangeScriptExecutor$TagChangeExecutionCallback.execute(TagChangeScriptExecutor.java:242)

at com.inductiveautomation.ignition.common.script.TagChangeScriptExecutor$TagChangeExecutionCallback.execute(TagChangeScriptExecutor.java:194)

at com.inductiveautomation.ignition.common.util.SerialExecutionQueue$PollAndExecute.run(SerialExecutionQueue.java:102)

at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)

at java.base/java.util.concurrent.FutureTask.run(Unknown Source)

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: AttributeError: 'com.inductiveautomation.ignition.common.script.Pro' object has no attribute 'finishDataAppend'

... 25 common frames omitted

```

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/6/3680009d8fa75340b31b913849de63d127d2d99e.png)  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/e/1e6a575afc6f626400faf8add812a911dd8ca9b2.png)

---

<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:** [April 15, 2024, 12:17pm UTC](https://forum.inductiveautomation.com/t/code-in-the-gateway-cannot-run/88804/3 "2024-04-15T12:17:02Z")

</div>

You should review this topic:

> [@\[IGN-4437\] Ignition occasionally forgets how Python works?](https://forum.inductiveautomation.com/t/ign-4437-ignition-occasionally-forgets-how-python-works/69635):
>
> This is a difficult bug to describe and even harder to reproduce. But it's happening to me. I have written Python scripts, custom classes, etc. for our site. 99.9% of the time, they run fine. But, every once in a while, while calling a database and transforming the returned dataset into linked custom class objects using a Python script, I get a strange error that is making me think that Ignition is not loading its Python scripts correctly somehow . . . ? Is that even possible? So far, the …

Contact support if nothing there applies.
