[NETCONF-1177] PUT requests failing with "insert" query parameter on testool models Created: 05/Oct/23 Updated: 02/Feb/24 |
|
| Status: | Confirmed |
| Project: | netconf |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 7.0.0 |
| Type: | Bug | Priority: | Medium |
| Reporter: | Yaroslav Lastivka | Assignee: | Ruslan Kashapov |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | pt | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
||||||||||||||||||||||||||||||||||||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||
| Description |
|
PUT requests with query parameters: insert=first, insert=after&point, insert=before&point are failing {
"errors": {
"error": [
{
"error-tag": "operation-failed",
"error-info": "TransactionCommitFailedException{message=Netconf transaction commit failed, errorList=[RpcError [message=Netconf transaction commit failed, severity=ERROR, errorType=APPLICATION, tag=operation-failed, applicationTag=null, info=null, cause=NetconfDocumentedException{error-type=APPLICATION, error-tag=operation-failed, error-severity=ERROR, error-info={}, message=RPC during tx failed. Unexpected error <error>java.lang.IllegalArgumentException: Input is empty while expecting 1 item</error>}]]}",
"error-message": "Transaction(PUT) not committed correctly",
"error-type": "application"
}
]
}
}
Steps to reproduce: 2. Use the 'insert&point' parameters from the PUT with insert&point parameters.postman_collection.json |
| Comments |
| Comment by Ruslan Kashapov [ 28/Nov/23 ] |
|
the main cause of the issue seems to be incorrect removal of a list through netconf protocol. When netconf edit-config message is constructed for remove operation using yang instance identifier pointing to list the message like below occurs <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="m-19"> <edit-config> <target> <candidate/> </target> <config> <root xmlns="http://example.com/user-ordered-list" xmlns:op="urn:ietf:params:xml:ns:netconf:base:1.0" op:operation="remove"> <items/> </root> </config> </edit-config> </rpc> According to https://datatracker.ietf.org/doc/html/rfc6241#section-7.2 the operation expected to be defined on element the operation being applied to. The message above instructs to remove parent container (instead of list elements within), and empty <items/> causes parse error, because the key is mandatory. In order to remove all the elements belonging to requested list all the elements require to be listed like below <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="m-19"> <edit-config> <target> <candidate/> </target> <config> <root xmlns="http://example.com/user-ordered-list" xmlns:op="urn:ietf:params:xml:ns:netconf:base:1.0"> <items op:operation="remove"> <id>0</id> </items> <items op:operation="remove"> <id>1</id> </items> </root> </config> </edit-config> </rpc>
|
| Comment by Ruslan Kashapov [ 02/Feb/24 ] |
|
The issue with list deletion on remote device is extracted to https://jira.opendaylight.org/browse/NETCONF-1245 so it can be resolved independently. Current issue cannot be solved unless there is a netconf device which supports list items deletion then insertion in new order within same transaction. Blocker issue added to resolve storage issue at least for ODL device simulator – https://jira.opendaylight.org/browse/YANGTOOLS-1565 |