[OPNFLWPLUG-278] NPE during message serialization Created: 16/Sep/14  Updated: 27/Sep/21  Resolved: 18/Sep/14

Status: Resolved
Project: OpenFlowPlugin
Component/s: General
Affects Version/s: None
Fix Version/s: None

Type: Bug
Reporter: Thomas Bachman Assignee: Michal Rehak
Resolution: Cannot Reproduce Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


External issue ID: 1907
Priority: High

 Description   

The following was seen when running the Group Based Policy application:

2014-09-16 06:59:01.477 PDT [pool-22-thread-3] WARN o.o.g.r.ofoverlay.flow.FlowTable - FLOW: Uri [_value=intraallow|10] Flow [_hardTimeout=0, _id=Uri [_value=intraallow|10], _idleTimeout=0, _instructions=Instructions [_instruction=[Instruction [_instruction=ApplyActionsCase [_applyActions=ApplyActions [_action=[Action [_action=NxActionOutputRegNodesNodeTableFlowApplyActionsCase [_nxOutputReg=NxOutputReg [_maxLen=65535, _src=Src [_ofsNbits=31, _srcChoice=SrcNxRegCase [_nxReg=class org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxReg7, augmentation=[]], augmentation=[]], augmentation=[]], augmentation=[]], _key=ActionKey [_order=0], _order=0, augmentation=[]]], augmentation=[]], augmentation=[]], _key=InstructionKey [_order=0], _order=0, augmentation=[]]], augmentation=[]], _key=FlowKey [_id=Uri [_value=intraallow|10]], _match=Match [augmentation=[GeneralAugMatchNodesNodeTableFlow [_extensionList=[ExtensionList [_extension=Extension [augmentation=[NxAugMatchNodesNodeTableFlow [_nxmNxReg=NxmNxReg [_reg=class org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxReg0, _value=10, augmentation=[]]]]], _extensionKey=class org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmNxReg0Key, _key=ExtensionListKey [_extensionKey=class org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmNxReg0Key], augmentation=[]], ExtensionList [_extension=Extension [augmentation=[NxAugMatchNodesNodeTableFlow [_nxmNxReg=NxmNxReg [_reg=class org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxReg2, _value=10, augmentation=[]]]]], _extensionKey=class org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmNxReg2Key, _key=ExtensionListKey [_extensionKey=class org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmNxReg2Key], augmentation=[]]]]]], _priority=65000, _tableId=3, _barrier=false, augmentation=[]]
2014-09-16 06:59:01.559 PDT [nioEventLoopGroup-11-3] WARN o.o.o.protocol.impl.core.OFEncoder - Message serialization failed
java.lang.NullPointerException: null
at org.opendaylight.openflowjava.nx.codec.action.RegLoadCodec.serialize(RegLoadCodec.java:32) ~[na:na]
at org.opendaylight.openflowjava.nx.codec.action.RegLoadCodec.serialize(RegLoadCodec.java:19) ~[na:na]
at org.opendaylight.openflowjava.protocol.impl.util.ListSerializer.serializeList(ListSerializer.java:39) ~[bundlefile:na]
at org.opendaylight.openflowjava.protocol.impl.serialization.instruction.AbstractActionInstructionSerializer.serialize(AbstractActionInstructionSerializer.java:47) ~[bundlefile:na]
at org.opendaylight.openflowjava.protocol.impl.serialization.instruction.AbstractActionInstructionSerializer.serialize(AbstractActionInstructionSerializer.java:30) ~[bundlefile:na]
at org.opendaylight.openflowjava.protocol.impl.util.ListSerializer.serializeList(ListSerializer.java:39) ~[bundlefile:na]
at org.opendaylight.openflowjava.protocol.impl.serialization.factories.FlowModInputMessageFactory.serialize(FlowModInputMessageFactory.java:56) ~[bundlefile:na]
at org.opendaylight.openflowjava.protocol.impl.serialization.factories.FlowModInputMessageFactory.serialize(FlowModInputMessageFactory.java:32) ~[bundlefile:na]
at org.opendaylight.openflowjava.protocol.impl.serialization.SerializationFactory.messageToBuffer(SerializationFactory.java:36) ~[bundlefile:na]
at org.opendaylight.openflowjava.protocol.impl.core.OFEncoder.encode(OFEncoder.java:41) [bundlefile:na]
at org.opendaylight.openflowjava.protocol.impl.core.OFEncoder.encode(OFEncoder.java:26) [bundlefile:na]
at io.netty.handler.codec.MessageToByteEncoder.write(MessageToByteEncoder.java:107) [bundlefile:4.0.23.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:658) [bundlefile:4.0.23.Final]
at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:716) [bundlefile:4.0.23.Final]
at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:651) [bundlefile:4.0.23.Final]
at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:637) [bundlefile:4.0.23.Final]
at io.netty.channel.DefaultChannelPipeline.write(DefaultChannelPipeline.java:880) [bundlefile:4.0.23.Final]
at io.netty.channel.AbstractChannel.write(AbstractChannel.java:230) [bundlefile:4.0.23.Final]
at org.opendaylight.openflowjava.protocol.impl.connection.ChannelOutboundQueue.flush(ChannelOutboundQueue.java:189) [bundlefile:na]
at org.opendaylight.openflowjava.protocol.impl.connection.ChannelOutboundQueue.access$000(ChannelOutboundQueue.java:40) [bundlefile:na]
at org.opendaylight.openflowjava.protocol.impl.connection.ChannelOutboundQueue$1.run(ChannelOutboundQueue.java:84) [bundlefile:na]
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:351) [bundlefile:4.0.23.Final]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:350) [bundlefile:4.0.23.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116) [bundlefile:4.0.23.Final]
at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:137) [bundlefile:4.0.23.Final]
at java.lang.Thread.run(Thread.java:745) [na:1.7.0_65]

