Event parameter refactor breaks Auto-Acknowledgements for Notifications

Description

In the notifd-configuration it is possible to match on particular event parameters to auto-acknowledge notices. With HZN-1147 the event parameters have moved to their own table and this breaks that functionality.

2017-12-23 16:37:40,730 ERROR [Notifd:BroadcastEventProcessor-Thread] o.o.n.n.BroadcastEventProcessor: Failed to auto acknowledge notice.
org.postgresql.util.PSQLException: ERROR: column e.eventparms does not exist
Position: 115
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2458) ~[postgresql-9.4.1211.jar:9.4.1211]
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2158) ~[postgresql-9.4.1211.jar:9.4.1211]
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:291) ~[postgresql-9.4.1211.jar:9.4.1211]
at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:432) ~[postgresql-9.4.1211.jar:9.4.1211]
at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:358) ~[postgresql-9.4.1211.jar:9.4.1211]
at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:171) ~[postgresql-9.4.1211.jar:9.4.1211]
at org.postgresql.jdbc.PgPreparedStatement.executeQuery(PgPreparedStatement.java:119) ~[postgresql-9.4.1211.jar:9.4.1211]
at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeQuery(ProxyPreparedStatement.java:52) ~[HikariCP-2.5.1.jar:?]
at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeQuery(HikariProxyPreparedStatement.java) ~[HikariCP-2.5.1.jar:?]
at org.opennms.netmgt.config.NotificationManager.acknowledgeNotice(NotificationManager.java:597) ~[opennms-config-21.0.2.jar:?]
at org.opennms.netmgt.notifd.BroadcastEventProcessor.automaticAcknowledge(BroadcastEventProcessor.java:298) [opennms-services-21.0.2.jar:?]
at org.opennms.netmgt.notifd.BroadcastEventProcessor.onEvent(BroadcastEventProcessor.java:212) [opennms-services-21.0.2.jar:?]
at org.opennms.netmgt.eventd.EventIpcManagerDefaultImpl$EventListenerExecutor$2.run(EventIpcManagerDefaultImpl.java:183) [org.opennms.features.events.daemon-21.0.2.jar:?]
at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1626) [?:1.8.0_151]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_151]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_151]
at org.opennms.core.concurrent.LogPreservingThreadFactory$2.run(LogPreservingThreadFactory.java:106) [opennms-util-21.0.2.jar:?]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_151]

Acceptance / Success Criteria

None

Is caused by

Lucidchart Diagrams

Activity

Show:

Jesse White January 23, 2018 at 3:35 PM

Jesse White January 23, 2018 at 3:35 PM

While working on #1, I noticed that #2 isn't actually a problem for notifid: when referencing parameters by index, it will first determine the parameter name at the given index on the current event, and then perform a database search based on the parameter name.

 

So fixing #1 is sufficient for restoring the previous behavior.

 

Jesse White January 22, 2018 at 7:25 PM

I've opened https://opennms.atlassian.net/browse/NMS-9827#icft=NMS-9827 to handle the ordering of event parameters. In this issue we'll focus on being able to reference to parameters by name, since that currently has a higher impact.

Alejandro Galue January 11, 2018 at 2:28 PM

That's good news for Drools, Scriptd, NBIs, etc., but unfortunately, not good news for Notifd.

If guaranteeing order on the DB is hard, customers who are using this feature won't be able to refer by name; unless we can use varbinddecode to "translate" the OIDs to a human readable name before persisting the parameters to the DB (to avoid the completely useless OIDs as names), so we can actual use something that will never change on notifd-configuration.xml for this particular use case.

 

Jesse White January 11, 2018 at 2:22 PM

This problem only affects cases where the event parameters are referred to by position after the event is pulled out of the database. If the event is still in memory, the positions are maintained.

Fixed

Details

Assignee

Reporter

Labels

Sprint

Fix versions

Affects versions

Priority

PagerDuty

Created December 27, 2017 at 3:19 PM
Updated January 25, 2018 at 4:03 PM
Resolved January 25, 2018 at 4:03 PM

Flag notifications