Community discussions

MikroTik App
 
Easen
just joined
Topic Author
Posts: 22
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: 352
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: 22
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: 352
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: 22
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: 22
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: 11967
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

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:

on v7 after each "export" add "show-sensitive" !!!

:local sendto   "address@mail.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=$1 subject=$2 body=$2 file=$3}

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

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

/system license output
:set dsubj "Backup Licence Key $date $time"
:set dfile "$[/system license get software-id].key"
$bymail $sendto $dsubj $dfile

/export file="auto_export"
:set dsubj "Backup Export $date $time"
:set dfile "auto_export.rsc"
$bymail $sendto $dsubj $dfile

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

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

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

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

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

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])
}
:set dsubj "Backup all files inside $date $time"
:set dfile $filelist
$bymail 

Thanks Amm0 for the "$" & "( )" fix
viewtopic.php?p=915848#p915822
Last edited by rextended on Mon Jan 09, 2023 3:04 pm, edited 21 times in total.
 
Easen
just joined
Topic Author
Posts: 22
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: 11967
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

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
Member
Posts: 328
Joined: Mon Dec 18, 2017 12:17 pm
Location: S.Marino Router model: RB3011UiAS-RM+RBM11G

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: 22
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
Member
Posts: 328
Joined: Mon Dec 18, 2017 12:17 pm
Location: S.Marino Router model: RB3011UiAS-RM+RBM11G

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.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11967
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Router crashes are wiping the config

Mon May 09, 2022 2:00 pm

Rebuilded all for v6 / v7 compatibility
viewtopic.php?p=858564#p858564
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 18959
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: Router crashes are wiping the config

Mon May 09, 2022 4:29 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.
Horrible practice. Do your own configs and understand them. If there parts of the script you like use them otherwise, dont do anything automated like that.
Always approach each firmware upload in a methodical manner, and until things settle down, after a release, never jump into a new firmware. For example I am still waiting for long term Vers 7 before I switch my main router over to vers 7. Personally if you experienced any funny things with firmware, then netinstall the next time you change firmware.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11967
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Router crashes are wiping the config

Mon Aug 01, 2022 4:34 am

Added Backup Licence Key
viewtopic.php?p=858564#p858564

Who is online

Users browsing this forum: No registered users and 16 guests