# An alarm could not be acknowledged. It may no longer be registered

**URL:** <https://forum.inductiveautomation.com/t/an-alarm-could-not-be-acknowledged-it-may-no-longer-be-registered/107302>\
**Category:** Ignition\
**Tags:** vision\
**Created:** [June 12, 2025, 12:42am UTC](https://forum.inductiveautomation.com/t/an-alarm-could-not-be-acknowledged-it-may-no-longer-be-registered/107302 "2025-06-12T00:42:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bebel](https://avatars.discourse-cdn.com/v4/letter/b/43a26b/32.png) [@bebel](https://forum.inductiveautomation.com/u/bebel)\
**Post date:** [June 12, 2025, 12:42am UTC](https://forum.inductiveautomation.com/t/an-alarm-could-not-be-acknowledged-it-may-no-longer-be-registered/107302/1 "2025-06-12T00:42:12Z")

</div>

I have a button in a Vision project that runs the following script:

```python
def ackAlarms():

	start = system.date.addHours(system.date.now(), -12)
	end = system.date.now()
	state = ['ActiveUnacked', 'ClearUnacked']
	data = system.alarm.queryJournal(startDate = start, endDate = end, state = state)
	# Create list of event IDs
	uuidList = [str(row.getId()) for row in data]
	system.alarm.acknowledge(uuidList,'ack')

system.util.invokeAsynchronous(ackAlarms)

```

Everything works fine and there are no errors on the client, but the gateway logs are filling up with the error: An alarm could not be acknowledged. It may no longer be registered. It is about 180 entries every time the acknowledge button is clicked.

In the forum I found suggestions to run in an Asynchornous thread, which I am already doing. Another suggestion was to restart the gateway, which had no effect.  
Since everything is working fine, I'll settle for a way to just not log the error, but it seems like if an alarm is no longer registered it would not be found by the query.  
Any further suggestions?

---

<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:** [June 12, 2025, 4:48pm UTC](https://forum.inductiveautomation.com/t/an-alarm-could-not-be-acknowledged-it-may-no-longer-be-registered/107302/2 "2025-06-12T16:48:40Z")

</div>

Try:

1. Put your `ackAlarms` code in the project library
2. Add a gateway message handler that simply calls the library function
3. Swap your Vision button to use [`system.util.sendMessage`](https://docs.inductiveautomation.com/docs/8.1/appendix/scripting-functions/system-util/system-util-sendMessage) to fire off a request

This has the same asynchronous benefit, but will actually run the alarm query and acknowledgement on the gateway, which should help minimize the risk of a data race, where the set of alarms returned in the query is different by the time the acknowledge call happens.

You may also need to check the list for duplicates - at a glance your function seems like it shouldn't be passing duplicate IDs but I don't remember alarming well enough to say that with 100% confidence.

---

<div class="post-metadata">

**Author:** ![bebel](https://avatars.discourse-cdn.com/v4/letter/b/43a26b/32.png) [@bebel](https://forum.inductiveautomation.com/u/bebel)\
**Post date:** [June 13, 2025, 12:45am UTC](https://forum.inductiveautomation.com/t/an-alarm-could-not-be-acknowledged-it-may-no-longer-be-registered/107302/3 "2025-06-13T00:45:08Z")

</div>

I had to wait until they were not running again to make the change and when I went back to the logs, I found that it was down to 8 errors instead of the 180 I was getting yesterday before making some changes. Perhaps they are clearing out slowly. I did follow through with your suggestion though. I can't say it made a difference but after pressing the button several times I am down to 7 errors per press. I didn't really think anything I did last night would have done anything. I just cleaned up the old commented out lines, for the most part.
