ReST v1 does not return errors for unparseable events

Description

When an event is submitted to the opennms/rest/events endpoint, the API returns a 200 response before parsing the event.

If that event fails to parse, the failure is invisible to the client, and only shows up in web.log.

Events that cannot be parsed should return an error to the client, instead of failing silently.

Environment

RedHat Enterprise Linux Server 6.7 Oracle JDK 1.8.0_92-b14

Acceptance / Success Criteria

None

Lucidchart Diagrams

Activity

Show:

Benjamin Reed November 8, 2017 at 8:21 PM

The latest PR should catch your issue.

Also, AFAICT the problem is that you don't have seconds on your time, only hours and minutes.  (add  :%S after the %M and it'll work)

Will Keaney November 7, 2017 at 10:40 PM

The event source was using

to format their time value, which should have worked. I don't know why it failed validation.

Will Keaney November 7, 2017 at 10:32 PM

FWIW, the event that brought it to my attention had a value in the time element that couldn't be parsed.

Benjamin Reed November 7, 2017 at 10:05 PM

Never mind, I looked through the XSD and worked up my own.  I suspect this would not be an issue in Meridian 2017 because of the newer validation done with the JAXB code there.

Anyways, PR here: https://github.com/OpenNMS/opennms/pull/1746

 

Benjamin Reed November 7, 2017 at 9:10 PM

Do you have an example event you're sending I could stick in a unit test?

Fixed

Details

Assignee

Reporter

Components

Sprint

Affects versions

Priority

PagerDuty

Created October 31, 2017 at 8:26 PM
Updated November 16, 2017 at 12:50 AM
Resolved November 15, 2017 at 11:43 AM