Community discussions

MikroTik App
 
brianlewis
Member Candidate
Member Candidate
Topic Author
Posts: 134
Joined: Tue Jul 20, 2004 10:54 am
Location: Irvine, CA

6.16 import stops when there is a duplicate entry

Wed Nov 19, 2014 10:13 pm

A duplicate entry in the import will cause RouterOS to stop and not process further down the list (v6.16)

ie (dshield.rsc below)
/ip firewall address-list
add list=DShield address=122.226.73.131/32 timeout=2h
add list=DShield address=85.13.160.11/32 timeout=2h
add list=DShield address=50.23.113.146/32 timeout=2h
add list=DShield address=50.23.113.146/32 timeout=2h
add list=DShield address=122.225.109.212/32 timeout=2h
add list=DShield address=176.31.251.200/32 timeout=2h
add list=DShield address=218.2.0.137/32 timeout=2h
add list=DShield address=122.226.73.131/32 timeout=2h

It will import 50.23.113.146 and stop processing the import. Bug in RouterOS?
Using /import file-name=dshield.rsc; to import list
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7038
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: 6.16 import stops when there is a duplicate entry

Thu Nov 20, 2014 10:08 am

You cannot add the same entry twice, console throws an error and quits.
 
brianlewis
Member Candidate
Member Candidate
Topic Author
Posts: 134
Joined: Tue Jul 20, 2004 10:54 am
Location: Irvine, CA

Re: 6.16 import stops when there is a duplicate entry

Thu Nov 20, 2014 5:12 pm

How can we not quite the 'script'? Linux doesn't quit a script. Windows doesn't quite a CMD/BAT file. They both continue to execute the commands. The duplicate entry isn't an error it should just be an informational warning that the entry already exists so RouterOS should be continue execution of the script.
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7038
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: 6.16 import stops when there is a duplicate entry

Fri Nov 21, 2014 4:43 pm

It IS an error

[admin@MikroTik] /ip firewall address-list> add list=test address=1.1.1.1
[admin@MikroTik] /ip firewall address-list> add list=test address=1.1.1.1
failure: already have such entry
 
brianlewis
Member Candidate
Member Candidate
Topic Author
Posts: 134
Joined: Tue Jul 20, 2004 10:54 am
Location: Irvine, CA

Re: 6.16 import stops when there is a duplicate entry

Sat Nov 22, 2014 6:54 am

We should have the ability to import with continue on failure toggle. And adding a duplicate 'address list' entry should be a warning not an error
 
User avatar
rwrocket
Frequent Visitor
Frequent Visitor
Posts: 80
Joined: Mon Nov 24, 2014 8:08 am

Re: 6.16 import stops when there is a duplicate entry

Fri Jan 15, 2016 3:09 am

Strongly agree

this is just silly

such a time waster to have to edit all duplicate interface names out of a config file to do a clone backup
 
Percanta
newbie
Posts: 39
Joined: Tue Feb 24, 2009 1:00 am

Re: 6.16 import stops when there is a duplicate entry

Wed Feb 10, 2016 12:09 am

also strongly agree , at least it will be nice to know which is the duplicate item.

edit: could do that with verbose=yes
 
_saik0
Member Candidate
Member Candidate
Posts: 129
Joined: Sun Aug 26, 2007 11:18 pm

Re: 6.16 import stops when there is a duplicate entry

Wed Feb 17, 2016 12:50 am

Thank you!
Was also thinking the same - add an option (or make it default) to continue executing/importing the config after an error.
 
User avatar
pants6000
Frequent Visitor
Frequent Visitor
Posts: 86
Joined: Fri Sep 26, 2014 5:30 am

Re: 6.16 import stops when there is a duplicate entry

Thu Feb 18, 2016 3:23 am

If you pay attention to what line of the config it stopped on, you can continue the import with "import from-line=", just increment the line number that it stopped on by 1.

But something like "continue import on error" would be a nice feature. +1
 
tomba
just joined
Posts: 2
Joined: Tue May 24, 2016 1:21 am

Re: 6.16 import stops when there is a duplicate entry

Tue May 24, 2016 1:26 am

+1
this option will be helpful when importing large blacklist from different sources and urgently need it
 
User avatar
Deantwo
Member
Member
Posts: 331
Joined: Tue Sep 30, 2014 4:07 pm

Re: 6.16 import stops when there is a duplicate entry

Tue May 24, 2016 3:34 pm

If you pay attention to what line of the config it stopped on, you can continue the import with "import from-line=", just increment the line number that it stopped on by 1.
I have yet to see a way to get the error message from an imported script returned to the script doing the import. And simply skipping the one line that failed wouldn't be a good idea, if you have { } cases in the imported script and it fail inside one, you wouldn't want it to attempt to start in the middle of it.
But something like "continue import on error" would be a nice feature. +1
Something along the lines of an option that makes the import function simulate the behavior of copy-pasting into the CLI.
Possibly dump the whole CLI output (and input) into a specified text file.
 
MikeBooker
just joined
Posts: 6
Joined: Sun Jul 13, 2014 9:22 pm

Re: 6.16 import stops when there is a duplicate entry

Mon Jun 27, 2016 8:25 pm

+100
this option will be very helpful when importing large blacklist from different sources and urgently need it
 
tomba
just joined
Posts: 2
Joined: Tue May 24, 2016 1:21 am

Re: 6.16 import stops when there is a duplicate entry

Sun Aug 21, 2016 12:44 pm

bump

+1
 
User avatar
omega-00
Forum Guru
Forum Guru
Posts: 1167
Joined: Sat Jun 06, 2009 4:54 am
Location: Australia
Contact:

Re: 6.16 import stops when there is a duplicate entry

Thu Sep 01, 2016 11:26 am

My recommendation is to build a script that clears all the items you don't need prior to running then adds everything it requires back.

IE: Clear all IP addresses at the start then just add the ones you need.

Something like this can be achieved by using a non-interactive initiation of the script (running as an .auto.rsc)
OR
"system reset, on reset run .. <script name>"
OR
:global cmdfinish
:execute {command that will potentially fail goes here; :set cmdfinish "true";}
loop around a bit waiting for a "true" value otherwise log that the command failed and continue on..

This is a very simple overview so if there's more interest I can supply some better explanations and examples.
 
User avatar
BartoszP
Forum Guru
Forum Guru
Posts: 2855
Joined: Mon Jun 16, 2014 1:13 pm
Location: Poland

Re: 6.16 import stops when there is a duplicate entry

Thu Sep 01, 2016 3:11 pm

Could you prepare the script that way
do { /ip firewall address-list add address=111.251.111.129 list=blackmail timeout=3h } on-error={}
instead of
/ip firewall address-list add address=111.251.111.129 list=blackmail timeout=3h
I have no 6.16 so it is only my guess that such solution works.
 
dadaniel
Member Candidate
Member Candidate
Posts: 220
Joined: Fri May 14, 2010 11:51 pm

Re: 6.16 import stops when there is a duplicate entry

Thu Sep 29, 2016 12:58 pm

Could you prepare the script that way
do { /ip firewall address-list add address=111.251.111.129 list=blackmail timeout=3h } on-error={}
instead of
/ip firewall address-list add address=111.251.111.129 list=blackmail timeout=3h
I have no 6.16 so it is only my guess that such solution works.
works like a charm, as a side effect log is not spammed by address list entry messages :)
Thank you very much!

Who is online

Users browsing this forum: baragoon, BinaryTB, raphaps, rplant and 66 guests