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: 8
Registered: ‎08-02-2012
Accepted Solution

UniFi Controller as Service not working...

I tried to set up the controller as a service... No luck.

The "PATH" mentioned in the instructions...

Computer>Properties>Advanced>Environmental Variables...? Correct?

I added my Java Path to the string. C:\Program files\java\jre7

ran the command prompt instructions and successfully installed Controller service.
- It shows up as a service under the services listing.

When I start the service I get an error:

The unifi controller could not be started.
A service specific error occurred: 0.
More help is available by typing NET HELPMSG 3547.

I am running the controller on a windows 7 terminal.

Thoughts?

Accepted Solutions
New Member
Posts: 10
Registered: ‎03-06-2014
Kudos: 1
Solutions: 1

Re: UniFi Controller as Service not working...

I needed the 32bit version also, no mention of it in the wiki but after finding this thread, I got it to work. Thanks to all for posting. 

View solution in original post


All Replies
Member
Posts: 121
Registered: ‎11-16-2012
Kudos: 10
Solutions: 1

Re: UniFi Controller as Service not working...

I installed 2.3.9 as service.
Had to remove jre7 and use jre6
jre7 caused problems to me.
good luck
New Member
Posts: 8
Registered: ‎08-02-2012

Re: UniFi Controller as Service not working...

I was able to remove the J7 and the service runs; however. I cannot log on to the controller now. I attempted the http://IP:8443/manage, to access,

but no luck getting the controller. I suspect that the service is not really working.

 

Thoughts?

Member
Posts: 121
Registered: ‎11-16-2012
Kudos: 10
Solutions: 1

Re: UniFi Controller as Service not working...

It's httpS

 

New Member
Posts: 8
Registered: ‎08-02-2012

Re: UniFi Controller as Service not working...

Thanks, that did it.

New Member
Posts: 37
Registered: ‎07-30-2011
Kudos: 5

Re: UniFi Controller as Service not working...

Ok, is there a way to get the 2.4.5 to run as a service on a 2012?

Server: Windows 2012
Installed java 7.0.45 64-bit in c:\program files\java BEFORE the Unifi installation.
Installed Unifi 2.4.5 and it starts ok.
Verfied that java is reachable from <unifi_base>, added the path to the java exe just to be sure.

Adds the Unifi as a service according to the FAQ: java -jar lib\ace.jar installsvc from the <unifi_base>
The service refuse to start. System log shows Event ID: 7024
"The UniFi Controller service terminated with the following service-specific error:
The operation completed successfully."



 

Ubiquiti Employee
Posts: 6,686
Registered: ‎01-28-2013
Kudos: 6975
Solutions: 568
Contributions: 20

Re: UniFi Controller as Service not working...

[ Edited ]

Hi,

I don't have Windows 2012, but on Win7 + 8.1 it works fine with J7U45. Both are x64 systems and I just tested this yesterday. So I freshly installed Java x86 and x64 using the manual executables. This was with 2.4.6 though, not 2.4.5...

When I installed it I didn't run it after the install. The paths I had added were ;C:\Program Files\Java\jre7\bin\;C:\Program Files (x86)\Java\jre7\bin\. I went directly to the UniFi_base\lib directory and ran java -jar ace.jar installsvc from an elevated command prompt (although on server I would guess that it's elevated to admin by default). 

I wonder what's different in the backend causing this...hmm...Another user recently uninstalled J7U45 x86 then reinstalled with the manual install file and the service worked... but different version of Windows again...

I know this doesn't really solve your issue. I just thought I'd add that this as it is working for most, although it may require some fooling with Java installs.

Thanks,
Mike

UBNT_Alternate_Logo.png
New Member
Posts: 37
Registered: ‎07-30-2011
Kudos: 5

Re: UniFi Controller as Service not working...

Thanks for your input. Installed the -32bit Java 7.0.45 and added that to the path and after that i could start the service.

Unifi seems to need the 32-bit version when running as a service. When starting Unifi from the desktop icon it uses the 64-bit version. Very annoying and should really be in your FAQ

 

Ubiquiti Employee
Posts: 6,686
Registered: ‎01-28-2013
Kudos: 6975
Solutions: 568
Contributions: 20

Re: UniFi Controller as Service not working...


Magren wrote:

Thanks for your input. Installed the -32bit Java 7.0.45 and added that to the path and after that i could start the service.

Unifi seems to need the 32-bit version when running as a service. When starting Unifi from the desktop icon it uses the 64-bit version. Very annoying and should really be in your FAQ

 


You're welcome. Glad that worked. Duly noted and I'll modify the KB article to reflect this, thanks for pointing that out.

Thanks,
Mike

