# Jython script execution just disappearing during Java library call?

**URL:** <https://forum.inductiveautomation.com/t/jython-script-execution-just-disappearing-during-java-library-call/100050>\
**Category:** Ignition\
**Created:** [December 19, 2024, 4:29pm UTC](https://forum.inductiveautomation.com/t/jython-script-execution-just-disappearing-during-java-library-call/100050 "2024-12-19T16:29:28Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![justin.brzozoski](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justin.brzozoski/32/13452_2.png) [@justin.brzozoski](https://forum.inductiveautomation.com/u/justin.brzozoski)\
**Post date:** [December 19, 2024, 4:29pm UTC](https://forum.inductiveautomation.com/t/jython-script-execution-just-disappearing-during-java-library-call/100050/1 "2024-12-19T16:29:28Z")

</div>

I've intermittently been hitting an issue that behaves like a script hitting an exception, but I'm not seeing any exceptions. As a simplified example, let's say I have a script like this:

```python
logger = system.util.getLogger('FOO')
from java.lang.System import nanoTime
def myFunc():
    logger.info(u'At stage 1')
    timestamp = nanoTime()
    logger.info(u'At stage 2')
    return

```

If I call that function enough times, I eventually see "At stage 1" in the logs without a matching "At stage 2" and NO EXCEPTION.

The real function where this happens is much bigger and does lots of other work, but I have narrowed down the point of disappearance specifically to a nanoTime call. It goes in and it never returns.

I can see that the script disappears from the gateway's "Running Scripts" status page.

What is going on?

---

<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:** [December 19, 2024, 5:01pm UTC](https://forum.inductiveautomation.com/t/jython-script-execution-just-disappearing-during-java-library-call/100050/2 "2024-12-19T17:01:42Z")

</div>

There probably is an exception, but exceptions in scripts are generally only ever logged **once** at INFO or higher, with repeats at DEBUG.

Do your own exception handling and logging, preferably with the dual clause form that catch both jython and java errors.

---

<div class="post-metadata">

**Author:** ![justin.brzozoski](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justin.brzozoski/32/13452_2.png) [@justin.brzozoski](https://forum.inductiveautomation.com/u/justin.brzozoski)\
**Post date:** [December 19, 2024, 5:45pm UTC](https://forum.inductiveautomation.com/t/jython-script-execution-just-disappearing-during-java-library-call/100050/3 "2024-12-19T17:45:11Z")

</div>

Yeah, I'm aware of the script exception downgrade. I believe it resets the next exception to full when the script file is changed or if the whole gateway is restarted. I was able to recreate this on my devstation after a restart and there was nothing in the logs.

I'll add a try/except with the dual clause as an experiment, but I'm not expecting much.

---

<div class="post-metadata">

**Author:** ![justin.brzozoski](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justin.brzozoski/32/13452_2.png) [@justin.brzozoski](https://forum.inductiveautomation.com/u/justin.brzozoski)\
**Post date:** [December 19, 2024, 6:20pm UTC](https://forum.inductiveautomation.com/t/jython-script-execution-just-disappearing-during-java-library-call/100050/4 "2024-12-19T18:20:40Z")

</div>

Nope. I was wrong, You were right. Even more dumb, the exception was in the logger statement just after the nanoTime. My version had some variables it was trying to print to give more debug hints, and one of those had a typo.

I'm going to go be embarrassed for a while.
