Community discussions

MikroTik App
 
Easen
just joined
Topic Author
Posts: 14
Joined: Tue Mar 23, 2021 9:38 pm

Router crashes are wiping the config

Tue May 18, 2021 11:30 pm

Hi,

Router: RB4011iGS+5HacQ2HnD
Revision: r2
RouterOS: 7.1beta5

Recently I unplugged my RB4011iGS+5HacQ2HnD and when I powered it back on the configuration was gone. I am fairly diligent about backups and I take a backup before I make any configuration change, but I couldn't restore from any of them. The device would just reboot back to the initial configuration (default password, no assigned addresses, no firewall rules, etc.)

In the end I had to restore from a backup that was taken by https://github.com/beeyev/Mikrotik-Rout ... and-update which emails you an encrypted backup if you configured to do so.

I thought it might have been due to a corrupted OS, but when I checked it using the "Check Installation" feature everything has comes back ok.

I thought maybe it was a one off, but just 10 minutes ago I was tuning my fq_codel queue and the router crashed (I am fine with it crashing as I know it's still a beta), upon restarting the configuration was again wiped, and I had to restore from the same backup. Very odd.

Has anyone come across this problem? Is it worth me doing a configuration reset and re-applying my configuration (.rsc) instead of restoring the backup?

Thanks.
 
User avatar
kiler129
Member
Member
Posts: 302
Joined: Tue Mar 31, 2015 4:32 pm
Location: IL, USA
Contact:

Re: Router crashes are wiping the config

Thu May 20, 2021 11:39 pm

Seems like the same issue as described in viewtopic.php?f=1&t=174897
 
Easen
just joined
Topic Author
Posts: 14
Joined: Tue Mar 23, 2021 9:38 pm

Re: Router crashes are wiping the config

Thu May 20, 2021 11:44 pm

Seems like the same issue as described in viewtopic.php?f=1&t=174897
Yes it does. Have you had any luck tracking down the problems with yours?

I’m going to attempt to do a Netinstall, however I only have a Mac so I need to install windows etc to it up and running (I don’t want to try this via a virtual machine).
 
User avatar
kiler129
Member
Member
Posts: 302
Joined: Tue Mar 31, 2015 4:32 pm
Location: IL, USA
Contact:

Re: Router crashes are wiping the config

Fri May 21, 2021 12:16 am

Sadly no luck, the config is valid up to a point and when you change something it becomes invalid so that after reboot it just wipes the whole router - it's bizarre. I wasn't able to get to the root cause yet.

As for netinstall I always do that from a Win10 VM on a Mac ;) It's sometimes finicky so I usually connect a USB ethernet and pass it to a VM.
 
Easen
just joined
Topic Author
Posts: 14
Joined: Tue Mar 23, 2021 9:38 pm

Re: Router crashes are wiping the config

Fri May 21, 2021 12:56 am

Oh cool I'll try that, saves me going down the Bootcamp option.

I suspect you're right, it's one line of bad config that it can't get past when it boots, which basically puts it in an unloaded/empty state, the problem is which config is it!

Last night it happened again once I upgraded to the new beta, I had to restore to a slightly older backup. Since then, I have pruned a firewall & NAT rules, tweaked a DHCP pool size (increased it) and updated the graphs to be accessible from 0.0.0.0/0 (basically bringing it back to speed with what it was before it went pop). I haven't restarted it since making these changes, but I have backed up after each change (I would do it now, but I don't want to be up to the early hours debugging it again). I'm planning of restarting it at the weekend to see to try and rule out these config changes. Then I was going to preform a netinstall just to get back to a clean state before restoring from a backup.

Mikrotik Support - Is it worth me producing a Supout.if before and after (if was to happen again) to help you diagnose this issue?
 
Easen
just joined
Topic Author
Posts: 14
Joined: Tue Mar 23, 2021 9:38 pm

Re: Router crashes are wiping the config

Sat May 22, 2021 4:19 am

I think I may have found the root cause after a series of netinstalls and slow re-adding my configuration.

I believe RouterOS 7 isn't compatible with this script https://github.com/beeyev/Mikrotik-Rout ... Update.rsc, I haven't worked out if it's the script or RouterOS 7, but I am pretty sure this was the culprit.

I think from now on I am going to netinstall any new OS updates and re-apply my configuration script.

@kiler129 do you have the same script installed on yours or any other scripts for that matter?
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 4781
Joined: Tue Feb 25, 2014 12:49 pm
Location: Capalbio, Tuscany, Italy

Re: Router crashes are wiping the config

Sat May 22, 2021 11:47 am

search tags # rextended export full backup complete user manager dude

notice for future versions: thanks k6ccc for the hint to save also the list of packages installed and if are active or not

I think I may have found the root cause after a series of netinstalls and slow re-adding my configuration.

I believe RouterOS 7 isn't compatible with this script https://github.com/beeyev/Mikrotik-Rout ... Update.rsc, I haven't worked out if it's the script or RouterOS 7, but I am pretty sure this was the culprit.