UBNT_Alternate_Logo.png
New Member
Posts: 10
Registered: ‎03-06-2014
Kudos: 1
Solutions: 1

Re: UniFi Controller as Service not working...

I needed the 32bit version also, no mention of it in the wiki but after finding this thread, I got it to work. Thanks to all for posting. 

New Member
Posts: 1
Registered: ‎03-07-2016

Re: UniFi Controller as Service not working...

Hello,

 

I had the same problem with the service. When I stared the installation of the service I uninstalled Java 32 bits and didn't works the service, didn't start...

Finally, I reintalled Java 32 bits, and now works fine.

 

Alex Vega

New Member
Posts: 3
Registered: ‎12-22-2016
Kudos: 1

Re: UniFi Controller as Service not working...

[ Edited ]

Upgrade from 4.6.6 to 5.3.8

 

Our server is running 2008R2 64-bit.  We have a 32-bit program hosted, so that is running under JRE7 32-bit.  5.3.8 updated fine with the 32-bit JRE, but the service needed to be installed with JRE8 64-bit. The PATH Environment Variable needs to be set to the 64-bit path, which for our version of JRE was ;C:\Program Files\Java\jre1.8.0_111\bin (don't forget to add the ; before the path if you are adding this path as an additional variable)

 

Once the Path variable is set, then you can setup the service:

Steps


  1. Close any instances of the UniFi software on the controller
  2. Open the command prompt as an Administrator
  3. Run Command Prompt as an Administrator, then change directory to the location of UniFi in your computer, using the command:
    cd "%UserProfile%\Ubiquiti UniFi\"
  4. Once in the root of the UniFi folder, issue the following:
    “java -jar lib\ace.jar installsvc”

Note: you will need to use Java JRE 8, which you can download HERE. For the UniFi cloud service (unifi.ubnt.com) to work, you need to use x64 Java only.

When upgrading the service first run "java -jar lib/ace.jar uninstallsvc" to remove the old the service. After the update is complete, run "java -jar lib/ace.jar installsvc" to install the service for the updated controller instance.

If you simply stop the service, then start the service you will have duplicate services running. 

New Member
Posts: 1
Registered: ‎04-13-2017

Re: UniFi Controller as Service not working...

Free some spaces on the drive where is unify controller is installed


purityspring wrote:
I tried to set up the controller as a service... No luck.

The "PATH" mentioned in the instructions...

Computer>Properties>Advanced>Environmental Variables...? Correct?

I added my Java Path to the string. C:\Program files\java\jre7

ran the command prompt instructions and successfully installed Controller service.
- It shows up as a service under the services listing.

When I start the service I get an error:ree

 

New Member
Posts: 10
Registered: ‎07-13-2016
Kudos: 1

Re: UniFi Controller as Service not working...

I got it to work

 

how i started

running unifi from symbol on desktop worked

installed as service C:\Program Files\Ubiquiti UniFi>java -jar lib\ace.jar installsvc

service didn't start showing error %%1 55006E006900460069000000 (text: Unzulässige Funktion)

 

 

helped nothing:

- moving or making symlink (mklink -j) to program files directory and install service from there

- changing permissions granting everyone full access to the install directory (I reverted that later)

 

for me to get it working i needed to do: (1)

uninstall unifi service (not unifi program)

uninstall java

install java (64 bit offline)

install unifi service

 

then Service started but i got another problem: No connection

 

for me to get it working i needed to do: (2)

Then i had to go to the advanced windows firewall and find the firewall rule for java and change the path from the x86 to the correct place. (delete the (x86) afther the "C:/Program Files" in at least two lines (java.exe). granting access in tcp and udp

 

--> Voilà the service runs and accepts connections, is reachable from the inside of the computer and the outside, the app and the UAPs

 

I am a dissapointed about six things:

- Java wouldn't remove firewall entries on deinstallation

- Unifi service is known as java.exe to the firewall so it can't be controlled separately from other java programs (that i actually don't have unless i get some malware written in java that now get access to the network)

- unifi doesn't deliver a installer where i can select options: 1: where to install and 2: to install the service and start it up automatically

- unifi doesn't deliver java in the same way they deliver mongodb. (That's not possible i know)

- update the controller from within the webinterface is not possible (at least windwos version, that i know) 

- when updating one MUST remember that the controller is installed as service and that he has to go to the commandline and stop / uninstall the service bevore he / she uptdates the software.

 

my wish would be:

