ScriptPolicy scripts encounter LazyInitializationException on calling node.getSnmpInterface()

Description

Steps to reproduce:

1) Configure a ScriptPolicy in the default foreign-source definition, with its script attribute set to testing.groovy

2) Create OPENNMS_HOME/etc/script-policies/testing.groovy with the following contents:

3) Provision or rescan an auto-provisioned node, or rescan a requisitioned node

Expected result:
Messages in provisiond.log corresponding to the LOG.warn in the script above

Actual result:
Exception stack traces in provisiond.log indicating the node's SNMP interfaces failed to load:

 

Notably, calling node.getIpInterfaces() as is done by the script in etc/examples/script-policies/example.groovy does not cause an equivalent problem. This leads me to think the NodeDao implementation might be missing some initialization for SNMP interfaces.

Acceptance / Success Criteria

None

Lucidchart Diagrams

Activity

Show:

Chandra Gorantla September 17, 2019 at 5:44 PM

Fixed

Details

Assignee

Reporter

Labels

Sprint

Fix versions

Affects versions

Priority

PagerDuty

Created September 6, 2019 at 3:52 PM
Updated September 20, 2019 at 11:02 PM
Resolved September 18, 2019 at 2:15 AM