[NETCONF-427] Adding element to user ordered list fails Created: 30/May/17  Updated: 15/Mar/19  Resolved: 05/Jun/17

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

Type: Bug
Reporter: Marek Gradzki Assignee: Tomas Cere
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Attachments: Text File hc_log.txt    
External issue ID: 8566

 Description   

While adding ACE to ACL (user ordered list) trough netconf

<edit-config>
<target>
<candidate/>
</target>
<default-operation>none</default-operation>
<config>
<access-lists xmlns="urn:ietf:params:xml:ns:yang:ietf-access-control-list">
<acl>
<acl-type>ipv4-acl</acl-type>
<acl-name>test_acl</acl-name>
<access-list-entries>
<ace xmlns:a="urn:ietf:params:xml:ns:netconf:base:1.0" a:operation="replace">
<rule-name>rule2</rule-name>
<matches>
<source-ipv4-network>192.168.2.2/32</source-ipv4-network>
</matches>
<actions>
<permit/>
</actions>
</ace>
</access-list-entries>
</acl>
</access-lists>
</config>
</edit-config>

we got:

java.lang.IllegalArgumentException: Node ImmutableMapNode

{nodeIdentifier=(urn:ietf:params:xml:ns:yang:ietf-access-control-list?revision=2016-07-08)ace, value=[]}

is not of type interface org.opendaylight.yangtools.yang.data.api.schema.OrderedMapNode
at com.google.common.base.Preconditions.checkArgument(Preconditions.java:145) ~[guava-18.0.jar:na]
at org.opendaylight.yangtools.yang.data.impl.schema.tree.AbstractNodeContainerModificationStrategy.verifyStructure(AbstractNodeContainerModificationStrategy.java:46) ~[yang-data-impl-1.0.4-SNAPSHOT.jar:na]
at org.opendaylight.yangtools.yang.data.impl.schema.tree.OperationWithModification.merge(OperationWithModification.java:45) ~[yang-data-impl-1.0.4-SNAPSHOT.jar:na]
at org.opendaylight.yangtools.yang.data.impl.schema.tree.InMemoryDataTreeModification.merge(InMemoryDataTreeModification.java:79) ~[yang-data-impl-1.0.4-SNAPSHOT.jar:na]
at io.fd.honeycomb.data.impl.ModifiableDataTreeManager$ConfigSnapshot.merge(ModifiableDataTreeManager.java:94) ~[data-impl-1.17.07-SNAPSHOT.jar:na]
at io.fd.honeycomb.data.impl.WriteTransaction.lambda$merge$1(WriteTransaction.java:98) ~[data-impl-1.17.07-SNAPSHOT.jar:na]
at io.fd.honeycomb.data.impl.WriteTransaction$$Lambda$136/287161584.accept(Unknown Source) ~[na:na]
at io.fd.honeycomb.data.impl.WriteTransaction.handleOperation(WriteTransaction.java:82) ~[data-impl-1.17.07-SNAPSHOT.jar:na]
at io.fd.honeycomb.data.impl.WriteTransaction.merge(WriteTransaction.java:98) ~[data-impl-1.17.07-SNAPSHOT.jar:na]
at io.fd.honeycomb.data.impl.ReadWriteTransaction.merge(ReadWriteTransaction.java:76) ~[data-impl-1.17.07-SNAPSHOT.jar:na]
at org.opendaylight.netconf.mdsal.connector.ops.EditConfig.mergeParentMap(EditConfig.java:162) ~[mdsal-netconf-connector-1.1.4-SNAPSHOT.jar:na]

If we change ordering to system everything works.
Corresponding RESTCONF request works regardless of the order.

Issue was observed using Boron-SR3. Honeycomb LOG attached. Instructions to reproduce available at https://gerrit.fd.io/r/#/c/6910.



 Comments   
Comment by Marek Gradzki [ 30/May/17 ]

Attachment hc_log.txt has been added with description: Honeycomb log

Comment by Peter Kajsa [ 30/May/17 ]

When a list is "ordered-by user" it is necessary to write ImmutableOrderedMapNode instead of ImmutableMapNode into InMemoryDataTree. However, there is an attempt to write ImmutableMapNode and therefore this write fails in Yangtools when the list "ace" is "ordered-by user".

Comment by Marek Gradzki [ 01/Jun/17 ]

https://git.opendaylight.org/gerrit/#/c/58041/1
and
https://git.opendaylight.org/gerrit/#/c/58042/2
fix the issue. Thanks!

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