Ubiquiti finds a way to compile the software in a manner no java is needed (hopefully that's possible without rewriting the whole software and maintaining the software completely separate for win osx linux and cloud key) and that they work at the installer that offers the possibility to install a service and a updater that can be controlled from within the webinterface.

 

What i didn't try and even didn't look for: having the controller inside a virtual machine. maybe it would be possible for unifi to deliver the software as a virtual appliance that i can plug in in my existing hyper-v or vmware or virtualbox that i can run headless on any hardware and operating system. If they would do that they could have complete control over the system and auto-update and such functions would be more easy to achieve.

 

New Member
Posts: 15
Registered: ‎09-25-2013
Kudos: 1

Re: UniFi Controller as Service not working...

Hello.

Im having the same issue anfter an upgrade of the Unifi Controller to the latest version.

I didnt think to much of the service so i just stopped the service in servermanager och then ran the upgrade (without any issues) and then tryed to start the service again.

 

Like so many others i get this in the evetlog: "The UniFi Controller service terminated with the following service-specific error: Incorrect function."

 

I have tried downloading the latest Java 32bit (i only had 32bit installed befor, but an older version). I have removed the service and installed again (witch works fine), but i cant start the service.

I checked the PATH varible and the only one i have is: C:\Program Files (x86)\Java\jre1.8.0_131\bin and that is a valid path to the java library.

I have no other installation of java from what i can see.

Anyone have any suggestions?

New Member
Posts: 10
Registered: ‎07-13-2016
Kudos: 1

Re: UniFi Controller as Service not working...

Did you uninstall and reinstall the service?
New Member
Posts: 3
Registered: ‎12-22-2016
Kudos: 1

Re: UniFi Controller as Service not working...

See my reply above.  You'll need JRE8 x64.

New Member
Posts: 15
Registered: ‎09-25-2013
Kudos: 1

Re: UniFi Controller as Service not working...

Great. That worked! Thanx!
Hiwever, this is pretty stupid. Why do you need install both x86 and x64 just for the service to run?
And PLEASE rewite the software in something other then java... Thatway we can all be happy and uninstall java everywhere!
New Member
Posts: 3
Registered: ‎12-22-2016
Kudos: 1

Re: UniFi Controller as Service not working...

Agreed.  This is one of the few pieces of software that is very finicky about the platform architecture and version.  Java is OS independent though, so I can see why UBNT developed it in Java.  There's no clear reason IMHO as to why they would have needed to develop it in 64-bit.

New Member
Posts: 3
Registered: ‎05-07-2015

Re: UniFi Controller as Service not working...

[ Edited ]

rony-ch wrote:

I got it to work

 

how i started

running unifi from symbol on desktop worked

installed as service C:\Program Files\Ubiquiti UniFi>java -jar lib\ace.jar installsvc

service didn't start showing error %%1 55006E006900460069000000 (text: Unzulässige Funktion)

 

 

helped nothing:

- moving or making symlink (mklink -j) to program files directory and install service from there

- changing permissions granting everyone full access to the install directory (I reverted that later)

 

for me to get it working i needed to do: (1)

uninstall unifi service (not unifi program)

uninstall java

install java (64 bit offline)

install unifi service

 

then Service started but i got another problem: No connection

 

for me to get it working i needed to do: (2)

Then i had to go to the advanced windows firewall and find the firewall rule for java and change the path from the x86 to the correct place. (delete the (x86) afther the "C:/Program Files" in at least two lines (java.exe). granting access in tcp and udp

 

--> Voilà the service runs and accepts connections, is reachable from the inside of the computer and the outside, the app and the UAPs

 

I am a dissapointed about six things:

- Java wouldn't remove firewall entries on deinstallation

- Unifi service is known as java.exe to the firewall so it can't be controlled separately from other java programs (that i actually don't have unless i get some malware written in java that now get access to the network)

- unifi doesn't deliver a installer where i can select options: 1: where to install and 2: to install the service and start it up automatically

- unifi doesn't deliver java in the same way they deliver mongodb. (That's not possible i know)

- update the controller from within the webinterface is not possible (at least windwos version, that i know) 

- when updating one MUST remember that the controller is installed as service and that he has to go to the commandline and stop / uninstall the service bevore he / she uptdates the software.

 

my wish would be:

Ubiquiti finds a way to compile the software in a manner no java is needed (hopefully that's possible without rewriting the whole software and maintaining the software completely separate for win osx linux and cloud key) and that they work at the installer that offers the possibility to install a service and a updater that can be controlled from within the webinterface.

 

What i didn't try and even didn't look for: having the controller inside a virtual machine. maybe it would be possible for unifi to deliver the software as a virtual appliance that i can plug in in my existing hyper-v or vmware or virtualbox that i can run headless on any hardware and operating system. If they would do that they could have complete control over the system and auto-update and such functions would be more easy to achieve.

 


 

Thanks for this. Worked perfectly Icon Smile

Reply