Tag Change events stopped working

Hi all,

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

image

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

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

What do those events contain? Might not be a syntax error, 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.

No scripts running:

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

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

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

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

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.