[YANGTOOLS-1048] YANG parser can't parse ietf-subscribed-notifications module when "configured" feature is not present Created: 17/Dec/19  Updated: 13/Dec/22

Status: Open
Project: yangtools
Component/s: parser
Affects Version/s: 2.1.8
Fix Version/s: None

Type: Bug Priority: Medium
Reporter: Peter Verthez Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: pick-next, pt
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Zip Archive refinebug.zip    

 Description   

See the attached model. When passing this to the YANG parser with either no features defined or without the "configured" feature defined on the ietf-subscribed-notifications module, the YANG parser gives the following error:

Caused by: org.opendaylight.yangtools.yang.parser.spi.meta.InferenceException: Refine target node Relative{path=[(urn:ietf:params:xml:ns:yang:ietf-subscribed-notifications?revision=2019-09-09)transport]} not found. [at /home/verthezp/tmp/bugs/refinebug/ietf-subscribed-notifications.yang:1148:8]

The reason is that the "transport" node is under an "if-feature configured", but the refine statement is not.

Since all the modules in this example are IETF standard models, it probably indicates that the design of the ODL parser, which removes nodes under an if-feature first before proceeding to process the model, is wrong. We had related bugs such as YANGTOOLS-803, but there we always fixed it by making sure that the if-feature was given both at the target and the statement modifying it. I see also YANGTOOLS-811, which was rejected. I was previously also under the impression that that decision was correct, but looking at these standard models, that decision may be wrong, and the YANG parser may have to change.

We are currently on YANG parser version 2.1.8, I haven't checked this yet with newer versions.



 Comments   
Comment by Peter Verthez [ 17/Dec/19 ]

Sorry, I forgot that there is already YANGTOOLS-859. This ticket can probably be a duplicate of that one.

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