# Gateway scripts stalling

**URL:** <https://forum.inductiveautomation.com/t/gateway-scripts-stalling/38020>\
**Category:** General Discussion\
**Tags:** ignition79\
**Created:** [August 24, 2020, 12:18pm UTC](https://forum.inductiveautomation.com/t/gateway-scripts-stalling/38020 "2020-08-24T12:18:53Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![patrick.garceau](https://avatars.discourse-cdn.com/v4/letter/p/76d3ee/32.png) [@patrick.garceau](https://forum.inductiveautomation.com/u/patrick.garceau)\
**Post date:** [August 24, 2020, 12:18pm UTC](https://forum.inductiveautomation.com/t/gateway-scripts-stalling/38020/1 "2020-08-24T12:18:53Z")

</div>

I have a gateway script that has stopped executing. For example, the status page says last execution was 5 days ago with a duration of 6 ms and s status of Success. But that timer should execute every 15 seconds, so why did it stop for 5 days? One thing is that I have two scripts, one every 5 seconds, and the second 15 seconds, they are not Shared as I was told that it could be a problem, so they are dedicated. So can someone explain to me why Ignition cannot execute two simple scripts and that we have to put man power to verify this every time it decides to stop by itself. The only way to resolve this is to connect to Ignition designer and save the project so It would re-initialize the timers. There has to be a better way, also note that there is no error logs. Last one is about 6 months ago, not 5 days.

---

<div class="post-metadata">

**Author:** ![Sanderd17](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/sanderd17/32/8735_2.png) [@Sanderd17](https://forum.inductiveautomation.com/u/Sanderd17)\
**Post date:** [August 24, 2020, 12:23pm UTC](https://forum.inductiveautomation.com/t/gateway-scripts-stalling/38020/2 "2020-08-24T12:23:50Z")

</div>

We have also seen this once. But there was too much noise in the logging, and we couldn’t reproduce it. So we never got in touch with support about this.

If you can reproduce it, you should definately contact support though.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [August 24, 2020, 12:52pm UTC](https://forum.inductiveautomation.com/t/gateway-scripts-stalling/38020/3 "2020-08-24T12:52:09Z")

</div>

Get a thread dump next time you notice this happening. I’ve never seen a case where scripts just up and stopped running. Usually they are blocked indefinitely on something, like a database call on a JDBC driver that doesn’t ever timeout by default.

---

<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:** [August 24, 2020, 1:08pm UTC](https://forum.inductiveautomation.com/t/gateway-scripts-stalling/38020/4 "2020-08-24T13:08:38Z")

</div>

Concur. Every single case I’ve encountered where scripts fail like this was due to programmer error. Most commonly an edit to a script module that introduced syntax errors. You get one logged error for that script failing to import then everything that depended on it goes silent. Particularly if your programmers are importing scripts into other scripts instead of using fully-qualified names everywhere.

---

<div class="post-metadata">

**Author:** ![PRAMANJ](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pramanj/32/66935_2.png) [@PRAMANJ](https://forum.inductiveautomation.com/u/PRAMANJ)\
**Post date:** [August 24, 2020, 1:29pm UTC](https://forum.inductiveautomation.com/t/gateway-scripts-stalling/38020/5 "2020-08-24T13:29:21Z")

</div>

> [@patrick.garceau](#):
>
> One thing is that I have two scripts, one every 5 seconds, and the second 15 seconds

Perhaps you could manage the two script from a single timer thread with a counter, if that improves the performance?

---

<div class="post-metadata">

**Author:** ![patrick.garceau](https://avatars.discourse-cdn.com/v4/letter/p/76d3ee/32.png) [@patrick.garceau](https://forum.inductiveautomation.com/u/patrick.garceau)\
**Post date:** [August 24, 2020, 1:39pm UTC](https://forum.inductiveautomation.com/t/gateway-scripts-stalling/38020/6 "2020-08-24T13:39:16Z")

</div>

There is no error on the script but there is an JDBC driver call. I added a new timer script that would reset the jdbc connection if there is a problem, i’ll see what that does. It also turns a bit to 1 saying that the script is running, so I see that the script is still 1 and calling the script puts it to 0 because the exit from the script will put it to 0 if its grater than a certain value, but the script won’t run still, so not sure yet, I may have to restart the Gateway script by name if there is such a function.

---

<div class="post-metadata">

**Author:** ![patrick.garceau](https://avatars.discourse-cdn.com/v4/letter/p/76d3ee/32.png) [@patrick.garceau](https://forum.inductiveautomation.com/u/patrick.garceau)\
**Post date:** [August 24, 2020, 1:43pm UTC](https://forum.inductiveautomation.com/t/gateway-scripts-stalling/38020/7 "2020-08-24T13:43:13Z")

</div>

I did not find any timeout parameter on the JDBC connection, is that part of the Connection String? Or Should I put this in the Extra Connection Properties?

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [August 24, 2020, 1:47pm UTC](https://forum.inductiveautomation.com/t/gateway-scripts-stalling/38020/8 "2020-08-24T13:47:15Z")

</div>

Which JDBC driver are you using and what version is it? Whether there is a property to control this and what it’s named will depend on the driver.

---

<div class="post-metadata">

**Author:** ![Sanderd17](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/sanderd17/32/8735_2.png) [@Sanderd17](https://forum.inductiveautomation.com/u/Sanderd17)\
**Post date:** [August 24, 2020, 2:11pm UTC](https://forum.inductiveautomation.com/t/gateway-scripts-stalling/38020/9 "2020-08-24T14:11:47Z")

</div>

> [@patrick.garceau](#):
>
> There is no error on the script but there is an JDBC driver call.

Perhaps it's related to your database issue: [Can I use a script to reconnect a database?](http://forum.inductiveautomation.com/t/can-i-use-a-script-to-reconnect-a-database/38018)

Maybe solving that will solve both.

---

<div class="post-metadata">

**Author:** ![harigobu.gb](https://avatars.discourse-cdn.com/v4/letter/h/b77776/32.png) [@harigobu.gb](https://forum.inductiveautomation.com/u/harigobu.gb)\
**Post date:** [February 1, 2021, 11:19am UTC](https://forum.inductiveautomation.com/t/gateway-scripts-stalling/38020/10 "2021-02-01T11:19:28Z")

</div>

Exactly same here today with 8.0.15.
