A few days ago, I rebooted my NAS while changing some settings and for a second everything seemed normal - but I quickly realized I couldn't access the web UI... and I couldn't connect to the NAS over SSH. My network connectivity was completely down.
Looking at the console, it was littered with error messages - all resembling:
ifconfig: socket(AF_INET6), SOCK_DGRAM): No buffer space available ifconfig: socket(AF_INET24), SOCK_DGRAM): No buffer space available
I had been messing around with LACP and load balancing, and thought maybe this was the culprit - but deleting the lagg0 interface and re-configuring my network interfaces had no effect. Regardless, any change resulted in:
Restarting network: Failed Restarting routing: ok
Some Googl-ing brought about info on the first error and the second error, but not anything that involved both or seemed related. Resetting my configuration fixed the issue, but I really wanted to recover all my settings.
Turns out, the offending setting was autotune. I had flipped on autotune and one (or possibly more) of the tunables it had automatically set threw my NICs entirely out of whack (Intel Pro/1000 NICs and onboard Intel NICs).
FreeNAS's configurations are all stored in SQLite 3
.db files. When you perform a config backup (from web UI: "System" tab -> "General" tab -> "Save Config"), you're just saving this SQLite database. If you have a copy of your most recent config and your most recent working config, then all you really need to do is compare the two databases and find the offending entries (in my case, the tunables and the "autotune" function).
(If you don't have one or both of those configs backed up, you can still recover them from the FreeNAS boot media! Your entire configuration history is stored there, and you can grab those databases by following the instructions layed out here.)
This data comparison was made super easy with a free Windows utility I found on CodeProject (sorry Mac users, I ran it in a VM): https://www.codeproject.com/Articles/220018/SQLite-Compare-Utility
Running the utility on the two configuration files, I selected "Show differences only" and got a screen like this:
This made it super easy to narrow it down and change these entries:
I could've easily gone through and figured out which of the tunables could have been causing the issue - but at this point I just wanted to get back up and running, so I cleared all the tunables that autotune had set. Then, from the FreeNAS CLI I selected option 8 - "Reset Configuration to Defaults".
After the reboot, I was able to access the web UI again and upload my newly adjusted configuration file ("System" tab -> "General" tab -> "Upload Config") - and success! All my settings were restored, along with network connectivity.