The application programs 58 flows on each of the two nodes. One node gets all 58, and the other gets 57 out of 58.



 Comments   
Comment by Michal Polkorab [ 17/Sep/14 ]

Adding dumped flow that Thomas sent over email:

2014-09-16 06:59:01.477 PDT [pool-22-thread-3] WARN o.o.g.r.ofoverlay.flow.FlowTable - FLOW: Uri [_value=intraallow|10] Flow [_hardTimeout=0, _id=Uri [_value=intraallow|10], _idleTimeout=0, _instructions=Instructions [_instruction=[Instruction [_instruction=ApplyActionsCase [_applyActions=ApplyActions [_action=[Action [_action=NxActionOutputRegNodesNodeTableFlowApplyActionsCase [_nxOutputReg=NxOutputReg [_maxLen=65535, _src=Src [_ofsNbits=31, _srcChoice=SrcNxRegCase [_nxReg=class org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxReg7, augmentation=[]], augmentation=[]], augmentation=[]], augmentation=[]], _key=ActionKey [_order=0], _order=0, augmentation=[]]], augmentation=[]], augmentation=[]], _key=InstructionKey [_order=0], _order=0, augmentation=[]]], augmentation=[]], _key=FlowKey [_id=Uri [_value=intraallow|10]], _match=Match [augmentation=[GeneralAugMatchNodesNodeTableFlow [_extensionList=[ExtensionList [_extension=Extension [augmentation=[NxAugMatchNodesNodeTableFlow [_nxmNxReg=NxmNxReg [_reg=class org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxReg0, _value=10, augmentation=[]]]]], _extensionKey=class org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmNxReg0Key, _key=ExtensionListKey [_extensionKey=class org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmNxReg0Key], augmentation=[]], ExtensionList [_extension=Extension [augmentation=[NxAugMatchNodesNodeTableFlow [_nxmNxReg=NxmNxReg [_reg=class org.opendaylight.yang.gen.v1.urn.opendaylight.openflowjava.nx.match.rev140421.NxmNxReg2, _value=10, augmentation=[]]]]], _extensionKey=class org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmNxReg2Key, _key=ExtensionListKey [_extensionKey=class org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.nicira.match.rev140714.NxmNxReg2Key], augmentation=[]]]]]], _priority=65000, _tableId=3, _barrier=false, augmentation=[]]
2014-09-16 06:59:01.559 PDT [nioEventLoopGroup-11-3] WARN o.o.o.protocol.impl.core.OFEncoder - Message serialization failed
java.lang.NullPointerException: null
at org.opendaylight.openflowjava.nx.codec.action.RegLoadCodec.serialize(RegLoadCodec.java:32) ~[na:na]

This looks like the OutputReg action (NxActionOutputReg) is being serialized by wrong serializer (RegLoadCodec). There might be some translation bug in openflowplugin or controller.

Comment by Michal Rehak [ 17/Sep/14 ]

Hi Thomas, I can not replicate. Could you attach the trouble maker flow?
I tried with this action:

<action>
<order>1</order>
<nx-output-reg xmlns="urn:opendaylight:openflowplugin:extension:nicira:action">
<src>
<nx-reg xmlns:nxSB="urn:opendaylight:openflowjava:nx:match">nxSB:nxm-nx-reg7</nx-reg>
<ofs_nbits>31</ofs_nbits>
</src>
<max_len>65535</max_len>
</nx-output-reg>
</action>

and the only suspicious thing I noticed was failing action deserializing in stats.

Thank you.

Comment by Thomas Bachman [ 18/Sep/14 ]

I haven't seen this in the latest runs, and because of that thought that it had been fixed . I'm fine with closing this bug for now, and we could reopen it if we end up seeing it again (it was very repeatable when it was happening).

Comment by Michal Rehak [ 18/Sep/14 ]

Failed to replicate.

Generated at Wed Feb 07 20:32:02 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.