Mango Service not working on Windows 10
-
Yes We installed installservice.bat as Administrator, after installation I can able to see Mango service listed.(refer attachement)
But when we start our service, It stops immediately, (BuI i can able to run in Command prompt mode) -
Try to run the service, after it stops go to C:\Mango\logs\ma.log and post the context here so we can see what mango us doing.
insert the text in a code element. -
Hi,
I couldn't able to see any updates on C:\Mango\logs\ma.log file recently, I too cleared log file and restarted the service No updates on ma.log
I tried running services on command prompt below are updates. but services stopped again..
C:\Mango\yajsw\bat>startservice.bat
C:\Mango\yajsw\bat>cd C:\Mango\yajsw\bat\
C:\Mango\yajsw\bat>call setenv.bat
"java" -Xmx30m -Djna_tmpdir="C:\Mango\yajsw\bat/../tmp" -Djava.net.preferIPv4Stack=true -jar "C:\Mango\yajsw\bat/../wrapper.jar" -t "C:\Mango\yajsw\bat/../conf/wrapper.conf"
YAJSW: yajsw-stable-11.11
OS : Windows 10/10.0/x86
JVM : Oracle Corporation/1.8.0_201/C:\Program Files (x86)\Java\jre1.8.0_201/32
Apr 16, 2019 9:42:14 PM org.apache.commons.vfs2.VfsLog info
INFO: Using "C:\Users\L&TTOD~1\AppData\Local\Temp\vfs_cache" as temporary files store.
************* STARTING Mango ***********************Service Mango started
Press any key to continue . . . -
Hi KLN,
You can check the Windows event viewer, it may have details. It sounds like maybe 'java' isn't on the Path environment variable for the system user? Can you confirm you've added the C:\Path\to\jdk\bin\ to the system Path variable?
After that, I'd wonder if the paths in the wrapper.conf were correctly adjusted to where you installed Mango. I'll give the process a try tomorrow. It's been a long time since I did a Windows service installation so I'm not remembering all the subtleties This is a thread where someone ran into issues and figured them out: https://forum.infiniteautomation.com/topic/2270/windows-service-setup
-
Hi phildunlap,
Please find attached Environmental Setup screen shot.
Mango path on my PC as below.
C:\Mango
![alt text]My Wrapper.conf file details are below..
# WARNING - Do not modify any of the properties when an application # using this configuration file has been installed as a service or daemon. # Please uninstall the service before modifying this file. The # service must then be reinstalled. #******************************************************************** # working directory #******************************************************************** ## Edit: wrapper.working.dir=C:\\Mango\\bin\\ #******************************************************************** # tmp folder # yajsw creates temporary files named in_.. out_.. err_.. jna.. # per default these are placed in jna.tmpdir. # jna.tmpdir is set in setenv batch file to <yajsw>/tmp #******************************************************************** wrapper.tmp.path = ${jna_tmpdir} #******************************************************************** # Application main class or native executable # One of the following properties MUST be defined #******************************************************************** # Java Application main class wrapper.java.app.mainclass=com.serotonin.m2m2.Main #******************************************************************** # Wrapper Logging Properties #******************************************************************** # Log Level for console output. (See docs for log levels) wrapper.console.loglevel=INFO # Log file to use for wrapper output logging. wrapper.logfile=${wrapper_home}\/log\/wrapper.log # Maximum size that the log file will be allowed to grow to before # the log is rolled. Size is specified in bytes. The default value # of 0, disables log rolling by size. May abbreviate with the 'k' (kB) or # 'm' (mB) suffix. For example: 10m = 10 megabytes. # If wrapper.logfile does not contain the string ROLLNUM it will be automatically added as suffix of the file name wrapper.logfile.maxsize=10m # Maximum number of rolled log files which will be allowed before old # files are deleted. The default value of 0 implies no limit. wrapper.logfile.maxfiles=10 #******************************************************************** # Application Console Properties #******************************************************************** # Title to use when running as a console wrapper.console.title=com.serotonin.m2m2.Main #******************************************************************** # Wrapper Windows Service and Posix Daemon Properties #******************************************************************** # Name of the service wrapper.ntservice.name=Mango # Display name of the service wrapper.ntservice.displayname=Mango # Description of the service wrapper.ntservice.description=Mango Automation #******************************************************************** # Wrapper Posix Daemon Properties #******************************************************************** # The following grooy script should set it correctly for most distros wrapper.daemon.run_level_dir=${if (new File('\/etc\/rc0.d').exists()) return '\/etc\/rcX.d' else return '\/etc\/init.d\/rcX.d'} #******************************************************************** # Wrapper System Tray Properties #******************************************************************** # enable system tray wrapper.tray = true # TCP/IP port. If none is defined multicast discovery is used to find the port # Set the port in case multicast is not possible. wrapper.tray.port = 15002 #******************************************************************** # Exit Code Properties # Restart on non zero exit code #******************************************************************** wrapper.on_exit.0=SHUTDOWN wrapper.on_exit.default=RESTART #******************************************************************** # Trigger actions on console output #******************************************************************** # On Exception show message in system tray wrapper.filter.trigger.0=Exception wrapper.filter.script.0=scripts\/trayMessage.gv wrapper.filter.script.0.args=Exception #******************************************************************** # genConfig: further Properties generated by genConfig #******************************************************************** placeHolderSoGenPropsComeHere= wrapper.java.command = java # Edit: wrapper.java.classpath.1 = C:\\Mango\\overrides\\classes wrapper.java.classpath.2 = C:\\Mango\\classes wrapper.java.classpath.3 = C:\\Mango\\overrides\\properties wrapper.java.classpath.4 = C:\\Mango\\overrides\\lib\\*.jar wrapper.java.classpath.5 = C:\\Mango\\lib\\*.jar wrapper.java.additional.1 = -server wrapper.java.additional.2 = -Dma.home=C:\\Mango
-
What is in your C:\Mango\yajsw\log\wrapper file when you start the service ?
-
Hi,
I just freshly installed service and below are the log file ( C:\Mango\yajsw\log\wrapper)................
INFO|wrapper|Service com.serotonin.m2m2.Main|19-04-17 15:36:17|ahessian jmx service bound to port 15002
INFO|wrapper|Service com.serotonin.m2m2.Main|19-04-17 15:36:17|working dir C:\Mango\bin
INFO|wrapper|Service com.serotonin.m2m2.Main|19-04-17 15:36:17|started process with pid 9028
INFO|wrapper|Service com.serotonin.m2m2.Main|19-04-17 15:36:18|restart process due to default exit code rule
INFO|wrapper|Service com.serotonin.m2m2.Main|19-04-17 15:36:18|restart internal RUNNING
INFO|wrapper|Service com.serotonin.m2m2.Main|19-04-17 15:36:18|stopping process with pid/timeout 9028 45000
INFO|wrapper|Service com.serotonin.m2m2.Main|19-04-17 15:36:18|process exit code: 4
INFO|wrapper|Service com.serotonin.m2m2.Main|19-04-17 15:36:23|working dir C:\Mango\bin
INFO|wrapper|Service com.serotonin.m2m2.Main|19-04-17 15:36:23|started process with pid 8384
INFO|wrapper|Service com.serotonin.m2m2.Main|19-04-17 15:36:24|restart process due to default exit code rule
INFO|wrapper|Service com.serotonin.m2m2.Main|19-04-17 15:36:24|restart internal RUNNING
INFO|wrapper|Service com.serotonin.m2m2.Main|19-04-17 15:36:24|stopping process with pid/timeout 8384 45000
INFO|wrapper|Service com.serotonin.m2m2.Main|19-04-17 15:36:24|process exit code: 4
INFO|wrapper|Service com.serotonin.m2m2.Main|19-04-17 15:36:29|working dir C:\Mango\bin
INFO|wrapper|Service com.serotonin.m2m2.Main|19-04-17 15:36:29|started process with pid 10676
INFO|wrapper|Service com.serotonin.m2m2.Main|19-04-17 15:36:30|restart process due to default exit code rule
INFO|wrapper|Service com.serotonin.m2m2.Main|19-04-17 15:36:30|restart internal RUNNING
INFO|wrapper|Service com.serotonin.m2m2.Main|19-04-17 15:36:30|stopping process with pid/timeout 10676 45000
INFO|wrapper|Service com.serotonin.m2m2.Main|19-04-17 15:36:30|process exit code: 4
INFO|wrapper|Service com.serotonin.m2m2.Main|19-04-17 15:36:35|working dir C:\Mango\bin
INFO|wrapper|Service com.serotonin.m2m2.Main|19-04-17 15:36:35|started process with pid 504
INFO|wrapper|Service com.serotonin.m2m2.Main|19-04-17 15:36:36|restart process due to default exit code rule
INFO|wrapper|Service com.serotonin.m2m2.Main|19-04-17 15:36:36|restart internal RUNNING
INFO|wrapper|Service com.serotonin.m2m2.Main|19-04-17 15:36:36|stopping process with pid/timeout 504 45000
INFO|wrapper|Service com.serotonin.m2m2.Main|19-04-17 15:36:36|process exit code: 4
INFO|wrapper|Service com.serotonin.m2m2.Main|19-04-17 15:36:41|working dir C:\Mango\bin
INFO|wrapper|Service com.serotonin.m2m2.Main|19-04-17 15:36:41|started process with pid 4200
INFO|wrapper|Service com.serotonin.m2m2.Main|19-04-17 15:36:42|restart process due to default exit code rule
INFO|wrapper|Service com.serotonin.m2m2.Main|19-04-17 15:36:42|restart internal RUNNING
INFO|wrapper|Service com.serotonin.m2m2.Main|19-04-17 15:36:42|stopping process with pid/timeout 4200 45000
INFO|wrapper|Service com.serotonin.m2m2.Main|19-04-17 15:36:42|process exit code: 4
INFO|wrapper|Service com.serotonin.m2m2.Main|19-04-17 15:36:47|working dir C:\Mango\bin
INFO|wrapper|Service com.serotonin.m2m2.Main|19-04-17 15:36:47|started process with pid 2528
INFO|wrapper|Service com.serotonin.m2m2.Main|19-04-17 15:36:48|too many restarts
INFO|wrapper|Service com.serotonin.m2m2.Main|19-04-17 15:36:48|process not in state RUNNING -> Delaying stop
INFO|wrapper|Service com.serotonin.m2m2.Main|19-04-17 15:36:48|calling onStop
INFO|wrapper|Service com.serotonin.m2m2.Main|19-04-17 15:36:48|Win service stop - timeout: 30000
INFO|wrapper|Service com.serotonin.m2m2.Main|19-04-17 15:36:48|Win service wrapper.control -> stopping application
INFO|wrapper|Service com.serotonin.m2m2.Main|19-04-17 15:36:48|Win service stop - after shutdown
INFO|wrapper|Service com.serotonin.m2m2.Main|19-04-17 15:36:48|Win service stop - before notify
INFO|wrapper|Service com.serotonin.m2m2.Main|19-04-17 15:36:48|Win service terminated -
Why did you show me the JAVA_HOME variable when I asked about the Path variable? If you run
java -version
in a command prompt, what do you get?You can see in the wrapper.conf that
wrapper.java.command = java
so it's not going through the Mango startup scripts as would normally be done, it's invoking java directly. -
My variable name:JAVA_HOME
Now I changed back to
wrapper.java.command = %JAVA_HOME%/bin/javaWhile Starting Service Now I am getting error as
Error2: The system cannot find the file specified
-
One problem with that is that you've apparently defined JAVA_HOME in the User variables instead of the system variables.
Now I changed back to
wrapper.java.command = %JAVA_HOME%/bin/javaI don't know what you mean, "changed back to" as the zip you'd have gotten from our instructions on the setup had,
wrapper.java.command = java
So please check the Path variable for the system user. I am not sure if you could use JAVA_HOME as you have tried, but you would certainly have to define it as a variable for the system user to do so.
-
I am having the same problem. I've been following this thread as well as a post from three years ago: https://forum.infiniteautomation.com/topic/2270/windows-service-setup/7
We've set our JAVA_Home variable and edited the PATH variable as well:
Where would we find our wrapper.config file?
Is there currently a patch for this or in the works? We are getting this issue with every Windows 10 device we try to load Mango 3 to.
Thank you.
-
Hi gquiroz,
Where would we find our wrapper.config file?
If you downloaded the yajsw from the link on this page: https://help.infiniteautomation.com/installing-services
the wrapper.conf would be mostly set up for Mango, and would be in yajsw/conf/
You may find the suggestion in this thread useful as an alternative to doing a yajsw service, since it has its own issues like not restarting when restarted via the modules page or during an upgrade: https://forum.infiniteautomation.com/topic/4168/mango-not-starting-back-up-after-restart-within-mango/5
-
Thanks!
I was able to get the service up and running with a system power cycle.
-
@phildunlap said in Mango Service not working on Windows 10:
We are experiencing this issue again. As KLN describes, the service does successfully install and we can see that it is running. But when trying to run mango on the browser, it cannot connect to local host. From your recommendation on https://forum.infiniteautomation.com/topic/4168/mango-not-starting-back-up-after-restart-within-mango/4 where would the event handler to create the Mango/RESTART file go?
-
where would the event handler to create the Mango/RESTART file go?
On the system startup event.