[NETCONF-1134] EMPTY body response on POST to /rests/operations Created: 14/Aug/23  Updated: 13/Sep/23  Resolved: 13/Sep/23

Status: Resolved
Project: netconf
Component/s: restconf-nb, restconf-openapi
Affects Version/s: 6.0.1
Fix Version/s: None

Type: Bug Priority: Medium
Reporter: Vladislav LH Assignee: Ivan Hrasko
Resolution: Cannot Reproduce Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Have found it using ONAP London release



 Description   

There is a bug in odl netconf for network element with custom yang model which contains RPC call.
When you trying to invoke rpc method via api call like "POST /rests/operations/{yang_module}:{method_name}", you expecting to receive response with body declared in output region of rpc call in yang model. For example:

  rpc software-check {
    description
      "Install a previously downloaded software package.";
    input

{       uses check-input;     }

    output

{       uses check-output;     }

  }

Response body have to represent a structure declared in "check-output" grouping, BUT body is EMPTY.

 

 

Version  ODL:   chlorine-SR1 (0.17.1), phosphorus-SR1 (0.15.1)



 Comments   
Comment by Robert Varga [ 30/Aug/23 ]

See https://www.rfc-editor.org/rfc/rfc8040#section-3.6.1

Comment by Samuel Schneider [ 05/Sep/23 ]

VladislavLH  can you provide more detailed steps to reproduce for this issue?

I tested this behavior and everything seems to work fine.
I used this example test device https://github.com/PANTHEONtech/lighty-netconf-simulator/tree/main/examples/devices/lighty-network-topology-device
RPCs declared in network-topology-rpcs@2018-03-20.yang works and return output as expected.
I could not reproduce this issue.

Comment by Vladislav LH [ 07/Sep/23 ]

Hi Samuel,

I'll give you a hint, we've already find the source of the problem. It is here in file netconf/sal-netconf-connector/src/main/java/org/opendaylight/netconf/sal/connect/netconf/sal/NetconfDeviceRpc.java

invokeRpc function returns value before rpc completion, which cause that DOMRpcResult.getResult() is empty and response has empty body

Comment by Vladislav LH [ 07/Sep/23 ]

and when the delegate is completed and future callback invokes onSuccess method there are no requests waiting for response because response is already handled with empty DOMRpcResult 

Comment by Ivan Hrasko [ 13/Sep/23 ]

We are not aligned with your analysis. Please provide exact steps to reproduce, paths, payloads, model. Otherwise we are closing this issue.

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