• Recent
    • Tags
    • Popular
    • Register
    • Login

    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 5 Documentation Website

    Missing Event Handler

    Mango Automation general Discussion
    2
    8
    1.7k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • AldoRamosA
      AldoRamos
      last edited by

      I created a scheduled event and a corresponding event handler; then recently noticed it wasn't firing. Looking at the event handler, I saw there was no event handler. Puzzled, I created a new event handler, but when I clicked "save" it rejected it for an existing XID.

      When I do an export, I see the event handler, but in not the Event Handler page. Unfortunately, it is also failing to execute.

      Here is the JSON for the Scheduled Event and the Event Handler:

      {
         "eventHandlers":[
            {
               "eventType":{
                  "sourceType":"SCHEDULED",
                  "XID":"SE_get_forecast"
               },
               "xid":"EH_get_forecast",
               "handlerType":"PROCESS",
               "activeProcessCommand":"get_forecast.bash",
               "activeProcessTimeout":60,
               "inactiveProcessCommand":"",
               "inactiveProcessTimeout":15,
               "alias":"Get forecast",
               "disabled":true
            }
         ],
         "scheduledEvents":[
            {
               "xid":"SE_get_forecast",
               "alarmLevel":"NONE",
               "scheduleType":"HOURLY",
               "activeCron":"0 0\/5 * * * ? *",
               "activeDay":0,
               "activeHour":0,
               "activeMinute":0,
               "activeMonth":11,
               "activeSecond":0,
               "activeYear":2017,
               "alias":"Get Weather Forecast",
               "disabled":false,
               "inactiveCron":"",
               "inactiveDay":0,
               "inactiveHour":0,
               "inactiveMinute":0,
               "inactiveMonth":11,
               "inactiveSecond":0,
               "inactiveYear":2017,
               "returnToNormal":false
            }
         ]
      }
      
      1 Reply Last reply Reply Quote 0
      • phildunlapP
        phildunlap
        last edited by

        Hi Aldo,

        I imported it without issue. Can you try clearing your browser cache and deleting your Mango/work/jsp directory?

        Whatever the display issue, it's probably not executing because "disabled":true in the configuration you posted.

        1 Reply Last reply Reply Quote 0
        • AldoRamosA
          AldoRamos
          last edited by

          @phildunlap said in Missing Event Handler:

          because "disabled":true

          Uh, yeah. chuckles.... I tinkered with the the config in hopes of triggering it just right, and that's one of the parameters I changed. Before I shared it. But after I saw it fail. ;-)

          On the less bonehead note, clearing the browser or the work directory did not seem to change anything.

          FWIW this server was recently upgraded from 2.8 to 3.2, if that tells you anything.

          1 Reply Last reply Reply Quote 0
          • AldoRamosA
            AldoRamos
            last edited by

            Very odd. In frustration, I added another event handler, with the same parameters. It saved, executed, and shows in the Event Handlers page — but not the original! (which I have not deleted)

            {
               "eventHandlers":[
                  {
                     "eventType":{
                        "sourceType":"SCHEDULED",
                        "XID":"SE_get_forecast"
                     },
                     "xid":"EH_get_forecast",
                     "handlerType":"PROCESS",
                     "activeProcessCommand":"false",
                     "activeProcessTimeout":60,
                     "inactiveProcessCommand":"",
                     "inactiveProcessTimeout":15,
                     "alias":"Get forecast",
                     "disabled":false
                  },
                  {
                     "eventType":{
                        "sourceType":"SCHEDULED",
                        "XID":"SE_get_forecast"
                     },
                     "xid":"EH_get_forecast2",
                     "handlerType":"PROCESS",
                     "activeProcessCommand":"\/usr\/lib\/ia3-util\/get_forecast.bash",
                     "activeProcessTimeout":60,
                     "inactiveProcessCommand":"",
                     "inactiveProcessTimeout":15,
                     "alias":"Get Forecast",
                     "disabled":false
                  }
               ],
               "scheduledEvents":[
                  {
                     "xid":"SE_get_forecast",
                     "alarmLevel":"NONE",
                     "scheduleType":"HOURLY",
                     "activeCron":"0 0\/5 * * * ? *",
                     "activeDay":0,
                     "activeHour":0,
                     "activeMinute":15,
                     "activeMonth":11,
                     "activeSecond":0,
                     "activeYear":2017,
                     "alias":"Get Weather Forecast",
                     "disabled":false,
                     "inactiveCron":"",
                     "inactiveDay":0,
                     "inactiveHour":0,
                     "inactiveMinute":0,
                     "inactiveMonth":11,
                     "inactiveSecond":0,
                     "inactiveYear":2017,
                     "returnToNormal":false
                  }
               ]
            }
            
            1 Reply Last reply Reply Quote 0
            • phildunlapP
              phildunlap
              last edited by

              Hmm. Event handlers were decoupled from event detectors in that time, so that tells me that Upgrade18 might not have occurred entirely correctly in your case. Do you have an Upgrade18 log in your Mango/logs? Did you get an error to your console when it was performing this upgrade?

              1 Reply Last reply Reply Quote 0
              • AldoRamosA
                AldoRamos
                last edited by

                Didn't catch any errors during the actual upgrade, and no file exists by that name. However, there is this in the logs:

                INFO  2017-11-23T23:16:18,652 (com.serotonin.m2m2.Lifecycle.initialize:192) - Initializing Spring Object Mapper
                INFO  2017-11-23T23:16:19,014 (com.serotonin.m2m2.Lifecycle.initialize:214) - Setting default time zone to America/Anchorage
                INFO  2017-11-23T23:16:19,034 (com.serotonin.m2m2.Lifecycle.loadLic:512) - Checking license...
                INFO  2017-11-23T23:16:19,038 (com.serotonin.m2m2.Lifecycle.loadLic:559) - License file core version does not match instance, defaulting to free mode
                WARN  2017-11-23T23:16:19,074 (com.serotonin.m2m2.TimedLicenseRegistrar.checkLicenses:62) - Mango NoSQL database is running in free mode, Mango will shutdown at 7:16:19 24/11/2017.
                INFO  2017-11-23T23:16:19,135 (com.serotonin.m2m2.db.BasePooledProxy.initializeImpl:36) - Initializing pooled connection manager
                WARN  2017-11-23T23:16:20,206 (com.serotonin.m2m2.db.upgrade.DBUpgrade.checkUpgrade:96) - Upgrading 'core' from 13 to 14
                INFO  2017-11-23T23:16:20,208 (com.serotonin.m2m2.db.upgrade.DBUpgrade.createUpdateLogOutputStream:152) - Writing upgrade log to /var/opt/mango/logs/com.serotonin.m2m2.db.upgrade.Upgrade13.log
                WARN  2017-11-23T23:16:20,364 (com.serotonin.m2m2.db.upgrade.DBUpgrade.checkUpgrade:96) - Upgrading 'core' from 14 to 15
                INFO  2017-11-23T23:16:20,364 (com.serotonin.m2m2.db.upgrade.DBUpgrade.createUpdateLogOutputStream:152) - Writing upgrade log to /var/opt/mango/logs/com.serotonin.m2m2.db.upgrade.Upgrade14.log
                WARN  2017-11-23T23:16:20,600 (com.serotonin.m2m2.db.upgrade.DBUpgrade.checkUpgrade:96) - Upgrading 'core' from 15 to 16
                INFO  2017-11-23T23:16:20,600 (com.serotonin.m2m2.db.upgrade.DBUpgrade.createUpdateLogOutputStream:152) - Writing upgrade log to /var/opt/mango/logs/com.serotonin.m2m2.db.upgrade.Upgrade15.log
                WARN  2017-11-23T23:16:21,251 (com.serotonin.m2m2.db.upgrade.DBUpgrade.checkUpgrade:96) - Upgrading 'core' from 16 to 17
                INFO  2017-11-23T23:16:21,251 (com.serotonin.m2m2.db.upgrade.DBUpgrade.createUpdateLogOutputStream:152) - Writing upgrade log to /var/opt/mango/logs/com.serotonin.m2m2.db.upgrade.Upgrade16.log
                INFO  2017-11-23T23:16:21,363 (com.serotonin.m2m2.db.upgrade.DBUpgrade.createUpdateLogOutputStream:152) - Writing upgrade log to /var/opt/mango/logs/com.serotonin.m2m2.db.upgrade.Upgrade16.log
                WARN  2017-11-23T23:16:21,409 (com.serotonin.m2m2.db.upgrade.DBUpgrade.checkUpgrade:96) - Upgrading 'core' from 17 to 18
                INFO  2017-11-23T23:16:21,409 (com.serotonin.m2m2.db.upgrade.DBUpgrade.createUpdateLogOutputStream:152) - Writing upgrade log to /var/opt/mango/logs/com.serotonin.m2m2.db.upgrade.Upgrade17.log
                INFO  2017-11-23T23:16:21,494 (com.serotonin.m2m2.db.upgrade.DBUpgrade.checkUpgrade:36) - Starting instance with core version 3.2.2+20171009170034, db 18
                INFO  2017-11-23T23:16:21,494 (com.infiniteautomation.nosql.MangoNoSqlProxy.initialize:77) - Starting MangoNoSql Database
                INFO  2017-11-23T23:16:21,522 (com.infiniteautomation.tsdb.maint.TTSDBUpgrade.checkForUpgrade:77) - Upgrading from 0 to 1
                INFO  2017-11-23T23:16:21,527 (com.infiniteautomation.tsdb.maint.TTSDBUpgrade.checkForUpgrade:77) - Upgrading from 1 to 2
                INFO  2017-11-23T23:16:21,528 (com.infiniteautomation.tsdb.impl.IasTsdbImpl.<init>:141) - Database started
                INFO  2017-11-23T23:16:21,556 (com.infiniteautomation.tsdb.impl.IasTsdbImpl.<init>:170) - Empty dir delete took 0ms
                INFO  2017-11-23T23:16:21,557 (com.infiniteautomation.tsdb.impl.IasTsdbImpl.<init>:227) - Corruption scan skipped because the database is configured not to run scan.
                INFO  2017-11-23T23:16:21,558 (com.infiniteautomation.tsdb.maint.TTSDBUpgrade.checkForUpgrade:77) - Upgrading from 0 to 1
                INFO  2017-11-23T23:16:21,558 (com.infiniteautomation.tsdb.maint.TTSDBUpgrade.checkForUpgrade:77) - Upgrading from 1 to 2
                INFO  2017-11-23T23:16:21,559 (com.infiniteautomation.tsdb.impl.IasTsdbImpl.<init>:141) - Database started
                INFO  2017-11-23T23:16:21,584 (com.infiniteautomation.tsdb.impl.IasTsdbImpl.<init>:170) - Empty dir delete took 0ms
                INFO  2017-11-23T23:16:21,586 (com.infiniteautomation.tsdb.impl.IasTsdbImpl.<init>:227) - Corruption scan skipped because the database is configured not to run scan.
                

                Bear in mind that the upgrade installed NoSQL before I upgraded the license, in case that impacts the process.

                Also, that server quickly ran out of space and needed additional storage added, causing these errors in the log:

                ERROR 2017-11-23T23:16:36,863 (com.serotonin.m2m2.internal.InternalMenuItem$2.run:104) - You have reached the maximum number of data points permitted for your 'Free' license: 300
                com.serotonin.m2m2.LicenseViolatedException: You have reached the maximum number of data points permitted for your 'Free' license: 300
                        at com.serotonin.m2m2.db.dao.DataPointDao.checkAddPoint(DataPointDao.java:335) ~[mango-3.2.2.jar:?]
                        at com.serotonin.m2m2.db.dao.DataPointDao.saveDataPoint(DataPointDao.java:308) ~[mango-3.2.2.jar:?]
                        at com.serotonin.m2m2.rt.RuntimeManager.saveDataPoint(RuntimeManager.java:451) ~[mango-3.2.2.jar:?]
                        at com.serotonin.m2m2.internal.InternalMenuItem.maybeCreatePoints(InternalMenuItem.java:280) ~[internal-ds-3.2.0.jar:?]
                        at com.serotonin.m2m2.internal.InternalMenuItem.maybeInstallSystemMonitor(InternalMenuItem.java:210) ~[internal-ds-3.2.0.jar:?]
                        at com.serotonin.m2m2.internal.InternalMenuItem.access$000(InternalMenuItem.java:45) ~[internal-ds-3.2.0.jar:?]
                        at com.serotonin.m2m2.internal.InternalMenuItem$2.run(InternalMenuItem.java:102) [internal-ds-3.2.0.jar:?]
                        at com.serotonin.m2m2.Lifecycle$2.run(Lifecycle.java:340) [ma-priv-3.2.2.jar:?]
                        at com.serotonin.timer.Task.runTask(Task.java:179) [mango-3.2.2.jar:?]
                        at com.serotonin.timer.TaskWrapper.run(TaskWrapper.java:23) [mango-3.2.2.jar:?]
                        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_144]
                        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_144]
                        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_144]
                INFO  2017-11-23T23:18:07,642 (com.serotonin.m2m2.Lifecycle.loadLic:512) - Checking license...
                INFO  2017-11-23T23:19:05,806 (com.serotonin.m2m2.web.dwr.ModulesDwr$UpgradeDownloader.run:397) - UpgradeDownloader started
                INFO  2017-11-23T23:19:05,807 (com.serotonin.m2m2.web.dwr.ModulesDwr$UpgradeDownloader.run:402) - UpgradeDownloader: Backing up...
                INFO  2017-11-23T23:19:05,808 (com.serotonin.m2m2.rt.maint.work.BackupWorkItem.execute:112) - Starting backup WorkItem.
                INFO  2017-11-23T23:19:05,809 (com.serotonin.m2m2.web.dwr.ModulesDwr$UpgradeDownloader.run:414) - UpgradeDownloader: Downloading modules...
                INFO  2017-11-23T23:19:05,809 (com.serotonin.m2m2.rt.maint.work.DatabaseBackupWorkItem.execute:109) - Starting database backup WorkItem.
                INFO  2017-11-23T23:19:06,072 (com.serotonin.m2m2.web.dwr.ModulesDwr$UpgradeDownloader.run:495) - UpgradeDownloader: Installing...
                INFO  2017-11-23T23:19:06,072 (com.serotonin.m2m2.web.dwr.ModulesDwr$UpgradeDownloader.run:545) - UpgradeDownloader: Restarting...
                INFO  2017-11-23T23:19:57,344 (com.serotonin.m2m2.rt.maint.work.DatabaseBackupWorkItem.backupMysqlWithOutDatabase:444) - Could not create the backup for mango in RDS-NUS.iA3.io:3306
                WARN  2017-11-23T23:19:57,416 (com.serotonin.m2m2.rt.maint.work.DatabaseBackupWorkItem.execute:176) - Unable to create backup file: /var/opt/mango/backup/core-database-MYSQL-Nov-23-2017_231905
                ERROR 2017-11-23T23:20:02,417 (com.serotonin.m2m2.Lifecycle$5.run:1448) - Unabled to create restart flag file
                java.io.IOException: No space left on device
                        at java.io.FileOutputStream.writeBytes(Native Method) ~[?:1.8.0_144]
                        at java.io.FileOutputStream.write(FileOutputStream.java:326) ~[?:1.8.0_144]
                        at sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:221) ~[?:1.8.0_144]
                        at sun.nio.cs.StreamEncoder.implClose(StreamEncoder.java:316) ~[?:1.8.0_144]
                        at sun.nio.cs.StreamEncoder.close(StreamEncoder.java:149) ~[?:1.8.0_144]
                        at java.io.OutputStreamWriter.close(OutputStreamWriter.java:233) ~[?:1.8.0_144]
                        at com.serotonin.m2m2.Lifecycle$5.run(Lifecycle.java:1445) [ma-priv-3.2.2.jar:?]
                INFO  2017-11-23T23:20:02,417 (com.serotonin.m2m2.Lifecycle.terminate:361) - Mango Lifecycle terminating...
                INFO  2017-11-23T23:20:02,941 (com.serotonin.m2m2.rt.DataSourceGroupTerminator.terminate:72) - Terminating 2 NORMAL priority data sources in 8 threads.
                INFO  2017-11-23T23:20:02,951 (com.serotonin.m2m2.rt.RuntimeManager.stopDataSourceShutdown:415) - Data source 'Creekwood Input' stopped
                INFO  2017-11-23T23:20:03,280 (com.serotonin.m2m2.rt.RuntimeManager.stopDataSourceShutdown:415) - Data source 'Mango Persistent TCP' stopped
                INFO  2017-11-23T23:20:03,342 (com.serotonin.m2m2.rt.DataSourceGroupTerminator.terminate:102) - Termination of 2 NORMAL priority data sources took 401ms
                INFO  2017-11-23T23:20:03,343 (com.serotonin.m2m2.rt.maint.BackgroundProcessing.joinTermination:481) - All high priority tasks exited gracefully.
                INFO  2017-11-23T23:20:03,343 (com.serotonin.m2m2.rt.maint.BackgroundProcessing.joinTermination:487) - All medium priority tasks exited gracefully.
                INFO  2017-11-23T23:20:03,343 (com.serotonin.m2m2.rt.maint.BackgroundProcessing.joinTermination:492) - All low priority tasks exited gracefully.
                INFO  2017-11-23T23:20:03,343 (com.serotonin.m2m2.db.BasePooledProxy.terminateImpl:110) - Stopping database
                INFO  2017-11-23T23:20:03,344 (com.infiniteautomation.nosql.MangoNoSqlProxy.shutdown:115) - Terminating NoSQL Batch Write Manager.
                INFO  2017-11-23T23:20:03,344 (com.infiniteautomation.nosql.MangoNoSqlBatchWriteBehindManager.terminate:242) - Terminating NoSQL Point Value Mover.
                

                Although these are different servers, some of this might be relevant to the other topic: Migrate Data into Mango (NoSQL) does not appear to be doing anything

                1 Reply Last reply Reply Quote 0
                • phildunlapP
                  phildunlap
                  last edited by

                  It would probably be called com.serotonin.m2m2.db.upgrade.Upgrade18.log

                  1 Reply Last reply Reply Quote 0
                  • AldoRamosA
                    AldoRamos
                    last edited by

                    Understood, but there was no such file. There is a file named com.serotonin.m2m2.db.upgrade.Upgrade17.log but it's empty

                    -rw-r--r-- 1 mango mango  0 Nov 22 14:44 com.infiniteautomation.mango.scheduling.db.upgrade.Upgrade4.log
                    -rw-r--r-- 1 mango mango  0 Nov 22 12:58 com.serotonin.m2m2.db.upgrade.Upgrade13.log
                    -rw-r--r-- 1 mango mango 35 Nov 22 12:58 com.serotonin.m2m2.db.upgrade.Upgrade14.log
                    -rw-r--r-- 1 mango mango  0 Nov 22 12:58 com.serotonin.m2m2.db.upgrade.Upgrade15.log
                    -rw-r--r-- 1 mango mango  0 Nov 22 12:58 com.serotonin.m2m2.db.upgrade.Upgrade16.log
                    -rw-r--r-- 1 mango mango  0 Nov 22 12:58 com.serotonin.m2m2.db.upgrade.Upgrade17.log
                    

                    The one file which isn't completely empty only reads:

                    Updated 0 user comments with XIDs.
                    
                    1 Reply Last reply Reply Quote 0
                    • First post
                      Last post