Uploaded image for project: 'mdsal'
  1. mdsal
  2. MDSAL-677

ietf-topology contains invalid leafrefs

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Medium Medium
    • 8.0.1, 6.0.11, 7.0.9
    • 8.0.0
    • models
    • None

      The legacy ietf-topology model contains a day-zero bug in its 'topology-ref' typedefs. These are using leafref with an absolute path with unqualified names.

      As per RFC7950 section 6.4.1, these are qualified based on referent and end up pointing into invalid places. An example of this can be found with https://docs.opendaylight.org/projects/bgpcep/en/latest/pcep/pcep-user-guide-active-stateful-pce.html#lsp-instantiation not being accepted anymore and the following error reported:

      {
         "errors" : {
            "error" : [
               {
                  "error-info" : "Data tree child (urn:opendaylight:params:xml:ns:yang:topology:pcep?revision=2020-01-20)network-topology not present",
                  "error-message" : "Error parsing input: Data tree child (urn:opendaylight:params:xml:ns:yang:topology:pcep?revision=2020-01-20)network-topology not present",
                  "error-tag" : "malformed-message",
                  "error-type" : "protocol"
               }
            ]
         }
      }
      

      The underlying cause for this is:

      2021-07-21T15:42:08,091 | DEBUG | qtp1017886163-585 | JsonNormalizedNodeBodyReader     | 305 - org.opendaylight.netconf.restconf-nb-bierman02 - 2.0.1 | Error parsing json input
      java.lang.IllegalArgumentException: Data tree child (urn:opendaylight:params:xml:ns:yang:topology:pcep?revision=2020-01-20)network-topology not present
              at org.opendaylight.yangtools.yang.model.util.SchemaInferenceStack.lambda$pushData$3(SchemaInferenceStack.java:770) ~[bundleFile:?]
              at java.util.Optional.orElseThrow(Optional.java:408) ~[?:?]
              at org.opendaylight.yangtools.yang.model.util.SchemaInferenceStack.pushData(SchemaInferenceStack.java:769) ~[bundleFile:?]
              at org.opendaylight.yangtools.yang.model.util.SchemaInferenceStack.pushFirstData(SchemaInferenceStack.java:778) ~[bundleFile:?]
              at org.opendaylight.yangtools.yang.model.util.SchemaInferenceStack.pushData(SchemaInferenceStack.java:758) ~[bundleFile:?]
              at org.opendaylight.yangtools.yang.model.util.SchemaInferenceStack.enterDataTree(SchemaInferenceStack.java:472) ~[bundleFile:?]
              at org.opendaylight.yangtools.yang.model.util.SchemaInferenceStack.enterChild(SchemaInferenceStack.java:639) ~[bundleFile:?]
              at org.opendaylight.yangtools.yang.model.util.SchemaInferenceStack.resolveLocationPath(SchemaInferenceStack.java:618) ~[bundleFile:?]
              at org.opendaylight.yangtools.yang.model.util.SchemaInferenceStack.resolvePathExpression(SchemaInferenceStack.java:561) ~[bundleFile:?]
              at org.opendaylight.yangtools.yang.model.util.SchemaInferenceStack.resolveLeafref(SchemaInferenceStack.java:534) ~[bundleFile:?]
              at org.opendaylight.yangtools.yang.data.util.codec.AbstractCodecFactory.createComplexCodecFor(AbstractCodecFactory.java:217) ~[bundleFile:?]
              at org.opendaylight.yangtools.yang.data.util.codec.AbstractCodecFactory.codecFor(AbstractCodecFactory.java:100) ~[bundleFile:?]
              at org.opendaylight.yangtools.yang.data.codec.gson.JsonParserStream.translateValueByType(JsonParserStream.java:372) ~[bundleFile:?]
              at org.opendaylight.yangtools.yang.data.codec.gson.JsonParserStream.setValue(JsonParserStream.java:366) ~[bundleFile:?]
              at org.opendaylight.yangtools.yang.data.codec.gson.JsonParserStream.read(JsonParserStream.java:270) ~[bundleFile:?]
              at org.opendaylight.yangtools.yang.data.codec.gson.JsonParserStream.read(JsonParserStream.java:336) ~[bundleFile:?]
              at org.opendaylight.yangtools.yang.data.codec.gson.JsonParserStream.read(JsonParserStream.java:336) ~[bundleFile:?]
              at org.opendaylight.yangtools.yang.data.codec.gson.JsonParserStream.parse(JsonParserStream.java:193) ~[bundleFile:?]
              at org.opendaylight.netconf.sal.rest.impl.JsonNormalizedNodeBodyReader.readFrom(JsonNormalizedNodeBodyReader.java:131) ~[bundleFile:?]
              at org.opendaylight.netconf.sal.rest.impl.JsonNormalizedNodeBodyReader.readFrom(JsonNormalizedNodeBodyReader.java:85) ~[bundleFile:?]
              at org.opendaylight.netconf.sal.rest.impl.JsonNormalizedNodeBodyReader.readFrom(JsonNormalizedNodeBodyReader.java:57) ~[bundleFile:?]
      
      

      As is evident, we are trying to lookup network-topology in odl-topology-pcep namespace – and that does not exist, leading to the failure.

            rovarga Robert Varga
            rovarga Robert Varga
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: