[YANGTOOLS-795] Yangtools throws org.opendaylight.yangtools.yang.parser.spi.meta.InferenceException while parsing yang files Created: 07/Jul/17 Updated: 10/Apr/22 Resolved: 07/Aug/17 |
|
| Status: | Resolved |
| Project: | yangtools |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | ||
| Reporter: | Geng Xingyuan | Assignee: | Unassigned |
| Resolution: | Cannot Reproduce | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Operating System: All |
||
| Attachments: |
|
| External issue ID: | 8817 |
| Description |
|
Including content like below in yang files: augment "/stateful:pcrpt/stateful:pcrpt-message/stateful:reports/stateful:path/endpoints-obj/address-family" { } Exception: er.spi.meta.InferenceException: Augment target 'Absolute {path=[(urn:opendaylight:params:xml:ns:yang:pcep:ietf:stateful?revision=2013-12-22)pcrpt, (urn:opendaylight:params:xml:ns:yang:pcep:ietf:s tateful?revision=2013-12-22)pcrpt-message, (urn:opendaylight:params:xml:ns:yang:pcep:ietf:stateful?revision=2013-12-22)reports, (urn:opendaylight:params:xml:ns:yang:pcep:ietf:stateful?revision=2013-12-22)path, (urn:zte.ngip.ipsdn:pcep-message-adapter ?revision=2016-05-30)endpoints-obj, (urn:zte.ngip.ipsdn:pcep-message-adapter?revision=2016-05-30)address-family]}' not found [at META-INF\yang\pcep-message-adapter.yang:81:4] ' not found [at META-INF\yang\pcep-message-adapter.yang:93:4] |
| Comments |
| Comment by Peter Kajsa [ 07/Jul/17 ] |
|
Please can you also attach yang models causing this issue or at least all parts from them required to replication of the bug. Thanks. |
| Comment by Jie Han [ 10/Jul/17 ] |
|
Attachment test-augment-statement1.yang has been added with description: test-augment-statement1.yang |
| Comment by Jie Han [ 10/Jul/17 ] |
|
Attachment test-augment-statement2.yang has been added with description: test-augment-statement2.yang |
| Comment by Jie Han [ 10/Jul/17 ] |
|
Attachment test-augment-statement3.yang has been added with description: test-augment-statement3.yang |
| Comment by Jie Han [ 10/Jul/17 ] |
|
Hi guys, |
| Comment by Igor Foltin [ 10/Jul/17 ] |
|
Hi, I looked at the 3 sample YANGs you provided and here's what's wrong with them. The problem lies in the module test-augment-statement3 in the augment target path: augment "/s1:top/s1:bar2" { The bar2 node should actually be prefixed with s2. This node was augmented into the s1:top container node from the test-augment-statement2 module |
| Comment by Jie Han [ 10/Jul/17 ] |
|
Thanks, that's my mistake. I just did not notice the prefix of the augmented node. |
| Comment by Igor Foltin [ 11/Jul/17 ] |
|
Could you please confirm that the problem was solved ? If yes, I would like to close this bug. |
| Comment by Geng Xingyuan [ 12/Jul/17 ] |
|
Problem remain after using the right prefix. |
| Comment by Geng Xingyuan [ 26/Jul/17 ] |
|
Because of our maven-repo's error. |
| Comment by Geng Xingyuan [ 28/Jul/17 ] |
|
module pcep-test { namespace "urn:pcep:test:augment:statement1"; import yang-ext { prefix ext; revision-date 2013-07-09; }import pcep-types { prefix pcep; revision-date 2013-10-05; }import odl-pcep-ietf-stateful07 { prefix stateful; revision-date 2013-12-22; }revision "2017-07-10"; augment "/stateful:pcrpt/stateful:pcrpt-message/stateful:reports/stateful:path" { ext:augment-identifier ext-rpt-endpoints; uses pcep:endpoints-object; } augment "/stateful:pcrpt/stateful:pcrpt-message/stateful:reports/stateful:path/pcep:endpoints-obj/pcep:address-family" { } |
| Comment by Geng Xingyuan [ 28/Jul/17 ] |
|
module pcep-test { namespace "urn:pcep:test:augment:statement1"; import yang-ext { prefix ext; revision-date 2013-07-09; }import pcep-types { prefix pcep; revision-date 2013-10-05; }import odl-pcep-ietf-stateful07 { prefix stateful; revision-date 2013-12-22; }revision "2017-07-10"; augment "/stateful:pcrpt/stateful:pcrpt-message/stateful:reports/stateful:path" { ext:augment-identifier ext-rpt-endpoints; uses pcep:endpoints-object; } augment "/stateful:pcrpt/stateful:pcrpt-message/stateful:reports/stateful:path/endpoints-obj/address-family" { } |
| Comment by Geng Xingyuan [ 28/Jul/17 ] |
|
Caused by: org.opendaylight.yangtools.yang.parser.spi.meta.InferenceException: Augment target 'Absolute {path=[(urn:opendaylight:params:xml:ns:yang:pcep:ietf:stateful?revision=2013-12-22)pcrpt, (urn:opendaylight:params:xml:ns:yang:pcep:ietf:stateful?revision=2013-12-22)pcrpt-message, (urn:opendaylight:params:xml:ns:yang:pcep:ietf:stateful?revision=2013-12-22)reports, (urn:opendaylight:params:xml:ns:yang:pcep:ietf:stateful?revision=2013-12-22)path, (urn:pcep:test:augment:statement1?revision=2017-07-10)endpoints-obj, (urn:pcep:test:augment:statement1?revision=2017-07-10)address-family]}' not found [at META-INF/yang/pcep-test.yang:19:4] code is stable/carbon branch |
| Comment by Geng Xingyuan [ 28/Jul/17 ] |
|
[ERROR] yang-to-sources: Unable to parse yang files from E:\oscp\netconf\opendaylight\netconf\models\ietf-netconf\src\main\yang ' not found [at META-INF\yang\pcep-test.yang:19:4] |
| Comment by Geng Xingyuan [ 28/Jul/17 ] |
|
This is because choice address-family's mandatory is true in pcep-types.yang grouping endpoints { case ipv4-case { leaf destination-ipv4-address { type inet:ipv4-address; mandatory true; } } leaf destination-ipv6-address { type inet:ipv6-address; mandatory true; } } |
| Comment by Peter Kajsa [ 07/Aug/17 ] |
|
So then the first augment below is invalid, because it is augment of the mandatory choice "address-family" into the target node (stateful:path) in another module. Therefore the augment is not performed (please see log, there should be an error or a warn about this) augment "/stateful:pcrpt/stateful:pcrpt-message/stateful:reports/stateful:path" { ext:augment-identifier zte-rpt-endpoints; uses pcep:endpoints-object; }and in consequence the following second augment below is not resolved, because the choice has not been added by the first augment and the exception was thrown: augment "/stateful:pcrpt/stateful:pcrpt-message/stateful:reports/stateful:path/endpoints-obj/address-family" { } For more info please see: https://tools.ietf.org/html/rfc6020#section-7.15 Therefore I am closing this bug as invalid. |