Reply
Member
Posts: 107
Registered: ‎02-03-2016
Kudos: 16

Re: Unifi Controller on Debian 9

This is critical. As of kernel version GNU/Linux 4.4.0-81-generic x86_64 on Ubuntu 16 LTS, unifi 5.5.x is completely broken for me.

New Member
Posts: 8
Registered: ‎09-22-2015
Solutions: 1

Re: Unifi Controller on Debian 9

I use Mint, so I'm not sure if this is available in Ubuntu.  But in Mint there's an Update Manager which gives you access to install and remove kernels.  Here's an image of it...

 

UpdateManagerKernels.png

 

Hope this helps.

Deleted Account
Posts: 0

Re: Unifi Controller on Debian 9

@kalimero2nothing is generated in the log when this happens.  If it's a fresh install the folder /var/log/unifi or /var/log/unifi-video is empty.

 

In the Unifi-Video thread it looks like Debian 7 is affected as well which includes the NVR appliance if anyone is using it as a Unifi controller as well

 

https://community.ubnt.com/t5/UniFi-Video/PSA-do-not-upgrade-apt-update-amp-amp-apt-upgrade-your-Deb...

 

@hasnainali  the commands will look like

 

apt-get install [kernel-package]=[kernel-version]

apt-mark hold [kernel-package]

 

I have never used Ubuntu but if it's the same as Debian, if you run

 

cat /var/log/apt/history.log

It should show an entry from when you upgraded the kernel like this (this is on my Debian 9 machine)

 

Upgrade: linux-image-4.9.0-3-amd64:amd64 (4.9.30-2, 4.9.30-2+deb9u1)

so in my case, I would use

 

linux-image-4.9.0-3-amd64

 as [kernel-package] in the commands above, and

 

4.9.30-2

as [kernel-version]  . It's a little confusing but the version in brackets before the comma is the old one, and after the comma is the new one.  So in my case the kernel was upgraded from 4.9.30-2 to 4.9.30-2+deb9u1.  Hope that helps

New Member
Posts: 9
Registered: ‎12-14-2015

Re: Unifi Controller on Debian 9

All kernel versions for Debian 7, 8 and 9 are patched for CVE-2017-1000364 so it more and more looks like the change is to blame.

New Member
Posts: 1
Registered: ‎12-26-2016

Re: Unifi Controller on Debian 9

I can confirm on Ubuntu 16.04.2, kernel update to 4.4.0-81 shows the segfault, where as rebooting in 4.4.0-79 does not (Unifi controller works fine). Leaving it on 4.4.0-79 until there's a fix.

New Member
Posts: 19
Registered: ‎02-27-2017
Kudos: 26

Re: Unifi Controller on Debian 9

I can also confirm Linux 4.4.0-81-generic on x86_64 breaks unifi controller 5.5.11. 

New Member
Posts: 6
Registered: ‎05-28-2017

Re: Unifi Controller on Debian 9

Same error on Debian 8.8, haven't upgraded to Debian 9 yet.

Senior Member
Posts: 3,461
Registered: ‎08-06-2015
Kudos: 1624
Solutions: 197

Re: Unifi Controller on Debian 9

As I noted in https://community.ubnt.com/t5/UniFi-Wireless/Unifi-Controller-and-Debian-8-kernel-upgrade/m-p/196786... the kernel "fixes" for CVE-2017-1000364 were rushed and released without much testing.

 

It was believed that this should not have had any application impact but it is being found that some applications do in fact fail with these changes.  It looks like the UniFi controller may be one of those that is affected.

 

While not always an option for home/SOHO/SMB it is always good practice to test any/all updates in an independent environment to identify any impact.  If one does not require a controller be continually running, it may be an option to wait a short time to see if either (a) there is another update to the kernel to better address the issues (not very likely) or (b) If UBNT is able to identify the cause and provide a fix or workaround.

 

Alternately, it may be better to not apply (or backout) the latest kernel update released yesterday if a continually-running UniFi controller is needed.

 

 

Ubiquiti Employee
Posts: 9,541
Registered: ‎01-28-2013
Kudos: 16771
Solutions: 608
Contributions: 20

Re: Unifi Controller on Debian 9

[ Edited ]

We're still actively investigating this. The problem appears to be triggered when running jsvc. There is also a bug report HERE. Lots of interesting discussion online today.. Anyway, we're very actively looking into this.

 

For the time being, as others have suggested, please revert to the previous kernel version (for those affected).

 

