Uploaded image for project: 'OpenNMS'
  1. OpenNMS
  2. NMS-7826

Exception in Vacuumd because of location monitor changes

    Details

      Description

      On a recent compilation of 17-SNAPSHOT, I found the following exception:

      vacuumd.log
      2015-07-31 08:55:52,997 WARN  [Vacuumd-Thread-2-of-2] o.o.n.v.AutomationProcessor: runAutomation: Could not execute automation: cleanUpRpStatusChanges
      org.postgresql.util.PSQLException: ERROR: column "locationmonitorid" does not exist
        Position: 151
          at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2161) ~[postgresql-9.3-1100-jdbc4.jar:?]
          at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1890) ~[postgresql-9.3-1100-jdbc4.jar:?]
          at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:255) ~[postgresql-9.3-1100-jdbc4.jar:?]
          at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:560) ~[postgresql-9.3-1100-jdbc4.jar:?]
          at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:417) ~[postgresql-9.3-1100-jdbc4.jar:?]
          at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:363) ~[postgresql-9.3-1100-jdbc4.jar:?]
          at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeUpdate(NewProxyPreparedStatement.java:105) ~[c3p0-0.9.1.2.jar:0.9.1.2]
          at org.opennms.netmgt.vacuumd.AutomationProcessor$ActionProcessor.execute(AutomationProcessor.java:327) ~[opennms-services-17.0.0-SNAPSHOT.jar:?]
          at org.opennms.netmgt.vacuumd.AutomationProcessor$ActionProcessor.processAction(AutomationProcessor.java:353) ~[opennms-services-17.0.0-SNAPSHOT.jar:?]
          at org.opennms.netmgt.vacuumd.AutomationProcessor.processAction(AutomationProcessor.java:766) ~[opennms-services-17.0.0-SNAPSHOT.jar:?]
          at org.opennms.netmgt.vacuumd.AutomationProcessor.runAutomation(AutomationProcessor.java:742) [opennms-services-17.0.0-SNAPSHOT.jar:?]
          at org.opennms.netmgt.vacuumd.AutomationProcessor.run(AutomationProcessor.java:700) [opennms-services-17.0.0-SNAPSHOT.jar:?]
          at org.opennms.netmgt.scheduler.Schedule.run(Schedule.java:142) [opennms-services-17.0.0-SNAPSHOT.jar:?]
          at org.opennms.netmgt.scheduler.Schedule$ScheduleEntry.run(Schedule.java:86) [opennms-services-17.0.0-SNAPSHOT.jar:?]
          at org.opennms.netmgt.scheduler.LegacyScheduler$1.run(LegacyScheduler.java:209) [opennms-services-17.0.0-SNAPSHOT.jar:?]
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0_51]
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0_51]
          at org.opennms.core.concurrent.LogPreservingThreadFactory$3.run(LogPreservingThreadFactory.java:124) [opennms-util-17.0.0-SNAPSHOT.jar:?]
          at java.lang.Thread.run(Thread.java:745) [?:1.8.0_51]
      

      Indeed, the column in question doesn't exist on location_specific_status_changes

      location_specific_status_changes
      opennms=# \d location_specific_status_changes
         Table "public.location_specific_status_changes"
          Column    |           Type           | Modifiers 
      --------------+--------------------------+-----------
       id           | integer                  | not null
       ifserviceid  | integer                  | not null
       statuscode   | integer                  | not null
       statustime   | timestamp with time zone | not null
       statusreason | character varying(255)   | 
       responsetime | double precision         | 
       systemid     | text                     | not null
      Indexes:
          "location_specific_status_changes_pkey" PRIMARY KEY, btree (id)
          "location_specific_status_changes_ifserviceid" btree (ifserviceid)
          "location_specific_status_changes_statustime" btree (statustime)
          "location_specific_status_changes_systemid" btree (systemid)
          "location_specific_status_changes_systemid_if_time" btree (systemid, ifserviceid, statustime)
          "location_specific_status_changes_systemid_ifserviceid" btree (systemid, ifserviceid)
      Foreign-key constraints:
          "ifservices_fkey4" FOREIGN KEY (ifserviceid) REFERENCES ifservices(id) ON DELETE CASCADE
          "location_specific_status_changes_systemid_fkey" FOREIGN KEY (systemid) REFERENCES monitoringsystems(id) ON DELETE CASCADE
      

      Here is the rule:

      vacuumd-configuration.xml
          <action name="cleanUpRpStatusChanges">
            <statement>
              <!-- Remove expired locations specific status changes -->
              DELETE
                FROM location_specific_status_changes
               WHERE (locationmonitorid, ifserviceid, id)
              NOT IN (SELECT locationmonitorid, ifserviceid, max(id)
                        FROM location_specific_status_changes
                    GROUP BY locationmonitorid, ifserviceid)
                 AND statustime &lt; now() - interval '24 hours'
            </statement>
          </action>
      

        Attachments

          Activity

            People

            • Assignee:
              seth Seth Leger
              Reporter:
              agalue Alejandro Galue
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: