[NETCONF-763] yang-patch in Aluminium-SR1 does not work Created: 03/Mar/21  Updated: 04/Mar/21  Resolved: 04/Mar/21

Status: Resolved
Project: netconf
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Medium
Reporter: Yevgeny Shakhnovich Assignee: Yevgeny Shakhnovich
Resolution: Won't Do Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

yang-patch does not work. In response I get

It does not work.

The request was  PATCH

url:  [http://orion:8181/rests/data/network-topology/topology=topology-netconf/node=123a/yang-ext:mount/ipi-interface:interfaces/interface=eth2/ipi-if-ip:ipv4
]

body:


    "ietf-restconf:yang-patch": {
        "patch-id": "edit1",
        "comment": "no-comment",
        "edit": [
            {
                "edit-id": "edit1",
                "operation":"merge",
                "target":"/ipi-if-ip:config",
                "value": {
                    "ipi-if-ip:config": 

Unknown macro: {                         "primary-ip-addr" }

                }

            }

        ]

    }

}
 

In response I get

{

    "errors": {

        "error": [

            

Unknown macro: {                 "error-type"}

        ]

    }

}

The response is caused by exception

JsonNormalizedNodeBodyReader     | 300 - org.opendaylight.netconf.restconf-nb-rfc8040 - 1.12.1 | Error parsing json input

java.lang.IllegalStateException: Schema node with name yang-patch was not found under (http://www.ipinfusion.com/yang/ocnos/ipi-interface?revision=2020-12-15)interface.

                at org.opendaylight.yangtools.yang.data.codec.gson.JsonParserStream.resolveNamespace(JsonParserStream.java:385) ~[bundleFile:?]

Absolutely the same yang-patch request to the same device works in Magnesium-SR2.

 

The response is caused by exception

 

JsonNormalizedNodeBodyReader     | 300 - org.opendaylight.netconf.restconf-nb-rfc8040 - 1.12.1 | Error parsing json input

java.lang.IllegalStateException: Schema node with name yang-patch was not found under (http://www.ipinfusion.com/yang/ocnos/ipi-interface?revision=2020-12-15)interface.

                at org.opendaylight.yangtools.yang.data.codec.gson.JsonParserStream.resolveNamespace(JsonParserStream.java:385) ~[bundleFile:?]

 

Absolutely the same yang-patch request to the same device works in Magnesium-SR2.



 Comments   
Comment by Yevgeny Shakhnovich [ 03/Mar/21 ]

The response is different from what I put:
{
    "ietf-yang-patch:yang-patch-status": {
        "patch-id": "edit1",
        "errors": {
            "error": [
                

{                     "error-type": "rpc",                     "error-tag": "operation-failed",                     "error-message": "RemoteDevice\{10.10.27.123}

:RPC during tx failed. Currently only 'delete' operation is supported at node-level.<error-number>130</error-number>Currently only 'delete' operation is supported at node-level.<error-number>130</error-number>",
                    "error-info": "TransactionCommitFailedException{message=Commit of transaction org.opendaylight.netconf.sal.connect.netconf.sal.NetconfDataTreeServiceImpl$1@7a9be987 failed, errorList=[RpcError [message=Commit of transaction org.opendaylight.netconf.sal.connect.netconf.sal.NetconfDataTreeServiceImpl$1@7a9be987 failed, severity=ERROR, errorType=APPLICATION, tag=operation-failed, applicationTag=null, info=null, cause=NetconfDocumentedException{message=RemoteDevice

{10.10.27.123}

:RPC during tx failed. Currently only 'delete' operation is supported at node-level.<error-number>130</error-number>Currently only 'delete' operation is supported at node-level.<error-number>130</error-number>, errorType=RPC, errorTag=OPERATION_FAILED, errorSeverity=ERROR, errorInfo={}}]]}"
                }
            ]
        },
        "edit-status": {
            "edit": [
                

{                     "edit-id": "edit1",                     "ok": [                         null                     ]                 }

            ]
        }
    }
}
 

Comment by Yevgeny Shakhnovich [ 03/Mar/21 ]

OK, now I know the difference between Magnesium and Aluminium. I am not sure that it is a bug in Aluminium:

So, the URL was the same in both cases:

PATCH http://localhost:8181/rests/data/network-topology/topology=topology-netconf/node=10.10.27.123/yang-ext:mount/ipi-interface:interfaces/interface=eth2/ipi-if-ip:ipv4
Content-type: application/yang.patch+json

 

But Netconf requests were different:

on Aluminium 

 

<rpc message-id="m-2521" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
 <edit-config>
 <target>
 <candidate/>
 </target>
 <error-option>rollback-on-error</error-option>
 <config>
 <interfaces xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-interface">
 <interface>
 <name>eth2</name>
 <ipv4 xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-if-ip">
 <config xmlns:op="urn:ietf:params:xml:ns:netconf:base:1.0" op:operation="merge">
 <primary-ip-addr>30.1.1.1/24</primary-ip-addr>
 </config>
 </ipv4>
 </interface>
 </interfaces>
 </config>
 </edit-config>
</rpc>

 

on Magnesium

<rpc message-id="m-479" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
 <edit-config>
 <target>
 <candidate/>
 </target>
 <error-option>rollback-on-error</error-option>
 <config>
 <interfaces xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-interface">
 <interface>
 <name>eth2</name>
 <ipv4 xmlns="http://www.ipinfusion.com/yang/ocnos/ipi-if-ip">
 <config>
 <primary-ip-addr>30.1.1.1/24</primary-ip-addr>
 </config>
 </ipv4>
 </interface>
 </interfaces>
 </config>
 </edit-config>
</rpc>

You see that in Magnesium there is no attribute op:operation="merge"

Response in Aluminium:

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:ipi-if-ip="http://www.ipinfusion.com/yang/ocnos/ipi-if-ip" xmlns:ipi-interface="http://www.ipinfusion.com/yang/ocnos/ipi-interface" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:ncx="http://netconfcentral.org/ns/yuma-ncx" message-id="m-2521">
 
 <rpc-error>
 
 <error-type>rpc</error-type>
 
 <error-tag>operation-failed</error-tag>
 
 <error-severity>error</error-severity>
 
 <error-app-tag>general-error</error-app-tag>
 
 <error-path>/nc:rpc/nc:edit-config/nc:config/ipi-interface:interfaces/ipi-interface:interface[ipi-interface:name='eth2']/ipi-if-ip:ipv4/ipi-if-ip:config/ipi-if-ip:primary-ip-addr</error-path>
 
 <error-message xml:lang="en">Currently only 'delete' operation is supported at node-level.</error-message>
 
 <error-info>
 
 <error-number xmlns="http://netconfcentral.org/ns/yuma-ncx">130</error-number>
 
 </error-info>
 
 </rpc-error>
 
</rpc-reply>

 

Response in Magnesium:

<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="m-479">
 
 <ok/>
 
</rpc-reply>
Comment by Yevgeny Shakhnovich [ 04/Mar/21 ]

This is not a bug in ODL. ODL works as designed. The bug is in our network devices.

Comment by Yevgeny Shakhnovich [ 04/Mar/21 ]

This is not a bug in ODL. ODL works as designed.

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