Uploaded image for project: 'yangtools'
  1. yangtools
  2. YANGTOOLS-1362

Deserialization of instance-identifier doesn't seem to work

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Medium
    • Resolution: Won't Do
    • 7.0.9
    • None
    • None
    • None

    Description

      ODL Release - Silicon-SR1 (0.14.1)

      Yangtools version - 6.0.6

      MD-SAL version - 7.0.7

      On receiving the following Netconf notification, the "target" field which is of type "instance-identifier" is not deserialized and hence the related data is missing in the deserialized object,

       

      <notification xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0">
       <eventTime>2021-11-11T11:26:16Z</eventTime> 
        <netconf-config-change xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-notifications">
           <changed-by> 
             <username>root</username> 
             <session-id>3</session-id> 
           </changed-by> 
           <datastore>running</datastore> 
           <edit> 
              <target xmlns:hw="urn:ietf:params:xml:ns:yang:ietf-hardware">/hw:hardware/component[name='chassis-fan0']/alias</target>
              <operation>replace</operation> 
           </edit> 
        </netconf-config-change> 
      </notification>
       
      

      Following is the Netconf TRACE, yangtools TRACE and some debugs from SDN-R while processing this notification -

       

       
      2021-11-11T11:26:17,017 | TRACE | nioEventLoopGroupCloseable-3-4 | NetconfDeviceCommunicator | 358 - org.opendaylight.netconf.sal-netconf-connector - 1.13.2 | - | RemoteDevice{NTS_FUNCTION_TYPE_O_RAN_FH-0-830}: Notification received: <notification xmlns="urn:ietf:params:xml:ns:netconf:notification:1.0">
       <eventTime>2021-11-11T11:26:16Z</eventTime>
       <netconf-config-change xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-notifications">
       <changed-by>
       <username>root</username>
       <session-id>3</session-id>
       </changed-by>
       <datastore>running</datastore>
       <edit>
       <target xmlns:hw="urn:ietf:params:xml:ns:yang:ietf-hardware">/hw:hardware/hw:component[hw:name='chassis-fan0']/hw:alias</target>
       <operation>replace</operation>
       </edit>
       </netconf-config-change>
      </notification>
      2021-11-11T11:26:17,018 | TRACE | nioEventLoopGroupCloseable-3-4 | AbstractCodecFactory | 394 - org.opendaylight.yangtools.yang-data-util - 6.0.6 | - | Type BaseStringType{name=(urn:ietf:params:xml:ns:yang:1)string, status=CURRENT, patterns=[]} miss simple org.opendaylight.yangtools.yang.data.codec.xml.QuotedXmlCodec@45d9f6d3
      2021-11-11T11:26:17,018 | TRACE | nioEventLoopGroupCloseable-3-4 | AbstractCodecFactory | 394 - org.opendaylight.yangtools.yang-data-util - 6.0.6 | - | Type DerivedUint32Type{baseType=BaseUint32Type{name=(urn:ietf:params:xml:ns:yang:1)uint32, status=CURRENT, range=org.opendaylight.yangtools.yang.model.util.type.ResolvedRangeConstraint@d93dec}, description=NETCONF Session Id or Zero to indicate none, path=AbsoluteSchemaPath{path=[(urn:ietf:params:xml:ns:netconf:base:1.0?revision=2013-09-29)session-id-or-zero-type]}, status=CURRENT} miss simple org.opendaylight.yangtools.yang.data.codec.xml.NumberXmlCodec@3e195c43
      2021-11-11T11:26:17,018 | TRACE | nioEventLoopGroupCloseable-3-4 | AbstractCodecFactory | 394 - org.opendaylight.yangtools.yang-data-util - 6.0.6 | - | Type DerivedEnumerationType{baseType=BaseEnumerationType{name=(urn:ietf:params:xml:ns:yang:ietf-netconf-notifications?revision=2012-02-06)enumeration, status=CURRENT, values=[EnumPairImpl{name=running, value=0}, EnumPairImpl{name=startup, value=1}]}, default=running, description=Indicates which configuration datastore has changed., path=AbsoluteSchemaPath{path=[(urn:ietf:params:xml:ns:yang:ietf-netconf-notifications?revision=2012-02-06)netconf-config-change, (urn:ietf:params:xml:ns:yang:ietf-netconf-notifications?revision=2012-02-06)datastore]}, status=CURRENT} miss simple org.opendaylight.yangtools.yang.data.codec.xml.QuotedXmlCodec@5185e3d2
      2021-11-11T11:26:17,018 | TRACE | nioEventLoopGroupCloseable-3-4 | AbstractCodecFactory | 394 - org.opendaylight.yangtools.yang-data-util - 6.0.6 | - | Type BaseInstanceIdentifierType{name=(urn:ietf:params:xml:ns:yang:1)instance-identifier, status=CURRENT, requireInstance=false} miss simple org.opendaylight.yangtools.yang.data.codec.xml.XmlStringInstanceIdentifierCodec@64340942
      2021-11-11T11:26:17,019 | TRACE | nioEventLoopGroupCloseable-3-4 | AbstractCodecFactory | 394 - org.opendaylight.yangtools.yang-data-util - 6.0.6 | - | Type BaseStringType{name=(urn:ietf:params:xml:ns:yang:1)string, status=CURRENT, patterns=[]} hit simple org.opendaylight.yangtools.yang.data.codec.xml.QuotedXmlCodec@45d9f6d3
      2021-11-11T11:26:17,019 | TRACE | nioEventLoopGroupCloseable-3-4 | AbstractCodecFactory | 394 - org.opendaylight.yangtools.yang-data-util - 6.0.6 | - | Type DerivedEnumerationType{baseType=BaseEnumerationType{name=(urn:ietf:params:xml:ns:netconf:base:1.0?revision=2013-09-29)enumeration, status=CURRENT, values=[EnumPairImpl{name=merge, value=0}, EnumPairImpl{name=replace, value=1}, EnumPairImpl{name=create, value=2}, EnumPairImpl{name=delete, value=3}, EnumPairImpl{name=remove, value=4}]}, default=merge, description=NETCONF 'operation' attribute values, path=AbsoluteSchemaPath{path=[(urn:ietf:params:xml:ns:netconf:base:1.0?revision=2013-09-29)edit-operation-type]}, reference=RFC 6241, Section 7.2, status=CURRENT} miss simple org.opendaylight.yangtools.yang.data.codec.xml.QuotedXmlCodec@6ed10479
      2021-11-11T11:26:17,019 | TRACE | nioEventLoopGroupCloseable-3-4 | LeafInterner | 394 - org.opendaylight.yangtools.yang-data-util - 6.0.6 | - | Interned object ImmutableLeafNode{identifier=(urn:ietf:params:xml:ns:yang:ietf-netconf-notifications?revision=2012-02-06)datastore, value=running} to ImmutableLeafNode{identifier=(urn:ietf:params:xml:ns:yang:ietf-netconf-notifications?revision=2012-02-06)datastore, value=running}
      2021-11-11T11:26:17,019 | TRACE | nioEventLoopGroupCloseable-3-4 | LeafInterner | 394 - org.opendaylight.yangtools.yang-data-util - 6.0.6 | - | Interned object ImmutableLeafNode{identifier=(urn:ietf:params:xml:ns:yang:ietf-netconf-notifications?revision=2012-02-06)operation, value=replace} to ImmutableLeafNode{identifier=(urn:ietf:params:xml:ns:yang:ietf-netconf-notifications?revision=2012-02-06)operation, value=replace}
      2021-11-11T11:26:17,020 | DEBUG | nioEventLoopGroupCloseable-3-4 | NotificationHandler | 358 - org.opendaylight.netconf.sal-netconf-connector - 1.13.2 | - | RemoteDevice{NTS_FUNCTION_TYPE_O_RAN_FH-0-830}: Forwarding notification org.opendaylight.netconf.sal.connect.netconf.schema.mapping.NetconfMessageTransformer$NetconfDeviceNotification@1adea6a4
      2021-11-11T11:26:17,020 | INFO | nioEventLoopGroupCloseable-3-4 | ORanChangeNotificationListener | 219 - org.onap.ccsdk.features.sdnr.wt.sdnr-wt-devicemanager-o-ran-sc-oran-provider - 1.3.0.SNAPSHOT | - | onNetconfConfigChange (1) NetconfConfigChange{changedBy=ChangedBy{serverOrUser=ByUser{sessionId=SessionIdOrZeroType{_value=3}, username=root, augmentation=[]}, augmentation=[]}, datastore=Running, edit=[Edit{operation=Replace, augmentation=[]}], augmentation=[]}
      2021-11-11T11:26:17,020 | INFO | nioEventLoopGroupCloseable-3-4 | ORanChangeNotificationListener | 219 - org.onap.ccsdk.features.sdnr.wt.sdnr-wt-devicemanager-o-ran-sc-oran-provider - 1.3.0.SNAPSHOT | - | Edit list size is 1
      2021-11-11T11:26:17,020 | INFO | nioEventLoopGroupCloseable-3-4 | ORanChangeNotificationListener | 219 - org.onap.ccsdk.features.sdnr.wt.sdnr-wt-devicemanager-o-ran-sc-oran-provider - 1.3.0.SNAPSHOT | - | onNetconfConfigChange (2) Edit{operation=Replace, augmentation=[]}
      

       In the case of "instance-identifier", the message reported is -

      2021-11-11T11:26:17,018 | TRACE | nioEventLoopGroupCloseable-3-4 | AbstractCodecFactory | 394 - org.opendaylight.yangtools.yang-data-util - 6.0.6 | - | Type BaseInstanceIdentifierType{name=(urn:ietf:params:xml:ns:yang:1)instance-identifier, status=CURRENT, requireInstance=false} miss simple org.opendaylight.yangtools.yang.data.codec.xml.XmlStringInstanceIdentifierCodec@64340942

       The last 3 lines are debug messages from the ORAN devicemanager where we do the following -

       

      log.info("onNetconfConfigChange (1) {}", notification.toString());
      StringBuffer sb = new StringBuffer();
      List<Edit> editList = notification.nonnullEdit();
      log.info("Edit list size is {}", editList.size());
      for (Edit edit : editList) {
       if (sb.length() > 0) {
         sb.append(", ");
       }
       sb.append(edit);
       InstanceIdentifier<?> target = edit.getTarget();
       if (target != null) {
         log.info("TARGET: {} {}", target.getClass(), target.getTargetType());
         for (PathArgument pa : target.getPathArguments()) {
           log.info("PathArgument {} Type {}", pa, pa.getType().getFields());
         }
         // Write to database
       }
      }
      log.info("onNetconfConfigChange (2) {}", sb);
      

       

      I am not certain if it is already resolved in the later versions.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              Unassigned Unassigned
              pendurty Ravi Pendurty
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: