[NETCONF-223] IAE Caused by missing mandatory descendant Created: 04/Jul/16  Updated: 15/Mar/19  Resolved: 21/Jul/16

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

Type: Bug
Reporter: Claudio David Gasparini Assignee: Jakub Toth
Resolution: Won't Do 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
blocks BGPCEP-482 POSTing an openconfig neghbor fails Resolved
External issue ID: 6149

 Description   

BrokerFacade#putDataViaTransaction writes parent (ensureParentsByMerge) before put payload, and causes IllegalArgumentException since its putting an empty containerwhich which has mandatory childs.

java.lang.IllegalArgumentException: Node (http://openconfig.net/yang/bgp?revision=2015-10-09)bgp is missing mandatory descendant /(http://openconfig.net/yang/bgp?revision=2015-10-09)global/config/as

Under BUG-6069 it can be find the step to reproduce the bug.

Just removing ensureParentsByMerge did the fix,
https://git.opendaylight.org/gerrit/#/c/41268/
but it need to be review and finished for someone familiar with the code.
Since not sure what impact it has, and why it has been there in the first place.



 Comments   
Comment by Ryan Goulding [ 19/Jul/16 ]

Is this still valid? I see that you abandoned the candidate patch.

Comment by Claudio David Gasparini [ 19/Jul/16 ]

Hi Ryan, it still valid.
I restored it, but it is more a pointer to the line of code that causes the issue than than a patch.

Regards

Comment by Ivan Hrasko [ 21/Jul/16 ]

In this case when parent has mandatory fields error message is correct.
Mandatory field is consequent to user input or system setting. Ensure parents can not create mandatory fields.

Request must consist of two steps:
1. create parent (manually or set default value)
2. apply your request

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