# Tag Change events stopped working

**URL:** <https://forum.inductiveautomation.com/t/tag-change-events-stopped-working/117016>\
**Category:** Ignition\
**Tags:** scripting\
**Created:** [September 8, 2026, 10:33am UTC](https://forum.inductiveautomation.com/t/tag-change-events-stopped-working/117016 "2026-09-08T10:33:28Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![pgmo](https://avatars.discourse-cdn.com/v4/letter/p/d07c76/32.png) [@pgmo](https://forum.inductiveautomation.com/u/pgmo)\
**Post date:** [September 8, 2026, 10:33am UTC](https://forum.inductiveautomation.com/t/tag-change-events-stopped-working/117016/1 "2026-09-08T10:33:28Z")

</div>

Hi all,

after defining a few tag change events at the project level:

![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/4/24d12174f16eb36e109b68080046c20529d221f1.png)

all of a sudden none of them runs anymore and each time I try to save changes to those events next messages appear in the wrapper log

![image](https://us1.discourse-cdn.com/inductiveautomation/optimized/3X/7/1/71ed5658343c69b452ee7af7752fc343374ce591_2_690x31.png)

I tried closing/reopening the project, but nothing runs any longer.

No syntax errors are in any script.

Any idea?

Ignition version **8.3.8 (b2026071409)**

Thanks, regards

**UPDATE**

After Gateway restart, tag change events works again - in a running plant that's not an option!!

**UPDATE 2**

It's enough to add an `if newValue.value:` test before calling my function respecting needed indentation that the following message appears

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/d/2d4c1cf47f0548c13b2e6e8542ff6530970f4f88.png)

---

<div class="post-metadata">

**Author:** ![Greyship](https://avatars.discourse-cdn.com/v4/letter/g/898d66/32.png) [@Greyship](https://forum.inductiveautomation.com/u/Greyship)\
**Post date:** [September 8, 2026, 10:55am UTC](https://forum.inductiveautomation.com/t/tag-change-events-stopped-working/117016/2 "2026-09-08T10:55:27Z")

</div>

What do those events contain? Might not be a syntax error, but other things could be causing script crashes...

---

<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:** [September 8, 2026, 12:41pm UTC](https://forum.inductiveautomation.com/t/tag-change-events-stopped-working/117016/3 "2026-09-08T12:41:53Z")

</div>

> [@Greyship](#):
>
> but other things could be causing script crashes

Not so much crashes, but stalls. Each tag change event is given **one** dedicated thread to process all incoming events. If the script includes any code that sleeps, or waits for a condition, other events will pile up behind it.

When this happens, you should check the gateway script monitoring pages, and perhaps take a thread dump. This will help you find the stuck spot.

---

<div class="post-metadata">

**Author:** ![pgmo](https://avatars.discourse-cdn.com/v4/letter/p/d07c76/32.png) [@pgmo](https://forum.inductiveautomation.com/u/pgmo)\
**Post date:** [September 8, 2026, 1:02pm UTC](https://forum.inductiveautomation.com/t/tag-change-events-stopped-working/117016/4 "2026-09-08T13:02:17Z")

</div>

No scripts running:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/2/d/2d019d16c51c9fccdb06f36dfa7169499170649d.png)

When my tcp server is waiting for messages, my script appears correctly here.

---

<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:** [September 8, 2026, 1:45pm UTC](https://forum.inductiveautomation.com/t/tag-change-events-stopped-working/117016/5 "2026-09-08T13:45:02Z")

</div>

Running a TCP server from a tag change script seems suspicious. You will have to share those two scripts.

---

<div class="post-metadata">

**Author:** ![pgmo](https://avatars.discourse-cdn.com/v4/letter/p/d07c76/32.png) [@pgmo](https://forum.inductiveautomation.com/u/pgmo)\
**Post date:** [September 8, 2026, 3:13pm UTC](https://forum.inductiveautomation.com/t/tag-change-events-stopped-working/117016/6 "2026-09-08T15:13:51Z")

</div>

```python
def __startServer__ (listenPort,listenTimeout,recvBufferLen,tagPathBase):
    server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    server.bind(('0.0.0.0', listenPort))
    server.listen(10)

    system.tag.writeBlocking(["{}/dataRecv".format(tagPathBase)
                            ,"{}/clientHasDisconnected".format(tagPathBase)], ['',False])
    
    client_socket, addr = server.accept()
    client_socket.settimeout(listenTimeout)
    server.close()
    system.tag.writeBlocking(["{}/startServer".format(tagPathBase)], [False])

    bb=bytearray()
    while True:
        try:
            chunk = client_socket.recv(recvBufferLen)
            if not chunk: 
                print("Sensor disconnected")
                system.tag.writeBlocking(["{}/clientHasDisconnected".format(tagPathBase)], [True])
                break
            bb.extend(chunk)
        except socket.timeout:
            if bb:
                process_frame(tagPathBase,bb)
                #buffer.clear()        
                del bb[:]

```

where ` __startServer__ ` is called by a `system.util.invokeAsynchronous`

That's the code: I don't think anything is wrong. I think that Tag Change script editor is doing something wrong in this 8.3.8 version: why should starting the script with an `if` clause be wrong, if indentation is correct? Never happened before. Moreover after restarting the gateway all is working correctly, no tag change event get missed. What's that "missing event subscriber for an annotated event"? Nothing to do with my script, I think

---

<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:** [September 8, 2026, 3:21pm UTC](https://forum.inductiveautomation.com/t/tag-change-events-stopped-working/117016/7 "2026-09-08T15:21:19Z")

</div>

> [@pgmo](#):
>
> I don't think anything is wrong.

You are launching a long-lived thread with no tracking of it in a persistent way, and with no way to safely kill and replace it. This is recipe for leaking memory and blocking many threads indefinitely, all leading to gateway crashes/misbehavior. Some guidance:

[https://forum.inductiveautomation.com/search?q=long%20lived%20thread%20getGlobals%20order%3Alatest](https://forum.inductiveautomation.com/search?q=long%20lived%20thread%20getGlobals%20order%3Alatest)

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [September 8, 2026, 4:40pm UTC](https://forum.inductiveautomation.com/t/tag-change-events-stopped-working/117016/8 "2026-09-08T16:40:57Z")

</div>

> [@pgmo](#):
>
> I think that Tag Change script editor is doing something wrong in this 8.3.8 version: why should starting the script with an `if` clause be wrong, if indentation is correct? Never happened before.

The syntax error warning is a bug in the editor that's fixed in 8.3.9, but it's _just_ a bug in the editor; actual script compilation and execution are unaffected, so it's not the root cause of whatever else is going on.
