Please Note This forum exists for community support for the Mango product family and the Radix IoT Platform. Although Radix IoT employees participate in this forum from time to time, there is no guarantee of a response to anything posted here, nor can Radix IoT, LLC guarantee the accuracy of any information expressed or conveyed. Specific project questions from customers with active support contracts are asked to send requests to support@radixiot.com.

Radix IoT Website Mango 3 Documentation Website Mango 4 Documentation Website

Mango not starting back up after restart within Mango


  • Hi,

    I have recently setup my demo site on a W7 PC, that is running NoSQL DB, V3.5.6

    I setup the Windows service using YAJSW as described in the docs.

    When I restart Windows, Mango starts up automatically as a service.
    When I restart from within Mango, it will not restart.

    Further to this, it appears that Mango is starting a browser on the host machine on
    startup, but it is not visible in Windows. I can see Firefox in windows Tasklist, but not even
    in Taskmanager.

    Would this be causing the instance not to restart?
    Is there a way to stop Mango from starting a browser?

    INFO  2019-04-18T08:33:09,743 (com.serotonin.m2m2.Lifecycle.terminate:422) - Mango Lifecycle terminating... 
    INFO  2019-04-18T08:33:09,759 (com.serotonin.m2m2.rt.DataSourceGroupTerminator.terminate:72) - Terminating 1 LAST priority data sources in 8 threads. 
    INFO  2019-04-18T08:33:09,759 (com.serotonin.m2m2.rt.RuntimeManagerImpl.stopDataSourceShutdown:423) - Data source 'Meta' stopped 
    INFO  2019-04-18T08:33:09,868 (com.serotonin.m2m2.rt.DataSourceGroupTerminator.terminate:102) - Termination of 1 LAST priority data sources took 109ms 
    INFO  2019-04-18T08:33:09,868 (com.serotonin.m2m2.rt.DataSourceGroupTerminator.terminate:72) - Terminating 7 NORMAL priority data sources in 8 threads. 
    INFO  2019-04-18T08:33:09,868 (com.serotonin.m2m2.rt.RuntimeManagerImpl.stopDataSourceShutdown:423) - Data source 'BOM Live Data' stopped 
    INFO  2019-04-18T08:33:09,868 (com.serotonin.m2m2.rt.RuntimeManagerImpl.stopDataSourceShutdown:423) - Data source 'Redlands GR1' stopped 
    INFO  2019-04-18T08:33:09,868 (com.serotonin.m2m2.rt.RuntimeManagerImpl.stopDataSourceShutdown:423) - Data source 'Mango Internal' stopped 
    INFO  2019-04-18T08:33:09,868 (com.serotonin.m2m2.rt.RuntimeManagerImpl.stopDataSourceShutdown:423) - Data source 'Palmwoods LAB' stopped 
    INFO  2019-04-18T08:33:09,868 (com.serotonin.m2m2.rt.RuntimeManagerImpl.stopDataSourceShutdown:423) - Data source '6052 - Greenhouse 2' stopped 
    INFO  2019-04-18T08:33:09,868 (com.serotonin.m2m2.rt.RuntimeManagerImpl.stopDataSourceShutdown:423) - Data source 'Redlands GR2' stopped 
    INFO  2019-04-18T08:33:09,868 (com.serotonin.m2m2.rt.RuntimeManagerImpl.stopDataSourceShutdown:423) - Data source '6052 - Potting' stopped 
    INFO  2019-04-18T08:33:09,977 (com.serotonin.m2m2.rt.DataSourceGroupTerminator.terminate:102) - Termination of 7 NORMAL priority data sources took 109ms 
    INFO  2019-04-18T08:33:09,977 (com.serotonin.m2m2.rt.maint.BackgroundProcessingImpl.joinTermination:550) - All high priority tasks exited gracefully. 
    INFO  2019-04-18T08:33:09,977 (com.serotonin.m2m2.rt.maint.BackgroundProcessingImpl.joinTermination:556) - All medium priority tasks exited gracefully. 
    INFO  2019-04-18T08:33:09,977 (com.serotonin.m2m2.rt.maint.BackgroundProcessingImpl.joinTermination:561) - All low priority tasks exited gracefully. 
    INFO  2019-04-18T08:33:09,977 (com.infiniteautomation.mango.spring.components.executors.MangoExecutors.destroy:68) - Shutting down shared executor and scheduled exectutor 
    INFO  2019-04-18T08:33:09,977 (com.infiniteautomation.mango.spring.components.executors.MangoExecutors.awaitTermination:126) - Executors shutdown successfully 
    INFO  2019-04-18T08:33:10,102 (com.infiniteautomation.nosql.MangoNoSqlProxy.shutdown:115) - Terminating NoSQL Batch Write Manager. 
    INFO  2019-04-18T08:33:10,102 (com.infiniteautomation.nosql.MangoNoSqlBatchWriteBehindManager.terminate:240) - Terminating NoSQL Point Value Mover. 
    INFO  2019-04-18T08:33:10,102 (com.infiniteautomation.nosql.MangoNoSqlBatchWriteBehindManager.terminate:264) - Terminating NoSQL Stale Point Cleaner. 
    INFO  2019-04-18T08:33:10,102 (com.infiniteautomation.nosql.MangoNoSqlBatchWriteBehindManager.terminate:267) - Terminating NoSQL Status Provider. 
    INFO  2019-04-18T08:33:10,102 (com.infiniteautomation.nosql.MangoNoSqlProxy.shutdown:123) - Closing NoSQL Database: Point Values 
    INFO  2019-04-18T08:33:10,117 (com.infiniteautomation.nosql.MangoNoSqlProxy.shutdown:131) - Closing NoSQL Database: Point Data 
    INFO  2019-04-18T08:33:10,117 (com.infiniteautomation.nosql.MangoNoSqlProxy.shutdown:145) - Closing Auxilary NoSQL Database: com.infiniteautomation.tsdb.impl.IasTsdbImpl 
    INFO  2019-04-18T08:33:10,117 (com.serotonin.m2m2.Lifecycle.terminate:571) - Mango Lifecycle terminated. 
    
    ## No log entries after this....
    

  • Hi Hayden,

    This is a known issue with the Windows service. The Mango/bin/ scripts handle the restart through Mango, but because ma-start.bat is bypassed in the Windows service its mechanisms for restarting are not in play.

    To the opening the browser, that's in the env.properties and can be set like,
    web.openBrowserOnStartup=false


  • Hi Phil,

    Is there a workaround for the Windows service issue?

    At the moment I can remote in after doing an upgrade, and manually start the service within
    Windows.


  • Not currently. It's one of the reasons we encourage people to use Linux for their deployments.

    The issue is that the restart mechanism leverages the ma-start.bat script, which is completely bypassed by the service. I can't personally say I know very much about Windows services, but it would seem to me had the service been directed at invoking the batch script instead of the main application this issue wouldn't exist.

    For instance, you can place a shortcut to the ma-start.bat file in the startup folder, create an event handler to create the Mango/RESTART file on the Mango startup event, and voila, it behaves mostly like a service and then restarting / upgrading should work.

    Something like,

    var restartFile = new java.io.File("C:\\Mango\\RESTART");
    if( ! restartFile.exists() )
      file.createNewFile();
    return UNCHANGED;
    

  • OK thanks Phil, will do some experimenting.