Manual

The script errors partway through

The first lines go through and then an error appears: what each kind of message is telling you.

You paste the script into the terminal, the first lines scroll past, and then there is a red message. Sometimes it stops there, sometimes it carries on and afterwards you have no idea what did and did not get applied.

That last part is the real problem, not the error itself. A half-applied script is harder to deal with than no script. So the best first move is almost always: write down the message, reset the device, fix the cause, and paste again onto an empty device.

The script is written for a device at factory defaults. If there is already a configuration on it, the first lines collide with what is there, and from that point on the rest no longer adds up. A rollback script is generated alongside yours that undoes exactly what it added, so you can always go back.

The quick checks, in order

  1. Read which line it was. The message sits directly under the line that failed. Find that line in the script; the comment above it names the section it came from.
  2. Was the device empty? /system reset-configuration no-defaults=yes skip-backup=yes clears it; the button during boot does the same. If you are unsure, look at how much is already there with /export hide-sensitive.
  3. Is the model right? /system resource print shows board-name. Pick a different model in the tool and the script contains port names this device does not have.
  4. Is the version right? The same output shows version. Some commands only exist from a certain version onwards.
  5. Are the packages there? /system package print. Wi-Fi lines need the right Wi-Fi package, containers need the container package.
  6. Did the whole script arrive? Paste it in one go, in the terminal, not in a script window. If in doubt, put it in Files as an .rsc file and run it with /import file=name.rsc. That is more reliable than pasting over a slow connection.

The messages and what they mean

bad command name ...
The menu does not exist on this device. Usually a package is missing, or RouterOS is older than the command. The classic: /interface wifi on a device without the wifi package, and before 7.13 that menu was still called /interface wifiwave2.
failure: already have such ... or entry already exists
The device was not empty. Reset and start again.
input does not match any value of interface
The port in the script does not exist on this device. You picked the wrong model, or a port that only the larger variant has.
no such item
Something is referring to an object an earlier line should have created. So something already went wrong before this; scroll back to the first error.
action failed on hotspot, container, IPsec, fetch or e-mail
Those are features device-mode can block. Unlocking them needs a physical confirmation on the device, which a script cannot do for itself.
An error on a line that looks odd
The script was damaged in transit. Word processors turn straight quotes into curly ones and break long lines. Always copy from the downloaded file or straight out of the tool.

What the configurator does about it

  • The System section has RouterOS version on the device, letting you pick 7.21 or newer, 7.17 up to 7.20, 7.15 or 7.16, 7.13 or 7.14, and older than 7.13. The script adapts to it, because those versions differ in ways that genuinely matter. This is the field that prevents most bad command name messages.
  • The model you pick decides the port names. Choose the model you actually have and ether1 through etherN and the SFP ports line up.
  • If your configuration uses features device-mode can block, the System section has an advanced option to move those lines out of this script and into a script that runs once at the next start. Its help text says honestly that the device is only partly configured between pasting and that restart, and that you should leave it off for an ordinary router.
  • With containers, /system device-mode update container=yes is the first line of that section, with the note that you have to confirm it physically within five minutes using the reset button or a power cycle.
  • On a device whose Wi-Fi package we could not confirm, the tool says up front: check that the wifi-qcom package is installed on this device. Precisely to avoid this error.
  • Every script comes with a rollback script that undoes what it added, and a handover sheet for the customer folder.

The honest limits

The tool runs in your browser and talks to nothing. It does not know which version your device runs, which packages are on it, whether it is empty, or whether your model really is the one you clicked. Those four things together cause nearly every paste failure, and all four can only be checked on the device itself. Beyond that: a script is not a transaction. RouterOS executes line by line and does not stop neatly at the first error, so after a failed attempt a reset is faster than a repair.

Read on: Using the script, Safe mode and When something goes wrong.

Want to try it right away? Open the configurator