We will post an actual update later today. We probably will put a warning up, pointing to this thread in the interim, advising users to revert the kernel if they are affected by this issue (as that's the current known workaround). 

 

Cheers,

Mike

Emerging Member
Posts: 64
Registered: ‎02-09-2015
Kudos: 12

Re: Unifi Controller on Debian 9

Also broken on Debian 7.11 (Wheezy) with the latest kernel update.

Regular Member
Posts: 693
Registered: ‎01-23-2016
Kudos: 135
Solutions: 12

Re: Unifi Controller on Debian 9

can confirm that rolling back to kernel 4.4.0-79-generic  on Ubuntu fixes it all, without any aditional configuration needed

 

dpkg --list | grep linux-image  

apt-get install linux-image-4.4.0-79-generic linux-image-extra-4.4.0-79-generic linux-headers-4.4.0-79-generic linux-headers-4.4.0-79

apt-get purge linux-image-4.4.0-81-generic linux-image-extra-4.4.0- 81-generic

apt autoremove --purge

 

reboot ( hard power-off needed)

 

 

Member
Posts: 269
Registered: ‎02-08-2016
Kudos: 42

Re: Unifi Controller on Debian 9

Happened to me here on Ubuntu 16.04 when I upgraded to kernel 4.4.0-81. Backing off to 4.4.0-79 fixed the issue. I do have a crash dump for jsvc if any devs are interested.
New Member
Posts: 29
Registered: ‎01-02-2017
Kudos: 19

Re: Unifi Controller on Debian 9

I guess I'll stick with Debian 8.8 for a while longer then. Thanks guys for figuring this out.

 

Personally I am running Debian 8.8 with 5.4.x

root@unificontroller:/home/unifiadmin# uname -a
Linux unificontroller 4.9.0-0.bpo.2-amd64 #1 SMP Debian 4.9.18-1~bpo8+1 (2017-04-10) x86_64 GNU/Linux

 

(yes I'm on the jessie backports so rocking a newer kernel)


After updated apt list, there's a newer available, probably doesn't have the CVE fix yet but I'll put it on hold anyway and I'll keep an eye out on the must read post as well as this thread.

 

linux-image-4.9.0-0.bpo.2-amd64/jessie-backports,now 4.9.18-1~bpo8+1 amd64 [installed,automatic]
linux-image-amd64/now 4.9+79~bpo8+1 amd64 [installed,upgradable to: 4.9+80~bpo8+1]

 

 

New Member
Posts: 20
Registered: ‎02-17-2017
Kudos: 3

Re: Unifi Controller on Debian 9

Thanks for your input audio-catalyst, and to everyone for that matter.

Ive got around 15 sites running from an Amazon Ubuntu controller, and am a noob when it comes to Unix.

I found your commands fixed this same problem for me, although I had to tidy just a tad (remember Im a noob)

 

This is more for other noobs who may read this;

I wasnt root for some reason so had to add sudo to the start of some lines, and I also found youe third command has un unwanted space near the end...just before "81-generic", which kills the command

For somelike me, I didnt understand the return error, but found after rebooting (sudo reboot), my kernel had not downgraded. I repeated the process but carefully read the responses after each command to figure it out.

Im now back to 79-generic, and all my sites are back up!

Audio-catalyst, I owe you a beer Icon Wink

 

dpkg --list | grep linux-image  

sudo apt-get install linux-image-4.4.0-79-generic linux-image-extra-4.4.0-79-generic linux-headers-4.4.0-79-generic linux-headers-4.4.0-79

sudo apt-get purge linux-image-4.4.0-81-generic linux-image-extra-4.4.0-81-generic

sudo apt autoremove --purge

 

sudo reboot

New Member
Posts: 1
Registered: ‎01-14-2017

Re: Unifi Controller on Debian 9

I too was caught by this. Reverting back to 4.4.0-79 solved. In Ubuntu server 16.04, is it appropriate to use "apt-mark hold" command to bypass the 4.4.0-81 kernel update? My concerend is it doesn't get fixed before there are other system updates.

 

If so, I would assume the command would be something like this(?):

 

sudo apt-mark hold linux-image-4.4.0-81-generic linux-headers-4.4.0-81-generic

 

New Member
Posts: 38
Registered: ‎06-23-2016
Kudos: 13
Solutions: 1

Re: Unifi Controller on Debian 9

[ Edited ]

For those on Ubuntu 16.04 (or other recent Debian-based systems) you can easily set grub to boot the .79 kernel (or another backup kernel) without uninstalling/reinstalling anything by editing /etc/default/grub:

 

Back it up first:

 

sam@unifi12:~$ sudo cp -a /etc/default/grub /etc/default/grub.20170620

Look in /boot/grub/grub.cfg for the name of your previous kernel:

 

sam@unifi12:~$ less /boot/grub/grub.cfg 

Find the entry called 'Advanced options for Ubuntu', after which look for the first entry about the .79 kernel, which in my case is 'Ubuntu, with Linux 4.4.0-79-generic'.

 

Now you just need to concatentate these two items together, separated by a ">" sign and set your GRUB_DEFAULT value to that:

 

GRUB_DEFAULT="Advanced options for Ubuntu>Ubuntu, with Linux 4.4.0-79-generic"

Note the single quotes in the entry names have been removed and there are now double quotes around the whole definition.

 

Here's what a diff of the file looks like when you are done:

 

sam@unifi12:/etc/default$ diff grub grub.20170620
6,8c6
< ## following line changed by sam 20170620
< # GRUB_DEFAULT=0
< GRUB_DEFAULT="Advanced options for Ubuntu>Ubuntu, with Linux 4.4.0-79-generic"
---
> GRUB_DEFAULT=0

Now update grub:

 

sam@unifi12:/etc/default$ sudo update-grub
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.4.0-81-generic
Found initrd image: /boot/initrd.img-4.4.0-81-generic
Found linux image: /boot/vmlinuz-4.4.0-79-generic
Found initrd image: /boot/initrd.img-4.4.0-79-generic
Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin
done

And reboot the system:

 

sam@unifi12:/etc/default$ sudo telinit 6

After it comes up, verify the kernel is back to the .79 version:

 

sam@unifi12:~$ uname -a
Linux unifi12 4.4.0-79-generic #100-Ubuntu SMP Wed May 17 19:58:14 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

 

The UniFi controller should now be working.

 

Once an updated kernel comes out that includes a fix for this issue, just revert the change to /etc/default/grub (i.e., set GRUB_DEFAULT=0) and run sudo update-grub again.  

 

Then install the new kernel as usual and reboot your system.

New Member
Posts: 38
Registered: ‎06-23-2016
Kudos: 13
Solutions: 1

Re: Unifi Controller on Debian 9

For those on Ubuntu 16.04 (or other recent Debian-based systems) you can easily set grub to boot the .79 kernel (or another backup kernel) without uninstalling/reinstalling anything by editing /etc/default/grub:

 

Back it up first:

 

sam@unifi12:~$ sudo cp -a /etc/default/grub /etc/default/grub.20170620

Look in /boot/grub/grub.cfg for the name of your previous kernel:

 

sam@unifi12:~$ less /boot/grub/grub.cfg 

Find the entry called 'Advanced options for Ubuntu', after which look for the first entry about the .79 kernel, which in my case is 'Ubuntu, with Linux 4.4.0-79-generic'.

 

Now you just need to concatentate these two items together, separated by a ">" sign and set your GRUB_DEFAULT value to that:

 

GRUB_DEFAULT="Advanced options for Ubuntu>Ubuntu, with Linux 4.4.0-79-generic"

Note the single quotes in the entry names have been removed and there are now double quotes around the whole definition.

 

Here's what a diff of the file looks like when you are done:

 

sam@unifi12:/etc/default$ diff grub grub.20170620
6,8c6
< GRUB_DEFAULT="Advanced options for Ubuntu>Ubuntu, with Linux 4.4.0-79-generic"
---
> GRUB_DEFAULT=0

Now update grub:

 

sam@unifi12:/etc/default$ sudo update-grub
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-4.4.0-81-generic
Found initrd image: /boot/initrd.img-4.4.0-81-generic
Found linux image: /boot/vmlinuz-4.4.0-79-generic
Found initrd image: /boot/initrd.img-4.4.0-79-generic
Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin
done

And reboot the system:

 

sam@unifi12:/etc/default$ sudo telinit 6

After it comes up, verify the kernel is back to the .79 version:

 

sam@unifi12:~$ uname -a
Linux unifi12 4.4.0-79-generic #100-Ubuntu SMP Wed May 17 19:58:14 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

 

The UniFi controller should now be working.

New Member
Posts: 22
Registered: ‎03-12-2017
Kudos: 7

Re: Unifi Controller on Debian 9

Thanks to all, especially audio-catalyst.

 

I have rolled back to 4.4.0-79-generic and purged 4.4.0-81, which has brought my Unifi Video back up.

 

But I am also running my Unifi Controller on the same Ubuntu 16.04 virtual machine and the controller will not come back to life despite being on 4.4.0-79-generic.

 

I have tried re-installing the controller software and numerous reboots and service restarts but no joy.

 

Any help greatly appreciated.

Member
Posts: 279
Registered: ‎09-04-2015
Kudos: 66
Solutions: 5

Re: Unifi Controller on Debian 9

This kids, is why we use staging and testing environments Smiley LOL

"Be careful whose advice you buy, but be patient with those who supply it" - Mary Schmich
New Member
Posts: 22
Registered: ‎03-12-2017
Kudos: 7

Re: Unifi Controller on Debian 9

I thought this was a community designed to help Ubiquiti users, not a trolling ground to make dreadful people feel better about themselves.

 

None of my Ubiquiti devices are on bleeding edge betas, the controller on 5.4.16 and Ubuntu is 16.04 LTS.

 

If you have nothing constructive to offer you know where to go.

Reply