[YANGTOOLS-1465] Unexpected error processing source SourceIdentifier [ietf-network@2018-02-26] Created: 10/Nov/22  Updated: 24/Nov/22  Resolved: 24/Nov/22

Status: Resolved
Project: yangtools
Component/s: parser
Affects Version/s: 8.0.0, 9.0.0, 10.0.0, 9.0.2, 8.0.8
Fix Version/s: 10.0.1, 8.0.9, 9.0.4

Type: Bug Priority: High
Reporter: Mario Doman Assignee: Robert Varga
Resolution: Done Votes: 0
Labels: pt
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File console-timestamp.log.gz    

 Description   

Full log attached.

Affected models:

https://raw.githubusercontent.com/YangModels/yang/main/standard/ietf/RFC/ietf-te-topology-state@2020-08-06.yang

https://raw.githubusercontent.com/YangModels/yang/main/standard/ietf/RFC/ietf-te-topology@2020-08-06.yang



 Comments   
Comment by Mario Doman [ 10/Nov/22 ]

12:15:25 **************************************** ERROR IN YANG FILE /home/jenkins/src/main/yang/standard/ietf/RFC/ietf-te-topology-state.yang ****************************************12:15:25 11:11:20.799 [main] WARN org.opendaylight.yangtools.yang.parser.stmt.reactor.BuildGlobalContext - Unexpected error processing source SourceIdentifier [ietf-network-topology-state@2018-02-26]. Please file an issue with this model attached.

Comment by Robert Varga [ 22/Nov/22 ]

Okay, so the key factor here is that the leaf is guarded by if-feature and yang-model-validator is running with empty features.

This means the leaf should not be built, so the original has flags -88 == 0b10101000 which in turn decodes to:
HAVE_IGNORE_IF_FEATURE | HAVE_SUPPORTED_BY_FEATURES | ALL_INDEPENDENT.

So far this seems to involve undeclared case statements, which do not seem to realize they are no supported. This needs a bit of thought, as here we have an inverted parent->child causality: the child needs to be supported for the parent to be supported.

Comment by Robert Varga [ 22/Nov/22 ]

The reproducer is a bit involved:

module foo {
  namespace foo;
  prefix foo;

  feature foo;

  container foo;

  augment /foo {
    container bar {
      choice baz {
        mandatory true;

        leaf one {
          type string;
        }

        leaf two {
          if-feature foo;
          type string;
        }
      }
    }
  }
}

The problem seems to be the combination of augment, choice, implicit case and if-feature'd leaf. ietf-ip.yang triggers this as well, hence high priority.

Comment by Robert Varga [ 22/Nov/22 ]

Also, the error path occurs under container foo, hence I think the crux of the issue is InferredStatementContext not consulting original's either isSupportedByFeatures(), or more likely isSupportedToBuildEffective().

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