I think from now on I am going to netinstall any new OS updates and re-apply my configuration script.

@kiler129 do you have the same script installed on yours or any other scripts for that matter?
395 lines to do.. nothing?
I do not want waste my brain to try to understand all...

I just give you this, just set correctly your parameters on /tools Email:
:local sendto "mail@provider.ext"
:local certpass "myprivatepass"

/system clock
:local date [get date]
:local time [get time]

:local dsubj ""
:local dfile ""
:local bymail do={/delay 20s;/tool e-mail send to=$sendto subject=$dsubj file=$dfile}

/certificate
:foreach cert in=[find] do={
 :local certname [get $cert name]
 export-certificate $cert file-name=("auto_$certname") type=pkcs12 export-passphrase=$certpass
 $bymail $dsubj="Certificate $certname $date $time" $dfile="auto_$certname.p12"
}

/ip ssh export-host-key key-file-prefix=auto_host-key
 $bymail $dsubj="Host Key $date $time" $dfile="auto_host-key_dsa,auto_host-key_dsa.pub,auto_host-key_rsa,auto_host-key_rsa.pub"

/export file="auto_export"
/tool e-mail send to=$mail subject="Export $date $time" file="auto_export.rsc"

/user export file="auto_user_export"
$bymail $dsubj="User Export $date $time" $dfile="auto_user_export.rsc"

/system backup save name="auto_backup" dont-encrypt=yes
$bymail $dsubj="Backup $date $time" $dfile="auto_backup.backup"



If you use user-manager add also:
/file remove [find where name="auto_user-manager.umb"]
/tool user-manager database save name="auto_user-manager"
$bymail $dsubj="Database User-Manager $date $time" $dfile="auto_user-manager.umb"


If you use Dude add also:
/file remove [find where name="auto_thedude.db"]
/dude export-db backup-file="auto_thedude.db"
$bymail $dsubj="Database The Dude $date $time" $dfile="auto_thedude.db"


and if you want backup also all internal files, add at the bottom:
:local filelist ""
/file
:foreach file in=[find where type!=disk && type!=directory && !(name~"dude/files/default") && !(name~"^auto_") && !(name~"dude.db\$") && !(name~"db-...\$") && !(name~"user-manager")] do={
:if ($filelist != "") do={:set $filelist ($filelist.",")}
:set $filelist ($filelist.[get $file name])
}
$bymail $dsubj="All the other files $date $time" $dfile=$filelist
Last edited by rextended on Sat Jul 17, 2021 1:16 pm, edited 12 times in total.
 
Easen
just joined
Topic Author
Posts: 14
Joined: Tue Mar 23, 2021 9:38 pm

Re: Router crashes are wiping the config

Sat May 22, 2021 1:14 pm

The main reason why I used that script was to inform me whenever there’s a new update, it also has the ability to auto update your router (which is the bulk of that script). However I am quickly learning you shouldn’t do this with the RouterOS 7 beta’s, as I suspect MikroTik call these betas because they don’t QA the upgrade path scenarios, they leave that to us. ;)

I don’t know if the original bug was due to the script or RouterOS script engine or something else in the startup scripts of the router. Either way I don’t need this script as I have changed the way I upgrade beta versions (export configure, net install and apply config).

Thanks for those snippets, I give them a go next week. At the moment I am just enjoying some stability.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 4781
Joined: Tue Feb 25, 2014 12:49 pm
Location: Capalbio, Tuscany, Italy

Re: Router crashes are wiping the config

Sat May 22, 2021 1:21 pm

>>>to inform me whenever there’s a new update<<<
read on mikrotik site or subscribe on newsletter

>>>auto update your router<<<
...the most worst thing to do...
 
User avatar
frank333
Member Candidate
Member Candidate
Posts: 218
Joined: Mon Dec 18, 2017 12:17 pm
Location: S.Marino Router model: RB3011UiAS-RM

Re: Router crashes are wiping the config

Sun Jun 20, 2021 7:56 am

with 7.1beta6 on rbm11g on shutdown it crashes, I have to log in with winbox.
how did you solve it? using netinstall? or updating from win box menu?
 
Easen
just joined
Topic Author
Posts: 14
Joined: Tue Mar 23, 2021 9:38 pm

Re: Router crashes are wiping the config

Sun Jun 20, 2021 10:14 am

with 7.1beta6 on rbm11g on shutdown it crashes, I have to log in with winbox.
how did you solve it? using netinstall? or updating from win box menu?
No, in the end I’ve rolled back to 7.1beta5.
 
User avatar
frank333
Member Candidate
Member Candidate
Posts: 218
Joined: Mon Dec 18, 2017 12:17 pm
Location: S.Marino Router model: RB3011UiAS-RM

Re: Router crashes are wiping the config

Sun Jun 20, 2021 10:27 am

@ Easen
so reverting to beta 5 no longer has the problem you had in the first post.So I'll try.

Who is online

Users browsing this forum: mducharme and 6 guests