Our thinking


Solution to failed firmware updates in a UniFi Cloud Key

I’ve had a few UniFi Cloud Key wifi controllers with this issue – they seem to be stuck on a particular version of the firmware and can’t be updated. Both manual and automatic firmware updates through the web interface fail.

The symptom is that it looks like it’s doing the firmware update, but after rebooting to apply the update, the Cloud Key is still on the same version you started with.

Apparently there’s a bug in a particular version of the ubnt-tools package that simply fails to apply the update.

The solution is to ssh into the cloud key and update the installed version of ubnt-tools. Once this has been completed, the firmware update installs as expected.

Connect to the UniFi Cloud Key via SSH.

Type in:

dpkg -l |grep ubnt-tools

If ubnt-tools is anything other than 0.9.7-1, then you need to update it.

You can update it by typing:

apt-get update && apt-get install --only-upgrade ubnt-tools

Once the ubnt-tools package is updated, you can run the upgrade by typing:

ubnt-systool fwupdate http://dl.ubnt.com/unifi/cloudkey/firmware/...

and giving the ubnt-systool a full URL to the firmware you want to apply.

You can get the URL for the latest version of the firmware from download.ubnt.com

Source: Solved: Can’t update Cloud Key Firmware – Ubiquiti Networks Community

16 thoughts on “Solution to failed firmware updates in a UniFi Cloud Key

  1. Attempted with this response: Resolving dl.ubnt.com (dl.ubnt.com)… 13.35.119.197
    Connecting to dl.ubnt.com (dl.ubnt.com)|13.35.119.197|:80… connected.
    HTTP request sent, awaiting response… 404 Not Found
    2021-02-22 09:40:53 ERROR 404: Not Found.

    1. Try copying and pasting the download URL you’re using into your browser to see if you can download it that way – just to check it’s not actually a 404.

      1. I see the same problem on my Cloudkey 1st Gen. The URLs are all 404 in Browser as well. Seem the Jessie packages are no longer there. Is there a way to point to an archive somehow. I’m not familar with Linux but I believe this config have to be changed?

        root@UniFi-CloudKey:~# cat /etc/apt/sources.list
        deb http://httpredir.debian.org/debian/ jessie main contrib non-free

        1. I’m really not sure. Debian 8 long-term support was end-of-life as of June 30, 2020.
          I’m also not sure that this is the problem preventing it from upgrading (however it’s been a while since I was digging around in a gen 1 cloud key).

          Can you skip the apt-get update step and instead just run apt-get install –only-upgrade ubnt-tools to upgrade the ubnt-tools to the latest version? This package doesn’t come from the main Debian repositories, but instead from Ubiquiti so may still be hosted by them.

          1. Thanks for your response. This shows that it is already the newest version:

            root@UniFi-CloudKey:/etc/apt# apt-get install –only-upgrade ubnt-tools
            Reading package lists… Done
            Building dependency tree
            Reading state information… Done
            ubnt-tools is already the newest version.
            0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
            root@UniFi-CloudKey:/etc/apt# dpkg -l |grep ubnt-tools
            ii ubnt-tools 0.9.29~217+g6e76b1d armhf Tools for Ubiquiti appliances
            root@UniFi-CloudKey:/etc/apt#

          2. Unfortunately, if I try to simply update I get “invalid firmware” on all firmware files I try (also if I only try a small jump from 5.12 to 5.14.23 which would be the next higher)

            root@UniFi-CloudKey:/etc/apt# ubnt-systool fwupdate https://dl.ui.com/unifi/7.1.68/unifi_sysvinit_all.deb
            31402
            –2023-04-12 21:10:51– https://dl.ui.com/unifi/7.1.68/unifi_sysvinit_all.deb
            Resolving dl.ui.com (dl.ui.com)… 18.64.83.22
            Connecting to dl.ui.com (dl.ui.com)|18.64.83.22|:443… connected.
            HTTP request sent, awaiting response… 200 OK
            Length: 176568782 (168M) [application/x-debian-package]
            Saving to: ‘/var/tmp/fwupdate.YveFMlh6ym’

            /var/tmp/fwupdate.YveFMlh6ym 100%[=============================================================================================>] 168.39M 1.89MB/s in 57s

            2023-04-12 21:11:49 (2.95 MB/s) – ‘/var/tmp/fwupdate.YveFMlh6ym’ saved [176568782/176568782]

            ERROR: Invalid firmware file ‘/var/tmp/fwupdate.YveFMlh6ym’!
            ERROR: Invalid firmware file /var/tmp/fwupdate.YveFMlh6ym!

            root@UniFi-CloudKey:/etc/apt#

          3. Invalid Firmware could be a sign that the flash in the cloud key is on the way out, or that it doesn’t have enough internal storage.
            What may work is to take a backup of the config, and then reset it to factory defaults. Once it’s been reset, immediately try the firmware update before restoring any config.

          4. I made a df and see something at 100%. No clue whether which mounts are used for /var/temp. Could this be an indicator?

            root@UniFi-CloudKey:/etc/apt# df
            Filesystem 1K-blocks Used Available Use% Mounted on
            aufs-root 3030800 2823720 159240 95% /
            udev 10240 0 10240 0% /dev
            tmpfs 413152 476 412676 1% /run
            /dev/disk/by-label/userdata 3030800 2823720 159240 95% /mnt/.rwfs
            /dev/disk/by-partlabel/rootfs 316672 316672 0 100% /mnt/.rofs
            tmpfs 1032880 0 1032880 0% /dev/shm
            tmpfs 5120 0 5120 0% /run/lock
            tmpfs 1032880 0 1032880 0% /sys/fs/cgroup
            tmpfs 1032880 64 1032816 1% /tmp
            /dev/mmcblk0p8 10800456 1150408 9522604 11% /srv
            /dev/mmcblk1p1 7527048 17096 7493568 1% /data
            root@UniFi-CloudKey:/etc/apt#

          5. Interesting thing as well is, that the Webinterface shows me this as firmware and no update avail if clicking on “Check for update”: UCK.mtk7623.v0.13.10.e171d89.190327.1752

            on Download page the latest bin file is UCK.mtk7623.v1.1.19.f4a17b0.210204.0232.bin and a firmware starting with v0 doesn’t exist at all on download page.

            Could it be an option to flash the latest on recovery console and this maybe fixes the old apt-get configuration? Release Date of latest is 2021-04-06. So this is after Jessie EOL you pointed to 2020

Leave a Reply