[CONTROLLER-908] exception while deleting item in ordered list Created: 29/Sep/14  Updated: 24/Oct/14  Resolved: 24/Oct/14

Status: Resolved
Project: controller
Component/s: restconf
Affects Version/s: Helium
Fix Version/s: None

Type: Bug
Reporter: Martin Lauko Assignee: Jan Hajnar
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Issue Links:
Blocks
is blocked by YANGTOOLS-337 schema aware builders for ordered lis... Resolved
External issue ID: 2111

 Description   
  • list in list in yang model

while deleting via restconf item in inner (ordered-by user list)

exception is thrown

Caused by: java.lang.IllegalArgumentException\n\tat com.google.common.base.Preconditions.checkArgument(Preconditions.java:76)\n\tat org.opendaylight.yangtools.yang.data.impl.schema.tree.NormalizedNodeContainerModificationStrategy$OrderedMapModificationStrategy.createBuilder(NormalizedNodeContainerModificationStrategy.java:271)\n\tat org.opendaylight.yangtools.yang.data.impl.schema.tree.NormalizedNodeContainerModificationStrategy.applySubtreeChange(NormalizedNodeContainerModificationStrategy.java:155)\n\tat org.opendaylight.yangtools.yang.data.impl.schema.tree.NormalizedNodeContainerModificationStrategy$OrderedMapModificationStrategy.applySubtreeChange(NormalizedNodeContainerModificationStrategy.java:254)\n\tat org.opendaylight.yangtools.yang.data.impl.schema.tree.SchemaAwareApplyOperation.apply(SchemaAwareApplyOperation.java:209)\n\tat org.opendaylight.yangtools.yang.data.impl.schema.tree.NormalizedNodeContainerModificationStrategy.mutateChildren(NormalizedNodeContainerModificationStrategy.java:126)\n\tat org.opendaylight.yangtools.yang.data.impl.schema.tree.NormalizedNodeContainerModificationStrategy.applySubtreeChange(NormalizedNodeContainerModificationStrategy.java:157)\n\tat org.opendaylight.yangtools.yang.data.impl.schema.tree.DataNodeContainerModificationStrategy$ListEntryModificationStrategy.applySubtreeChange(DataNodeContainerModificationStrategy.java:133)\n\tat org.opendaylight.yangtools.yang.data.impl.schema.tree.SchemaAwareApplyOperation.apply(SchemaAwareApplyOperation.java:209)\n\tat org.opendaylight.yangtools.yang.data.impl.schema.tree.NormalizedNodeContainerModificationStrategy.mutateChildren(NormalizedNodeContainerModificationStrategy.java:126)\n\tat org.opendaylight.yangtools.yang.data.impl.schema.tree.NormalizedNodeContainerModificationStrategy.applySubtreeChange(NormalizedNodeContainerModificationStrategy.java:157)\n\tat

org.opendaylight.yangtools.yang-data-impl-0.6.2-20140922.164315-768.jar



 Comments   
Comment by Martin Lauko [ 30/Sep/14 ]

Same exception while adding item into list via restconf.

investigation:

method 'createBuilder' receives argument 'original', which is instance of ImmutableMapNodeBuilder$ImmutableMapNode type and that's because exception is thrown in checkArgument(original instanceof OrderedMapNode);

yang:

container access-lists {

list access-list {
key "acl-name";
leaf acl-name

{ description "name of access-list"; type string; }

list access-list-entries {
key rule-name;
ordered-by user;
leaf rule-name

{ description "Entry name"; type string; }

}
}
}

Comment by Tony Tkacik [ 06/Oct/14 ]

Did you specify key leaf rule-name?

Comment by Martin Lauko [ 07/Oct/14 ]

was sending this DELETE request
DELETE: http://localhost:8181/restconf/config/ietf-acl:access-lists/access-list/acl-1/access-list-entries/rule-2

in data store is this data:

{"access-lists": {"access-list": [
{"acl-name": "acl-1", "access-list-entries": [
{"rule-name": "rule-2", "matches": {"source-ipv6-address": "1::0", "source-port-range":

{"lower-port": 300}

, "destination-port-range":

{"lower-port": 200}

, "absolute": {"active": true}}, "actions": {"service-function-acl:service-function-path": "sfg"}},
{"rule-name": "rule-1", "matches": {"source-mac-address": "AA:AA:AA:AA:AA:AA", "absolute": {"active": true}}, "actions": {"service-function-acl:service-function-path": "sfv"}}
]}
]}}

But i think, this exceception is not connected with restconf, but with data modification in ordered list.

Sources od yang model can be found here: https://git.opendaylight.org/gerrit/gitweb?p=sfc.git;a=tree;f=sfc-model/src/main/yang;hb=HEAD

Comment by Jan Hajnar [ 16/Oct/14 ]

This bug seems to be connected to YANGTOOLS-337 which is in "waiting for review" state, but is still missing some files from gerrit commit. Please test your code with patch linked in that bug when commit is complete.

Comment by Jan Hajnar [ 24/Oct/14 ]

fix:
https://git.opendaylight.org/gerrit/#/c/12222/

Comment by Martin Lauko [ 24/Oct/14 ]

Verified with fix applied on yangtools 0.6.3-SNAPSHOT. OK

Generated at Wed Feb 07 19:54:11 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.