Upcoming Maintenance Alert:

The UBNT Community will be upgraded at 5pm MDT on April 25th. During this time the community forums will be set to read-only status.

Learn more

×
Reply
New Member
Posts: 6
Registered: ‎11-28-2016
Kudos: 1
Solutions: 1
Accepted Solution

Unable to access Unifi WebGUI on Linux box (Ubuntu 16.04)

[ Edited ]

Hi all!

 

Hopefully, someone can give me some insight here. I have recently tried installing the Unifi Controller onto a Raspberry Pi running Ubuntu 16.04.  And for whatever reason, I absolutely cannot get access to the web GUI.

 

Running sudo service unifi status returns this:

● unifi.service - unifi
   Loaded: loaded (/lib/systemd/system/unifi.service; enabled; vendor preset: enabled)
   Active: active (running) since Wed 2017-04-19 20:32:18 EDT; 1min 44s ago
  Process: 4252 ExecStop=/usr/lib/unifi/bin/unifi.init stop (code=exited, status=0/SUCCESS)
  Process: 4354 ExecStart=/usr/lib/unifi/bin/unifi.init start (code=exited, status=0/SUCCESS)
 Main PID: 4421 (jsvc)
   CGroup: /system.slice/unifi.service
           ├─4421 unifi -home /usr/lib/jvm/java-8-openjdk-armhf -cp /usr/share/java/commons-daemon.jar:/usr/lib/unifi/lib/ace.jar -pidfile /var/run/uni
           ├─4422 unifi -home /usr/lib/jvm/java-8-openjdk-armhf -cp /usr/share/java/commons-daemon.jar:/usr/lib/unifi/lib/ace.jar -pidfile /var/run/uni
           ├─4423 unifi -home /usr/lib/jvm/java-8-openjdk-armhf -cp /usr/share/java/commons-daemon.jar:/usr/lib/unifi/lib/ace.jar -pidfile /var/run/uni
           ├─4451 /usr/lib/jvm/java-8-openjdk-armhf/jre/bin/java -Xmx1024M -XX:ErrorFile=/usr/lib/unifi/data/logs/hs_err_pid<pid>.log -Dapple.awt.UIEle
           └─4634 bin/mongod --dbpath /usr/lib/unifi/data/db --port 27117 --logappend --logpath logs/mongod.log --nohttpinterface --bind_ip 127.0.0.1

Apr 19 20:32:17 Bradyn-PI systemd[1]: Starting unifi...
Apr 19 20:32:17 Bradyn-PI unifi.init[4354]:  * Starting Ubiquiti UniFi Controller unifi
Apr 19 20:32:18 Bradyn-PI unifi.init[4354]:    ...done.
Apr 19 20:32:18 Bradyn-PI systemd[1]: Started unifi.

So it seems like it's booting properly.

 

But this is the server.log file. UUID and Firmware updates redacted.

