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

send-event.pl is broken after OpenNMS 25.1.0 update

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: Meridian-2019.1.0, 25.1.0
    • Fix Version/s: Meridian-2019.1.1, 25.1.1
    • Component/s: Events
    • Security Level: Default (Default Security Scheme)
    • Labels:
      None
    • Sprint:
      Horizon 2019 - November 6th, Horizon 2019 - November 13th

      Description

      The Release notes for 25.1.0 note that the event XML format has had a change to the time format.

      send-event.pl seems to reflect that change:

      $ diff send-event.pl /tmp/orig/send-event.pl 
       38c38
       < 
       —
       > 
       59c59
       < @PARMS = map { parse_parm($_) } @PARMS;
       —
       > @PARMS = reverse map { parse_parm($_) } @PARMS;
       166,169c166,170
       < my $month = sprintf("%02d", $mon + 1);
       < $mday = sprintf("%02d", $mday);
       < $min = sprintf("%02d", $min);
       < $sec = sprintf("%02d", $sec);
       —
       > my $month = $mon;
       > $min = sprintf("%02d", $min);
       > $sec = sprintf("%02d", $sec);
       > my @week = ('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday');
       > my @month = ('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December');
       190c191
       < <time>${year}${month}${mday}T${hour}:${min}:${sec}+00:00</time>
       —
       > <time>$week[$wday], $mday $month[$month] $year $hour:$min:$sec o'clock $ZONE</time>
       266c267,268
       < --service, -s service name
       —
       > --timezone, -t the time zone you are in
       > --service, -s service name

      However, when run, I'm getting the following in eventd.log:

      2019-11-11 14:32:36,783 ERROR [nioEventLoopGroup-3-4] o.o.n.e.l.XmlEventProcessor: An error occurred while processing the event: 
      Exception Description: The object [2019-11-11T4:32:36+00:00], of class [class java.lang.String], could not be converted to [class java.util.Date].
      Internal Exception: java.time.format.DateTimeParseException: Text '2019-11-11T4:32:36+00:00' could not be parsed at index 11
      org.eclipse.persistence.exceptions.ConversionException: 
      Exception Description: The object [2019-11-11T4:32:36+00:00], of class [class java.lang.String], could not be converted to [class java.util.Date].
      Internal Exception: java.time.format.DateTimeParseException: Text '2019-11-11T4:32:36+00:00' could not be parsed at index 11
      	at org.eclipse.persistence.exceptions.ConversionException.couldNotBeConverted(ConversionException.java:87) ~[org.eclipse.persistence.core-2.5.1.jar:?]
      	at org.eclipse.persistence.internal.jaxb.XMLJavaTypeConverter.convertDataValueToObjectValue(XMLJavaTypeConverter.java:162) ~[org.eclipse.persistence.moxy-2.5.1.jar:?]
      	at org.eclipse.persistence.oxm.mappings.XMLDirectMapping.convertDataValueToObjectValue(XMLDirectMapping.java:526) ~[org.eclipse.persistence.core-2.5.1.jar:?]
      	at org.eclipse.persistence.oxm.mappings.XMLDirectMapping.getAttributeValue(XMLDirectMapping.java:296) ~[org.eclipse.persistence.core-2.5.1.jar:?]
      	at org.eclipse.persistence.oxm.mappings.XMLDirectMapping.getAttributeValue(XMLDirectMapping.java:1) ~[org.eclipse.persistence.core-2.5.1.jar:?]
      	at org.eclipse.persistence.internal.oxm.XMLDirectMappingNodeValue.endElement(XMLDirectMappingNodeValue.java:192) ~[org.eclipse.persistence.core-2.5.1.jar:?]
      	at org.eclipse.persistence.internal.oxm.record.UnmarshalRecordImpl.endElement(UnmarshalRecordImpl.java:1021) ~[org.eclipse.persistence.core-2.5.1.jar:?]
      	at org.xml.sax.helpers.XMLFilterImpl.endElement(XMLFilterImpl.java:570) ~[?:?]
      	at org.opennms.core.xml.SimpleNamespaceFilter.endElement(SimpleNamespaceFilter.java:95) ~[org.opennms.core.xml-25.1.0.jar:?]
      	at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source) ~[org.apache.servicemix.bundles.xerces-2.11.0_1.jar:?]
      	at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source) ~[org.apache.servicemix.bundles.xerces-2.11.0_1.jar:?]
      	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source) ~[org.apache.servicemix.bundles.xerces-2.11.0_1.jar:?]
      	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) ~[org.apache.servicemix.bundles.xerces-2.11.0_1.jar:?]
      	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) ~[org.apache.servicemix.bundles.xerces-2.11.0_1.jar:?]
      	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) ~[org.apache.servicemix.bundles.xerces-2.11.0_1.jar:?]
      	at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) ~[org.apache.servicemix.bundles.xerces-2.11.0_1.jar:?]
      	at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) ~[org.apache.servicemix.bundles.xerces-2.11.0_1.jar:?]
      	at org.xml.sax.helpers.XMLFilterImpl.parse(XMLFilterImpl.java:357) ~[?:?]
      	at org.eclipse.persistence.internal.oxm.record.XMLReader.parse(XMLReader.java:221) ~[org.eclipse.persistence.core-2.5.1.jar:?]
      	at org.eclipse.persistence.internal.oxm.record.SAXUnmarshaller.unmarshal(SAXUnmarshaller.java:492) ~[org.eclipse.persistence.core-2.5.1.jar:?]
      	at org.eclipse.persistence.internal.oxm.record.SAXUnmarshaller.unmarshal(SAXUnmarshaller.java:695) ~[org.eclipse.persistence.core-2.5.1.jar:?]
      	at org.eclipse.persistence.oxm.XMLUnmarshaller.unmarshal(XMLUnmarshaller.java:655) ~[org.eclipse.persistence.core-2.5.1.jar:?]
      	at org.eclipse.persistence.jaxb.JAXBUnmarshaller.unmarshal(JAXBUnmarshaller.java:301) ~[org.eclipse.persistence.moxy-2.5.1.jar:?]
      	at org.opennms.core.xml.JaxbUtils.unmarshal(JaxbUtils.java:276) ~[org.opennms.core.xml-25.1.0.jar:?]
      	at org.opennms.core.xml.JaxbUtils.unmarshal(JaxbUtils.java:209) ~[org.opennms.core.xml-25.1.0.jar:?]
      	at org.opennms.core.xml.JaxbUtils.unmarshal(JaxbUtils.java:214) ~[org.opennms.core.xml-25.1.0.jar:?]
      	at org.opennms.netmgt.eventd.listener.XmlEventProcessor.getEventLog(XmlEventProcessor.java:193) ~[org.opennms.features.events.daemon-25.1.0.jar:?]
      	at org.opennms.netmgt.eventd.listener.XmlEventProcessor.channelRead(XmlEventProcessor.java:111) ~[org.opennms.features.events.daemon-25.1.0.jar:?]
      	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374) [netty-all-4.1.38.Final.jar:4.1.38.Final]
      	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360) [netty-all-4.1.38.Final.jar:4.1.38.Final]
      	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352) [netty-all-4.1.38.Final.jar:4.1.38.Final]
      	at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:328) [netty-all-4.1.38.Final.jar:4.1.38.Final]
      	at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:315) [netty-all-4.1.38.Final.jar:4.1.38.Final]
      	at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:429) [netty-all-4.1.38.Final.jar:4.1.38.Final]
      	at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:283) [netty-all-4.1.38.Final.jar:4.1.38.Final]
      	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374) [netty-all-4.1.38.Final.jar:4.1.38.Final]
      	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360) [netty-all-4.1.38.Final.jar:4.1.38.Final]
      	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352) [netty-all-4.1.38.Final.jar:4.1.38.Final]
      	at io.netty.handler.logging.LoggingHandler.channelRead(LoggingHandler.java:241) [netty-all-4.1.38.Final.jar:4.1.38.Final]
      	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374) [netty-all-4.1.38.Final.jar:4.1.38.Final]
      	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360) [netty-all-4.1.38.Final.jar:4.1.38.Final]
      	at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352) [netty-all-4.1.38.Final.jar:4.1.38.Final]
      	at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1421) [netty-all-4.1.38.Final.jar:4.1.38.Final]
      	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374) [netty-all-4.1.38.Final.jar:4.1.38.Final]
      	at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360) [netty-all-4.1.38.Final.jar:4.1.38.Final]
      	at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:930) [netty-all-4.1.38.Final.jar:4.1.38.Final]
      	at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163) [netty-all-4.1.38.Final.jar:4.1.38.Final]
      	at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:697) [netty-all-4.1.38.Final.jar:4.1.38.Final]
      	at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:632) [netty-all-4.1.38.Final.jar:4.1.38.Final]
      	at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:549) [netty-all-4.1.38.Final.jar:4.1.38.Final]
      	at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:511) [netty-all-4.1.38.Final.jar:4.1.38.Final]
      	at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:918) [netty-all-4.1.38.Final.jar:4.1.38.Final]
      	at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) [netty-all-4.1.38.Final.jar:4.1.38.Final]
      	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [netty-all-4.1.38.Final.jar:4.1.38.Final]
      	at java.lang.Thread.run(Thread.java:834) [?:?]
      Caused by: java.time.format.DateTimeParseException: Text '2019-11-11T4:32:36+00:00' could not be parsed at index 11
      	at java.time.format.DateTimeFormatter.parseResolved0(DateTimeFormatter.java:2046) ~[?:?]
      	at java.time.format.DateTimeFormatter.parse(DateTimeFormatter.java:1948) ~[?:?]
      	at java.time.ZonedDateTime.parse(ZonedDateTime.java:598) ~[?:?]
      	at java.time.ZonedDateTime.parse(ZonedDateTime.java:583) ~[?:?]
      	at org.opennms.netmgt.events.api.EventConstants.parseToDate(EventConstants.java:1041) ~[org.opennms.features.events.api-25.1.0.jar:?]
      	at org.opennms.netmgt.events.api.DateTimeAdapter.unmarshal(DateTimeAdapter.java:46) ~[org.opennms.features.events.api-25.1.0.jar:?]
      	at org.opennms.netmgt.events.api.DateTimeAdapter.unmarshal(DateTimeAdapter.java:35) ~[org.opennms.features.events.api-25.1.0.jar:?]
      	at org.eclipse.persistence.internal.jaxb.XMLJavaTypeConverter.convertDataValueToObjectValue(XMLJavaTypeConverter.java:153) ~[org.eclipse.persistence.moxy-2.5.1.jar:?]
      	... 53 more
      

       

        Attachments

          Activity

            People

            • Assignee:
              ranger Benjamin Reed
              Reporter:
              tandeejay John Blackburn
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: