In todays problem I have had a UCK-G2 auto update. It had gotten itself stuck on “Getting Ready”. This caused the network app was unresponsive.
So the basic steps I used to get the device back on track. Open the settings page, Enable SSH and get the LAN IP.
Connect to the UCK through SSH
ssh root@[uck ip] with the password defined in the admin console.
ls /usr/lib/unifi/data/backup and take note of the latest version .unf there. 6.2.26.unf will be used in the example. once you have the filename SCP the backup out to your computer. You might choose to download more then one.
scp root@[uck ip]:/usr/lib/unifi/data/backup/6.2.26.unf 6.2.26.unf
run, and install :-
apt remove --purge mongodb-server
apt remove --purge unifi
ubnt-systool fwupdate https://fw-download.ubnt.com/data/unifi-cloudkey/1e1e-UCKP-2.0.24-567c9e3a53a2449db186ba14af0abf0d.bin
When the device reboots SSH back in and run.
Once the device is back (again) https to it and configure it for the cloud. It will do its update again to the latest version. Network might take 5-10 minutes to come online, once its up and running with the default configuration. Upload the backup you downloaded at the beginning.
Because the device uses ‘overlayfs’. If the device gets the already installed version uploaded again. it does not seem to trigger a filesystem rebuild. No matter how many times you uninstall and reinstall UniFi and MongoDB. There will always be a ‘stats db’ present and it forces the database to be perpetually re initialized. Installing a previous version will downgrade the device. but running factory defaults Seems to reinitialize the diff filesystem and gets it going again from a known point.