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

Provisiond silently fails to import an invalid model importer file but reports importSuccessful anyway.

    Details

      Description

      When attempting to import from a badly formed import XML file the WebUI reports successful imports instead of reporting an error.

      The problem stemmed to an interface definition which didn't specify a SNMP type:

      <node node-label="Alex Bennée" parent-foreign-id="ODU_18049366" foreign-id="CPE_18053419">
      <!-- Default category for un-categorised CPEs -->
      <category name="CPEs"></category>
      <interface ip-addr="10.242.5.2" descr="Management Interface">
      <monitored-service service-name="CPE Radio Link"></monitored-service>
      </interface>
      </node>

      This resulted in a exception during import:

      2011-03-23 14:23:11,317 INFO [importExecutor-1] Phase$PhaseMethod$1: failed to invoke lifecycle instance
      java.lang.reflect.InvocationTargetException
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:616)
      at org.opennms.netmgt.provision.service.lifecycle.Phase$PhaseMethod.doInvoke(Phase.java:194)
      at org.opennms.netmgt.provision.service.lifecycle.Phase$PhaseMethod.access$100(Phase.java:160)
      at org.opennms.netmgt.provision.service.lifecycle.Phase$PhaseMethod$1.run(Phase.java:177)
      at org.opennms.core.tasks.SyncTask.run(SyncTask.java:92)
      at org.opennms.core.tasks.SyncTask$1.run(SyncTask.java:103)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
      at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
      at java.util.concurrent.FutureTask.run(FutureTask.java:166)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
      at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
      at java.util.concurrent.FutureTask.run(FutureTask.java:166)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
      at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
      at java.util.concurrent.FutureTask.run(FutureTask.java:166)
      at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:165)
      at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:266)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
      at java.lang.Thread.run(Thread.java:636)
      Caused by: java.lang.IllegalArgumentException: null is not a valid InterfaceSnmpPrimaryType
      at org.opennms.netmgt.config.modelimport.types.InterfaceSnmpPrimaryType.valueOf(InterfaceSnmpPrimaryType.java:167)
      at org.opennms.netmgt.provision.service.RequisitionAccountant.visitInterface(RequisitionAccountant.java:81)
      at org.opennms.netmgt.provision.persist.OnmsIpInterfaceRequisition.visit(OnmsIpInterfaceRequisition.java:79)
      at org.opennms.netmgt.provision.persist.OnmsNodeRequisition.visit(OnmsNodeRequisition.java:137)
      at org.opennms.netmgt.provision.persist.requisition.Requisition.visit(Requisition.java:306)
      at org.opennms.netmgt.provision.service.operations.ImportOperationsManager.auditNodes(ImportOperationsManager.java:295)
      at org.opennms.netmgt.provision.service.CoreImportActivities.auditNodes(CoreImportActivities.java:130)
      ... 23

      Which only showed up if DEBUG info was set in the logging. At the very least it shouldn't report a successful import. As mentioned on IRC the importer file should probably be validated before the import process starts.

        Attachments

          Activity

            People

            • Assignee:
              ranger Benjamin Reed
              Reporter:
              ajb Alex Bennee
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: