routeros/no-such-item
The RouterOS menu exists, but no item in it matches the
.id, number or name the command gave, so RouterOS refused
it and that command did not run. In a multi-statement script run through
/execute, statements before the refused one already
ran.
Emitted by
execute, api and transfer over
--via rest-api and --via native-api, and
execute over --via ssh and
--via mac-telnet, where the console prints the same
no such item text (code). RouterOS gives the same
answer on each transport, so switching does not help. Validation cannot
catch it: the command is well formed, and only the device knows which
items exist.
Context
detail: RouterOS's message, verbatim. When a structured REST request fails with HTTP 404, it is the whole{"error":404,"message":"Not Found"}body, because RouterOS sends nodetailfor this fault.httpStatus,status,path: that REST request (HTTP 404).via: the transport.
A command that runs through /execute, or on a console
transport, succeeds at the transport level and returns the text instead
(HTTP 200 over REST). Its error carries that text in detail
and the via, with no httpStatus,
status or path.
Typical triggers
- A name that is not there:
/system/script/run number=nosuchgivesno such itemon the native API and HTTP 404 over REST (CHR 7.25.1). - An
.idthat is gone:/ip/address/remove numbers=*FFFFgivesno such item (4)on the native API and HTTP 404 over REST (CHR 7.25.1). - The same command through
/execute, asexecutesends a console-form command:/ip/address/set *FFFF comment=xreturnsno such item (4) (/ip/address/set; line 1)on both transports (CHR 7.25.1). - A missing file:
/file/get .id=missing.txt(CHR 7.25.1).transferreads this as "the file does not exist" and does not report it as an error.
Fix
- List the menu's items with
centrs retrieve <router> <menu>and use an.idfrom that list. To match by name, filter:centrs retrieve <router> /system/script --query 'name=backup'. - Do not reuse a number from an earlier
print: those numbers belong to the console session that printed them. Use the.idinstead. - Before running a script again, check what its earlier statements changed.
Related
routeros/unknown-path: the menu or command itself does not exist.routeros/invalid-value: RouterOS rejected a value, not an item reference.