[2017-04-19 20:08:56,274] <launcher> INFO  system - *** Running for the first time, creating identity ***
[2017-04-19 20:08:56,287] <launcher> INFO  system - UUID: *REDACTED*
[2017-04-19 20:08:56,304] <launcher> INFO  system - ======================================================================
[2017-04-19 20:08:56,306] <launcher> INFO  system - UniFi 5.4.14 (build atag_5.4.14_9202 - release) is started
[2017-04-19 20:08:56,307] <launcher> INFO  system - ======================================================================
[2017-04-19 20:08:56,373] <launcher> INFO  system - BASE dir:/usr/lib/unifi
[2017-04-19 20:08:56,510] <launcher> INFO  system - Current System IP: 10.0.0.40
[2017-04-19 20:08:56,512] <launcher> INFO  system - Hostname: Bradyn-PI
[2017-04-19 20:08:56,545] <launcher> INFO  system - Valid keystore is missing. Generating one ...
[2017-04-19 20:08:56,547] <launcher> INFO  system - Generating Certificate[UniFi]... please wait...
[2017-04-19 20:16:13,026] <launcher> INFO  system - Certificate[UniFi] generated!
[2017-04-19 20:16:15,761] <launcher> INFO  db     - waiting for db connection...
[2017-04-19 20:16:16,264] <launcher> INFO  db     - Connecting to mongodb://127.0.0.1:27117
[2017-04-19 20:16:27,000] <launcher> INFO  db     - Connecting to mongodb://127.0.0.1:27117
[2017-04-19 20:16:37,385] <launcher> INFO  webrtc - WebRTC library version: EvoStream Media Server (www.evostream.com) build v1.0.8 - Gladiator - (bui$

 

I have tried changing Unifi's ports through the system.properties file to no avail. As I noticed after I made my changes, Unifi changed it back to default!

 

I also used 

netstat -peanut

And I have found zero conflicting packages. 

 

I'm really not sure at all what could be causing this. I have already been through every forum post I could find and none of the solutions I have found work. The most I can find is a possible problem with Tomcat, but again, netstat shows no conflicts.

 

any help or suggestions are greatly appreciated!

 

 

 


Accepted Solutions
New Member
Posts: 6
Registered: ‎11-28-2016
Kudos: 1
Solutions: 1

Re: Unable to access Unifi WebGUI on Linux box (Ubuntu 16.04)

***UPDATE*** PROBLEM SOLVED!

 

Hi everyone.

 

Thanks to all who provided input on helping me solve my issue. As of now I have fixed my installation, and it's working flawlessly! I am using this post to hopefully help others if they have the same issue.

 

The way I fixed it is thus:

 

TL;DR: MongoDB not installed, static IP route set incorrectly. For raspian you can just use apt-get install mongodb. But for Ubuntu you must follow a guide.

 

I gave up on using MATE Ubuntu. (Which was really hard because I'm an Ubuntu fanboy) But I ended up installing Raspbian Jessie on my RPI.

 

I first added the unifi repository to my raspberry before I was able to apt-get install. I also had to add a repo key for MongoDB and Unifi to securely store credentials. This is where I ran into my first issue. Every time I requested a key, I got back the error: Network Unreachable. This was because I set up my controller with a static IP, and for whatever reason, raspbian did not store my gateway IP. So I ran 

 sudo route add default gw 192.168.1.1

 Where '192.168.1.1' was 10.0.0.1 because that's my gateway IP (obviously). After that, everything that needed network connectivity worked fine. Finally, I was able to run                                                                                                                                

 

sudo apt-get update
sudo apt-get install unifi

It worked! But then I tried to access the web GUI aaand same problem as before! hooray! Then I had a hunch. so I installed mongo just to be safe. 

sudo apt-get install mongodb


Holy S*** it works now!

 

The whole time it was because I didn't have MongoDB installed, So it's possible that it would have worked with MATE but we simply overlooked this very simple issue.

 

Thanks again to everyone!

 

 

View solution in original post


All Replies
Regular Member
Posts: 442
Registered: ‎12-05-2016
Kudos: 124
Solutions: 47

Re: Unable to access Unifi WebGUI on Linux box (Ubuntu 16.04)

May be a dumb question but what URL are you using to access the GUI?

Have you tried switching from the open JDK to the oracle one? (There are posts available on how to do that)
New Member
Posts: 6
Registered: ‎11-28-2016
Kudos: 1
Solutions: 1

Re: Unable to access Unifi WebGUI on Linux box (Ubuntu 16.04)

[ Edited ]

cainmp wrote:
May be a dumb question but what URL are you using to access the GUI?

Have you tried switching from the open JDK to the oracle one? (There are posts available on how to do that)

The box is on 10.0.0.40 so I use the url http://10.0.0.40:8443 to access it. All I get back is a refused to connect error.

 

I didn't know I wasn't running the official oracle java, so I will have to try that and get back.

Regular Member
Posts: 442
Registered: ‎12-05-2016
Kudos: 124
Solutions: 47

Re: Unable to access Unifi WebGUI on Linux box (Ubuntu 16.04)

You need to use either httpS://10.0.0.40:8443/ or http://10.0.0.40:8080 (which redirects to httpS://10.0.0.40:8443/)

Open jdk works fine, but I remember reading people had performance gains on the RPI3 when switching to oracle Java.
New Member
Posts: 6
Registered: ‎11-28-2016
Kudos: 1
Solutions: 1

Re: Unable to access Unifi WebGUI on Linux box (Ubuntu 16.04)

[ Edited ]

Adding the httpS at the beginning does not help. chrome is smart enough to know that 8443 is a secure port anyways. Still ends up with a "Refused to connect" Error.

 

I do think i just really jacked up my box however when attempting to intall oracle java. The install was unsuccessful so I think I will need to wipe and start fresh tomorrow here.

Regular Member
Posts: 442
Registered: ‎12-05-2016
Kudos: 124
Solutions: 47

Re: Unable to access Unifi WebGUI on Linux box (Ubuntu 16.04)

IMO chrome (or any browser) is not smart enough to know that any port aside from plain old 443 is secure without specifying. On my ubuntu install, I need to hit either https://hostname:8443 or http://hostname:8080, nothing else works from any browser.
New Member
Posts: 6
Registered: ‎11-28-2016
Kudos: 1
Solutions: 1

Re: Unable to access Unifi WebGUI on Linux box (Ubuntu 16.04)

Huh, well I never had an issue before with not specifying https or standard http on my current controller. I still think there's a deeper problem though.

My browser does not seem to be an issue considering I have tried Mozilla and chrome both with your recommendations.
Regular Member
Posts: 442
Registered: ‎12-05-2016
Kudos: 124
Solutions: 47

Re: Unable to access Unifi WebGUI on Linux box (Ubuntu 16.04)

Based on your logs, your controller is running, and the error you reported (connection refused) I have seen multiple times when not specifying the httpS.

 

Aside from trying to blow everything away and start clean, I don't have any other recommendations.

New Member
Posts: 6
Registered: ‎11-28-2016
Kudos: 1
Solutions: 1

Re: Unable to access Unifi WebGUI on Linux box (Ubuntu 16.04)

Thanks for the help. Its just a RPI so re-imaging it isn't a huge deal. If it still doesn't work, I will probably start a new thread with some new info.
Emerging Member
Posts: 73
Registered: ‎12-17-2016
Kudos: 9
Solutions: 1

Re: Unable to access Unifi WebGUI on Linux box (Ubuntu 16.04)

I had the same issue with Ubuntu MATE (using these instructions). After starting over using Raspbian, it worked.

Ubiquiti USG 3P | UniFi Switch 24 | UniFi Switch 8 | UAP-AC-M-PRO | UAP-AC-M | UAP-Outdoor-5 | TP-Link TL-SG105E (2) | Raspberry Pi 3 (UniFi Controller and Pi-Hole)
New Member
Posts: 6
Registered: ‎11-28-2016
Kudos: 1
Solutions: 1

Re: Unable to access Unifi WebGUI on Linux box (Ubuntu 16.04)

***UPDATE*** PROBLEM SOLVED!

 

Hi everyone.

 

Thanks to all who provided input on helping me solve my issue. As of now I have fixed my installation, and it's working flawlessly! I am using this post to hopefully help others if they have the same issue.

 

The way I fixed it is thus:

 

TL;DR: MongoDB not installed, static IP route set incorrectly. For raspian you can just use apt-get install mongodb. But for Ubuntu you must follow a guide.

 

I gave up on using MATE Ubuntu. (Which was really hard because I'm an Ubuntu fanboy) But I ended up installing Raspbian Jessie on my RPI.

 

I first added the unifi repository to my raspberry before I was able to apt-get install. I also had to add a repo key for MongoDB and Unifi to securely store credentials. This is where I ran into my first issue. Every time I requested a key, I got back the error: Network Unreachable. This was because I set up my controller with a static IP, and for whatever reason, raspbian did not store my gateway IP. So I ran 

 sudo route add default gw 192.168.1.1

 Where '192.168.1.1' was 10.0.0.1 because that's my gateway IP (obviously). After that, everything that needed network connectivity worked fine. Finally, I was able to run                                                                                                                                

 

sudo apt-get update
sudo apt-get install unifi

It worked! But then I tried to access the web GUI aaand same problem as before! hooray! Then I had a hunch. so I installed mongo just to be safe. 

sudo apt-get install mongodb


Holy S*** it works now!

 

The whole time it was because I didn't have MongoDB installed, So it's possible that it would have worked with MATE but we simply overlooked this very simple issue.

 

Thanks again to everyone!

 

 

Reply