[NETCONF-567] NetconfMessageTransformer action ok message Created: 18/Sep/18  Updated: 16/Jan/19  Resolved: 16/Jan/19

Status: Resolved
Project: netconf
Component/s: None
Affects Version/s: Neon, Fluorine SR1
Fix Version/s: Neon, Fluorine SR2

Type: Bug Priority: High
Reporter: Anna Bencúrová Assignee: Anna Bencúrová
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File action-test@2018-10-03.yang    

 Description   

If the action inside yang doesn't contain output, only ok is returned within rpc-reply. But NetconfMessageTransformer reports error when such a message is processed.

 

For this issue I used the same invokation as in NETCONF-566. The Remove action has no output defined in Yang:

Optional<MountPoint> mountPointOpt = mountPointService.getMountPoint(NETCONF_MOUNTPOINT_II).toJavaUtil();
Optional<ActionService> serviceOpt = mountPointOpt.get().getService(org.opendaylight.controller.md.sal.binding.api.ActionService.class).toJavaUtil();
ActionService actionService = serviceOpt.get();
InstanceIdentifier<ActionExampleList> listId = InstanceIdentifier.builder(ActionExampleList.class, new ActionExampleListKey(2)).build();
Remove action = actionService.getActionHandle(Remove.class);
Preconditions.checkNotNull(action, "Action " + Remove.QNAME + " is not supported on device.");
Input input = new InputBuilder().setForce(true).build();
FluentFuture<RpcResult<Output>> outputFuture = action.invoke((KeyedInstanceIdentifier<ActionExampleList, ActionExampleListKey>) listId, input);
RpcResult<Output> result = outputFuture.get();

But we have problem when parsing the result, the NullPointerException is present:

Exception in thread "pool-13-thread-1" java.lang.NullPointerException
    at java.util.Objects.requireNonNull(Objects.java:203)
    at org.opendaylight.mdsal.dom.spi.SimpleDOMActionResult.<init>(SimpleDOMActionResult.java:43)
    at org.opendaylight.netconf.sal.connect.netconf.schema.mapping.NetconfMessageTransformer.toActionResult(NetconfMessageTransformer.java:320)
    at org.opendaylight.netconf.sal.connect.netconf.schema.mapping.NetconfMessageTransformer.toActionResult(NetconfMessageTransformer.java:74)
    at — ommited custom action service —
    at com.google.common.util.concurrent.Futures$CallbackListener.run(Futures.java:1377)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
    
As an input inside NetconfMessageTransformer is actionDefinition for Remove action (see attached yang model) and netconf message:
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="m-0">
    <ok/>
</rpc-reply>



 Comments   
Comment by Jakub Morvay [ 01/Oct/18 ]

apuchyova If possible and convenient, can you please provide us with model and data to easily replicate this?

Comment by Anna Bencúrová [ 03/Oct/18 ]

JMorvay, please see the updated description. Thank you.

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