# Ative address-list find and API queries fail with "no such item (4)" during natural entry expiry — SUP-226958

**URL:** <https://forum.mikrotik.com/t/ative-address-list-find-and-api-queries-fail-with-no-such-item-4-during-natural-entry-expiry-sup-226958/274277>\
**Category:** General\
**Created:** [November 5, 2026, 7:38am UTC](https://forum.mikrotik.com/t/ative-address-list-find-and-api-queries-fail-with-no-such-item-4-during-natural-entry-expiry-sup-226958/274277 "2026-11-05T07:38:34Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![peri](https://forum.mikrotik.com/letter_avatar/peri/32/6_449c533f586939b6e5f246632a46421f.png) [@peri](https://forum.mikrotik.com/u/peri)\
**Post date:** [November 5, 2026, 7:38am UTC](https://forum.mikrotik.com/t/ative-address-list-find-and-api-queries-fail-with-no-such-item-4-during-natural-entry-expiry-sup-226958/274277/1 "2026-11-05T07:38:34Z")

</div>

Hello everyone,

I have reported this issue to MikroTik Support under **\*\*ticket SUP-226958\*\*** , but have not received a reply yet. I am posting the confirmed reproduction results here in the hope that MikroTik and other users can help confirm and investigate the issue.

The issue was first observed on a physical RouterBOARD and was subsequently reproduced in independent CHR test environments. It has therefore not been observed exclusively on CHR.

**## Problem**

While dynamic entries in `/ip firewall address-list` are expiring naturally, the following lookup can fail:

```routeros

:local found [/ip firewall address-list find list=$targetList address=$ipAddress]

```

The error is:

```text

no such item (4)

```

**\*\*The failure occurs during the lookup itself, before any subsequent `get` or `set` operation.\*\***

The target entry in the controlled tests had a 10-minute timeout. After the lookup failed, the same entry could still be read using its previously saved original ID, with more than seven minutes remaining. The failure therefore cannot simply be explained as an attempt to access a target whose ID became invalid after expiry.

**## Tested environments**

| Environment | RouterOS version | Observation |

| --- | --- | --- |

| RB5009UPr+S+, ARM64 | 7.24.5 | Native `find` failure captured during normal operation |

| CHR on QEMU | 7.24.5 and 7.25 | Reproduced in controlled tests |

| CHR on VMware | 7.24.5 | Reproduced using the same reproduction script |

These are the versions on which the behavior has actually been verified. Later releases have not yet been specifically retested for this issue.

**## Key findings**

1. **\*\*More than 10,000 entries are not required.\*\***

The issue was also reproduced with 1,000 total entries, approximately 129.5 seconds after entry creation began. An earlier test at the same population did not reproduce the failure, so no deterministic population threshold has been established, and I am not claiming that every run fails.

2. **\*\*No entries were actively deleted or modified during observation.\*\***

The tests created short-lived entries and one longer-lived target, then repeatedly queried the target. The short-lived entries expired naturally in RouterOS.

3. **\*\*The expiring entries do not have to belong to the queried list.\*\***

In a separate 4,000-entry test, the queried list contained only one longer-lived target throughout the test. All 3,999 short-lived entries were placed in another list, yet the lookup failure still occurred.

4. **\*\*The failure can also occur without a RouterOS query script running.\*\***

After the data preparation script had finished, an external client queried by list and address through the native API. It still received the following server response:

```text

!trap

=category=4

=message=no such item (4)

!empty

!done

```

The client consumed the complete response through `!done` before issuing a diagnostic query using the original ID. The target entry still existed.

These results indicate that the issue cannot be explained solely by script variable assignment, array handling, or a race between `find` and a subsequent `get` or `set`. However, **\*\*the exact internal RouterOS failure mechanism has not been established\*\***. I am not presenting assumptions about cursors, indexes, or expiry cleanup internals as confirmed facts.

**## Questions**

- Is this a known issue, and is there a corresponding issue reference or a release containing a fix?

- Should conditional queries continue to return normally while dynamic entries expire, rather than raising this error?

- If the issue has not yet been fixed, is there an officially supported workaround that preserves lookup correctness?

Thank you for your help. I would also appreciate an update from MikroTik Support on **\*\*SUP-226958\*\***.

---

<div class="post-metadata">

**Author:** ![BartoszP](https://forum.mikrotik.com/user_avatar/forum.mikrotik.com/bartoszp/32/1386_2.png) [@BartoszP](https://forum.mikrotik.com/u/BartoszP)\
**Post date:** [November 6, 2026, 9:21am UTC](https://forum.mikrotik.com/t/ative-address-list-find-and-api-queries-fail-with-no-such-item-4-during-natural-entry-expiry-sup-226958/274277/2 "2026-11-06T09:21:18Z")

</div>

> [@peri](#):
>
> :local found [/ip firewall address-list find list=$targetList address=$ipAddress]  
> The error is:  
> no such item (4)  
> **\*\*The failure occurs during the lookup itself, before any subsequent `get` or `set` operation.\*\***
> 
> The target entry in the controlled tests had a 10-minute timeout. After the lookup failed, the same entry could still be read using its previously saved original ID, with more than seven minutes remaining. The failure therefore cannot simply be explained as an attempt to access a target whose ID became invalid after expiry.

Can you post exact values used for the query?

What was the value of $targetList?  
Did $targetList existed at all during query?  
What was the value of $ipAddress?  
Why to you access value of an object with temporary internal id?  
Why do you assume that they are valid all the time?

Please do not use AI to prepare answers to these questions as AI is not reliable as it "presents assumptions about cursors, indexes, or expiry cleanup internals as confirmed facts".

---

<div class="post-metadata">

**Author:** ![peri](https://forum.mikrotik.com/letter_avatar/peri/32/6_449c533f586939b6e5f246632a46421f.png) [@peri](https://forum.mikrotik.com/u/peri)\
**Post date:** [November 8, 2026, 3:16am UTC](https://forum.mikrotik.com/t/ative-address-list-find-and-api-queries-fail-with-no-such-item-4-during-natural-entry-expiry-sup-226958/274277/3 "2026-11-08T03:16:03Z")

</div>

Thank you for your questions. I am providing the exact executed reproduction script and its corresponding results so that the

behavior can be checked directly.

Attachment: reproduce-1000.rsc

**### Exact query values**

The script explicitly assigns:

:local targetList "CX78SIZE\_20261027\_HST"

:local ipAddress "18.65.112.43"

The failing statement is:

:local found [/ip firewall address-list find list=$targetList address=$ipAddress]

This query uses the list name and address, not a previously saved internal ID.

**### Test setup**

The recorded run used CHR on QEMU, RouterOS 7.25.

The script creates 1,000 address-list entries:

List Entries Timeout

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ━━━━━━━━━ ━━━━━━━━━━━━

CX78SIZE\_20261027\_HST 233 2 minutes

───────────────────────────────────────────── ───────── ────────────

CX78SIZE\_20261027\_HST — target 18.65.112.43 1 10 minutes

───────────────────────────────────────────── ───────── ────────────

CX78SIZE\_20261027\_OTHER 766 2 minutes

Before observation, the script checks the initial list counts and saves the matching target’s ID.

It then repeatedly queries by list and address for up to 300 seconds, with a 20 ms delay per completed iteration. During

observation, it does not actively delete, modify, or recreate entries. The short-lived entries expire naturally.

The saved target ID is used only to compare successful query results. It is not an input to the failing find statement.

**### Recorded result**

Original logs, dated 2026-10-27, UTC+08:00:

17:06:40 script,info CX78SIZE\_20261027|observing|initial-hst=234|initial-other=766|seed-elapsed=00:00:00.320753781

17:08:49 script,error CX78SIZE\_20261027|failed|stage=find-target|calls=2405|elapsed=00:02:09.527253938|error=no such item (4)

The failure occurred after 2,405 successful lookups, approximately 129.5 seconds after seeding began.

The logged stage was find-target, before the subsequent check-target stage. During cleanup, the target was still present with

7m50s remaining.

**### Scope of the conclusion**

This run records a failure at the conditional find statement, before the subsequent result check. It does not establish the

internal RouterOS cause.

I agree that internal IDs should not be assumed to remain valid indefinitely. This report does not rely on that assumption, nor

does it claim a particular cursor, index, or expiry-cleanup mechanism.

An earlier 1,000-entry run completed without the error. Therefore:

• Reproduction is not guaranteed on every run.

• No deterministic entry-count threshold has been established.

• This specific result was obtained on RouterOS 7.25; the latest release has not yet been specifically tested.

**### Running the attachment**

Please use a disposable lab instance. The script creates temporary configuration and may trigger address-list read failures.

Ensure that no existing entries use either of the two test list names. Paste the complete attached file into a System Script with

read,write,test permissions and run it once.

The script logs and rethrows a failure; it does not retry or automatically clean up. After collecting the results, restore the lab

snapshot or remove only the entries in the two named test lists and the test script.

Could you check whether this behavior is reproducible in your environment? The related MikroTik support ticket is SUP-226958.

[reproduce-1000.rsc](https://forum.mikrotik.com/uploads/short-url/rfihHFHOfVT3CPEtS7whdFgTLbH.rsc) (3.1 KB)

---

<div class="post-metadata">

**Author:** ![jaclaz](https://forum.mikrotik.com/user_avatar/forum.mikrotik.com/jaclaz/32/55652_2.png) [@jaclaz](https://forum.mikrotik.com/u/jaclaz)\
**Post date:** [November 8, 2026, 10:47am UTC](https://forum.mikrotik.com/t/ative-address-list-find-and-api-queries-fail-with-no-such-item-4-during-natural-entry-expiry-sup-226958/274277/5 "2026-11-08T10:47:24Z")

</div>

At first sight it looks to me similar to the known issue about entries that expire while being fetched/interrogated:  
[Delete all connection in Firewall-Connections](https://forum.mikrotik.com/t/delete-all-connection-in-firewall-connections/94436/)

the timeout\>60 (or similar, the value depends on the speed of the device) might be needed.

---

<div class="post-metadata">

**Author:** ![peri](https://forum.mikrotik.com/letter_avatar/peri/32/6_449c533f586939b6e5f246632a46421f.png) [@peri](https://forum.mikrotik.com/u/peri)\
**Post date:** [November 8, 2026, 11:24am UTC](https://forum.mikrotik.com/t/ative-address-list-find-and-api-queries-fail-with-no-such-item-4-during-natural-entry-expiry-sup-226958/274277/7 "2026-11-08T11:24:11Z")

</div>

Thank you for your response. The error symptom might be the same, but during my testing, the 'no such item(4)' error occurred once even when the item still had over 7 minutes before expiring.

 ![屏幕截图 2026-11-08 192136](https://data-discourse.cdn.mikrotik.com/original/3X/d/a/da1dc47f95905fab5dffbfa58508a2013f85bc7e.png)

Attached is the error message generated while my script was running.

---

<div class="post-metadata">

**Author:** ![optio](https://forum.mikrotik.com/letter_avatar/optio/32/6_449c533f586939b6e5f246632a46421f.png) [@optio](https://forum.mikrotik.com/u/optio)\
**Post date:** [November 8, 2026, 2:36pm UTC](https://forum.mikrotik.com/t/ative-address-list-find-and-api-queries-fail-with-no-such-item-4-during-natural-entry-expiry-sup-226958/274277/9 "2026-11-08T14:36:55Z")

</div>

And the best of all it is not possible to reproduce issue with attached script from [post](https://forum.mikrotik.com/t/ative-address-list-find-and-api-queries-fail-with-no-such-item-4-during-natural-entry-expiry-sup-226958/274277/3)

 ![cli](https://data-discourse.cdn.mikrotik.com/original/3X/b/0/b0f86a3d5ef6ecbb2bc6101f2d61c8c596e423c6.png)

![log](https://data-discourse.cdn.mikrotik.com/optimized/3X/a/4/a471c5cfcf2e7a3820a3e24342ce380dd5f0c212_2_690x21.png)

 ![wb-list](https://data-discourse.cdn.mikrotik.com/original/3X/a/0/a0b7a48a6dfcc055e04b924c71f2aa8054f31639.png)

---

<div class="post-metadata">

**Author:** ![BartoszP](https://forum.mikrotik.com/user_avatar/forum.mikrotik.com/bartoszp/32/1386_2.png) [@BartoszP](https://forum.mikrotik.com/u/BartoszP)\
**Post date:** [November 8, 2026, 5:40pm UTC](https://forum.mikrotik.com/t/ative-address-list-find-and-api-queries-fail-with-no-such-item-4-during-natural-entry-expiry-sup-226958/274277/10 "2026-11-08T17:40:19Z")

</div>

> [@optio](#):
>
> it is not possible to reproduce

As it depends on internals of ROS

Still waiting for HI answers to simple questions:

- Why to you access value of an object with temporary internal id?
- Why do you assume that they are valid all the time?

The solution is quite easy if you look at the code:

```auto
/ip firewall address-list add list=$listName address=("198.18." . ($i / 256) . "." . ($i % 256)) timeout=2m

```

Target list is populated with some adresses with timeout 2 minutes

Then the "last" address is added with timeout 10 minutes -\> should last forever during the test that lasts 300sec but it's internal id is taken before the test so it points to "somewhere" into the list of memory locations what is identified with "\*_pointertoCheckedIP_" ID value at this moment - that is how pointers work

```auto
/ip firewall address-list add list=$targetList address=$ipAddress timeout=10m
...
        :local targetId [:pick [/ip firewall address-list find list=$targetList address=$ipAddress] 0]

```

but then - when test starts and lasts 5 minutes - items from the list start disappear because of timeout set.

What the code does? It compares the current result of search - in while loop - "pointer" to the old "\*_pointertoCheckedIP_" one ID.

Is it a valid comparision? Does "\*_pointertoCheckedIP_" is an invariant value for a whole process?  
What happens when items from the list vanish? It's quite obvious IMHO that the list is reorganized and shortened due to smaller size and objects are moved in memory.

What it implies?

The value of "\*_pointertoCheckedIP_" ID assumed to be stable during whole script executions gets sometimes invalidated during while loop but sometimes not if by chance it is not moved during targetList "compacting".

That is why the presented AI answer to my questions, that is copy of the first post, does not bring nothing valuable to the problem. I would say it even lies. Why?

> [@peri](#):
>
> The failing statement is:
> 
> :local found [/ip firewall address-list find list=$targetList address=$ipAddress]
> 
> This query uses the list name and address, not a previously saved internal ID.

that is in contrary with

> [@peri](#):
>
> **### Recorded result**
> 
> Original logs, dated 2026-10-27, UTC+08:00:
> 
> 17:06:40 script,info CX78SIZE\_20261027|observing|initial-hst=234|initial-other=766|seed-elapsed=00:00:00.320753781
> 
> 17:08:49 script,error CX78SIZE\_20261027|failed|stage=find-target|calls=2405|elapsed=00:02:09.527253938|error=no such item (4)
> 
> The failure occurred after 2,405 successful lookups, approximately 129.5 seconds after seeding began.

as

```auto
:local targetId [:pick [/ip firewall address-list find list=$targetList address=$ipAddress] 0]

```

is before logged "observing" comment

```auto
:log info ("CX78SIZE_20261027|observing|initial-hst=" . $initialHst . "|initial-other=" . $initialOther . 
"|seed-elapsed=" . ([:timestamp] - $seedBegin))

```

and how it could be observed after 2405 lookups if the pointed as an error command was taken before any?

---

<div class="post-metadata">

**Author:** ![optio](https://forum.mikrotik.com/letter_avatar/optio/32/6_449c533f586939b6e5f246632a46421f.png) [@optio](https://forum.mikrotik.com/u/optio)\
**Post date:** [November 8, 2026, 7:22pm UTC](https://forum.mikrotik.com/t/ative-address-list-find-and-api-queries-fail-with-no-such-item-4-during-natural-entry-expiry-sup-226958/274277/11 "2026-11-08T19:22:23Z")

</div>

There are some slops by OP for sure... Tried multiple times to perform script on CHR, no issues. Regarding preserving ID (pointer) of temporary address list item, it can have sense in some cases for performance optimizations and IMO it should be preserved for non changed items when other items in list are changed (at least until list contains items).

For ex. I'm storing into global variable last updated temp. address list item ID (list has always single item in list) which contains public WAN IP and have periodic and netwatch UP event check if WAN IP is changed and when it does it stores new address into address list, for getting address list item for address value and removal if changed vs current WAN IP script is first trying to find address item by ID instead of by list name (this is failover for startup) because it is much faster / less CPU consuming when you have approx. 100k temp. address list items in my case. Maybe there are some other cases where temp. addr. list ID usage can be useful...

---

<div class="post-metadata">

**Author:** ![BartoszP](https://forum.mikrotik.com/user_avatar/forum.mikrotik.com/bartoszp/32/1386_2.png) [@BartoszP](https://forum.mikrotik.com/u/BartoszP)\
**Post date:** [November 8, 2026, 7:31pm UTC](https://forum.mikrotik.com/t/ative-address-list-find-and-api-queries-fail-with-no-such-item-4-during-natural-entry-expiry-sup-226958/274277/12 "2026-11-08T19:31:55Z")

</div>

> [@optio](#):
>
> IMO it should be preserved when items in list are changed (at least until list contains items)

It seems to be resonable but if things are designed to work on temporary objects read/decoded/got by higher level objects then internal values should not be used.  
Even if you get an ID to an object that holds eg. IP address that seems to be a proper one, then the object could be just a temporary one generated for particular"find" command and disposed immediately when command/function ends, however during next GC it could be removed/overwritten or the memory overwritten/changed to anything else and reused for another command/function call.

---

<div class="post-metadata">

**Author:** ![optio](https://forum.mikrotik.com/letter_avatar/optio/32/6_449c533f586939b6e5f246632a46421f.png) [@optio](https://forum.mikrotik.com/u/optio)\
**Post date:** [November 8, 2026, 8:04pm UTC](https://forum.mikrotik.com/t/ative-address-list-find-and-api-queries-fail-with-no-such-item-4-during-natural-entry-expiry-sup-226958/274277/13 "2026-11-08T20:04:58Z")

</div>

As I see for any configuration ID stars with 1 per configuration and it is generated in sequence when items are created and they are not actual memory address offsets (pointers). Afaik all configuration items are loaded in memory, temporary or not. so if even memory address is changed there is an map between ID and actual memory address offset of item and I don't think that ID is changing (didn't noticed it from my script logs which runs by scheduler constantly) and I think when configuration memory is optimized by GC just mapping between existing ID and memory offset is changed. This is on my device (ARM64), maybe it behaves differently on other architectures, IDK.

---

<div class="post-metadata">

**Author:** ![BartoszP](https://forum.mikrotik.com/user_avatar/forum.mikrotik.com/bartoszp/32/1386_2.png) [@BartoszP](https://forum.mikrotik.com/u/BartoszP)\
**Post date:** [November 8, 2026, 8:13pm UTC](https://forum.mikrotik.com/t/ative-address-list-find-and-api-queries-fail-with-no-such-item-4-during-natural-entry-expiry-sup-226958/274277/14 "2026-11-08T20:13:53Z")

</div>

That is why I used quotted "pointer" name as it could not be a real pointer.  
To be more precise the internal representation could be held like in LISP-like lists:  
 ![](https://www.pavley.com/wp-content/uploads/2015/09/Slide1.jpg)

The real values like HELLP, BRAVE - like real IP, list name etc. in ROS - and so on are located "somewhere" in memory but we oprate on "Cells" identified in ROS by "\ ***ID**" values.  
I would not assume anything on stability of a particular internal "pointer/reference/ID/cell" and do not resist on their stability across whole script execution.

---

<div class="post-metadata">

**Author:** ![optio](https://forum.mikrotik.com/letter_avatar/optio/32/6_449c533f586939b6e5f246632a46421f.png) [@optio](https://forum.mikrotik.com/u/optio)\
**Post date:** [November 8, 2026, 8:34pm UTC](https://forum.mikrotik.com/t/ative-address-list-find-and-api-queries-fail-with-no-such-item-4-during-natural-entry-expiry-sup-226958/274277/15 "2026-11-08T20:34:03Z")

</div>

I think that configuration operates like is DB, where is ID value set as any other value upon creation except that is indexed, so each configuration has index records with mapping ID-\>item memory offset so it is not related how RSC interpreter works, interpreter is just communicating with some internal process which is handling configuration.

---

<div class="post-metadata">

**Author:** ![BartoszP](https://forum.mikrotik.com/user_avatar/forum.mikrotik.com/bartoszp/32/1386_2.png) [@BartoszP](https://forum.mikrotik.com/u/BartoszP)\
**Post date:** [November 8, 2026, 8:43pm UTC](https://forum.mikrotik.com/t/ative-address-list-find-and-api-queries-fail-with-no-such-item-4-during-natural-entry-expiry-sup-226958/274277/16 "2026-11-08T20:43:23Z")

</div>

Even if yes, as it is as good idea as mine :), it does not change the fact that "internal id" is an internal id for some reason and we should not relly on it. The fact that it "usually works" is not a proof that it is OK.

BTW, assuming your point of view as the better one, then reading a record with a temporary ID of DB record created for time-outing entry is bad after the entry timeouts as the value that is read back is only valid when the pair of (id,valid timeout for timeouting record) is valid, what is checked by calling [find ...] or other commands, not with direct [...get ID].

---

<div class="post-metadata">

**Author:** ![optio](https://forum.mikrotik.com/letter_avatar/optio/32/6_449c533f586939b6e5f246632a46421f.png) [@optio](https://forum.mikrotik.com/u/optio)\
**Post date:** [November 8, 2026, 9:02pm UTC](https://forum.mikrotik.com/t/ative-address-list-find-and-api-queries-fail-with-no-such-item-4-during-natural-entry-expiry-sup-226958/274277/17 "2026-11-08T21:02:21Z")

</div>

> [@BartoszP](#):
>
> BTW, assuming your point of view as the better one, then reading a record with a temporary ID of DB record created for time-outing entry is bad after the entry timeouts as the value that is read back is only valid when the pair of (id,valid timeout for timeouting record) is valid, what is checked by calling [find ...] or other commands, not with direct [...get ID].

It is a tradeoff in my case, I have failover with find by name if ID is not found when is removed on expiration, in my case it is long lasting temp. item, 35w - max I can set due to ts size limit, just to be in memory only since it is often updated (public IP is changed approx. 1d at random time on my LTE connection) and I don't even expect case where it will last 35w so that find by name never happens in ROS runtime (unless if I manually delete item or on startup), but finding item value for checking current IP with scheduler is much often so finding item by ID is much more optimal.

```routeros
/ip/firewall/address-list> :local ts [:timestamp]; :put [get *155A5 "address"]; :put ([:timestamp] - $ts)           
<IP>
00:00:00.000926845

/ip/firewall/address-list> :local ts [:timestamp]; :put [get [find list=PUBLIC_IP] "address"]; :put ([:timestamp] - $ts)
<IP>
00:00:07.004341850

```

and one core is at 100% when performing find by name which I don't want that to potentially impact network latency on scheduler interval execution (1min).

---

<div class="post-metadata">

**Author:** ![BartoszP](https://forum.mikrotik.com/user_avatar/forum.mikrotik.com/bartoszp/32/1386_2.png) [@BartoszP](https://forum.mikrotik.com/u/BartoszP)\
**Post date:** [November 8, 2026, 10:32pm UTC](https://forum.mikrotik.com/t/ative-address-list-find-and-api-queries-fail-with-no-such-item-4-during-natural-entry-expiry-sup-226958/274277/18 "2026-11-08T22:32:03Z")

</div>

OK. If it works, then good for you but ...

I stand by my opinion:  
if it stops working, it shouldn't be treated as an error. It should just trigger an alternative way of less efficient official way of doing things as you do as you are aware of it.

It also does not change the fact that OP problem seems to be different:  
short timeouts that happen at unknowm moments for unknown number of items on a list.
