[NETVIRT-332] NumberFormatException observed during SNAT flow installation Created: 07/Dec/16  Updated: 15/Dec/17  Resolved: 10/Dec/16

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

Type: Bug
Reporter: Chetan Arakere Gowdru Assignee: Unassigned
Resolution: Done 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: 7315

 Description   

During SNAT flow installation(table=44 & table=46), the NAPT packet punted to controller is send back to hit the table=0 again and NumberFormat Exception been observed during this scenario.

opendaylight-user@root>Exception in thread "Thread-161" java.lang.NumberFormatException: For input string: "0xfffffff9"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Long.parseLong(Long.java:589)
at java.lang.Long.parseLong(Long.java:631)
at org.opendaylight.genius.mdsalutil.actions.ActionOutput.<init>(ActionOutput.java:46)
at org.opendaylight.genius.mdsalutil.ActionType$2.buildAction(ActionType.java:130)
at org.opendaylight.genius.mdsalutil.ActionInfo.buildAction(ActionInfo.java:90)
at org.opendaylight.genius.mdsalutil.MDSALUtil.buildActions(MDSALUtil.java:231)
at org.opendaylight.genius.mdsalutil.MDSALUtil.getPacketOut(MDSALUtil.java:213)
at org.opendaylight.netvirt.natservice.internal.NaptEventHandler.sendNaptPacketOut(NaptEventHandler.java:399)
at org.opendaylight.netvirt.natservice.internal.NaptEventHandler.handleEvent(NaptEventHandler.java:219)
at org.opendaylight.netvirt.natservice.internal.EventDispatcher.run(EventDispatcher.java:39)
at java.lang.Thread.run(Thread.java:745)

As a result, the NaptEventHandler is stopped post which no SNAT flows where getting installed.



 Comments   
Comment by Chetan Arakere Gowdru [ 07/Dec/16 ]

this issue(NumberFormatException) is due to the latest review merge in genius - https://git.opendaylight.org/gerrit/#/c/48782/

In NAT, the actionValues is passed as String(Hexadecimal), which been tried to converted to long using parseLong API which results in NumberFormatException.

NaptEventHandler.java (line 395)
https://github.com/opendaylight/netvirt/blob/master/vpnservice/natservice/natservice-impl/src/main/java/org/opendaylight/netvirt/natservice/internal/NaptEventHandler.java
actionInfos.add(new ActionInfo(ActionType.output, new String[]

{ "0xfffffff9" }

, 3));

ActionOutput.java (line 46 – parseLong fails to parse hexadecimal value type)
https://github.com/opendaylight/genius/blob/master/mdsalutil/mdsalutil-api/src/main/java/org/opendaylight/genius/mdsalutil/actions/ActionOutput.java

So, it is required to pass the equivalent long value(instead of hexadecimal) now with this change. We can make use of newly added ActionOutput class constructor to solve this issue.

actionInfos.add(new ActionOutput(3,Long.decode("0xfffffff9")));

Comment by Chetan Arakere Gowdru [ 07/Dec/16 ]

Review raised in master - https://git.opendaylight.org/gerrit/#/c/49076/

Comment by Chetan Arakere Gowdru [ 09/Dec/16 ]

Review Request to fix it in genius raised - https://git.opendaylight.org/gerrit/#/c/49135/

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