netopeer2 icon indicating copy to clipboard operation
netopeer2 copied to clipboard

Not able to connect to NE with openroadm-models

Open preetbhansali opened this issue 5 months ago • 15 comments

Hi

I have a netconf server running openroadm models version 13.1.1, I am getting below error while making a connection.

ly ERROR: Not found node "key-chain-list" in path. (/org-openroadm-device:org-openroadm-device/org-openroadm-routing:routing/routing-instance/routing-protocols/routing-protocol/org-openroadm-ospf:ospf/instance/area/virtual-link/authentication/auth-type-selection/auth-trailer-key-chain/key-chain)
nc DEBUG: Sending message:

Netopeer-cli version: netopeer2-cli 2.0.79

Openroadm Model used: https://github.com/OpenROADM/OpenROADM_MSA_Public/blob/13.1.1/model/Device/tree-view-device.txt https://github.com/OpenROADM/OpenROADM_MSA_Public/blob/13.1.1/model/Common/tree-view-common.txt

preetbhansali avatar Jul 23 '25 05:07 preetbhansali

From the tree views you linked:

     |     |              |  +--rw org-openroadm-ospf:authentication
     |     |              |     +--rw (org-openroadm-ospf:auth-type-selection)?
     |     |              |        +--:(org-openroadm-ospf:auth-ipsec) {ospfv3-authentication-ipsec}?
     |     |              |        |  +--rw org-openroadm-ospf:sa?          string
     |     |              |        +--:(org-openroadm-ospf:auth-trailer-key-chain)
     |     |              |        |  +--rw org-openroadm-ospf:key-chain?   org-openroadm-key-chain:key-chain-ref
     |     |              |        +--:(org-openroadm-ospf:auth-trailer-key)
     |     |              |           +--rw org-openroadm-ospf:key?         string

I do not see any key-chain-list node so I do not understand what is not clear about the error.

michalvasko avatar Jul 23 '25 06:07 michalvasko

Elements are defined as below, type of +--rw org-openroadm-ospf:key-chain? should have been string

        case auth-trailer-key-chain {
          leaf key-chain {
            type org-openroadm-key-chain:key-chain-ref;
            description
              "key-chain name";
          }
        }
  typedef key-chain-ref {
    type leafref {
      path "/org-openroadm-key-chain:key-chains/key-chain-list/org-openroadm-key-chain:name";
    }
    description
      "This type is used by data models that need to reference
       configured key-chains.";
  }
  container key-chains {
    description
      "All configured key-chains for the device.";
    list key-chain-list {
      key "name";
      description
        "List of key-chains.";
      uses key-chain;
    }
  }
  grouping key-chain {
    description
      "key-chain specification grouping.";
    leaf name {
      type string;
      description
        "Name of the key-chain.";
    }

preetbhansali avatar Jul 23 '25 06:07 preetbhansali

It seems you are mixing YANG subtrees. In the error there is no key-chains node, it is in some other YANG path than the one you are trying to create. You need to fix your YANG data, I cannot help you.

michalvasko avatar Jul 23 '25 06:07 michalvasko

I am getting the error while making the connection, it seems, while building the schema as received in "netconf-monitoring" some issue with the ordering.

I am not doing any get/set request.

typedef is defined in org-openroadm-key-chain.yang

we are refereeing it from org-openroadm-ospf.yang

preetbhansali avatar Jul 23 '25 06:07 preetbhansali

I see, then it may be a mixup of available YANG modules. I suggest you enable verbose output of netopeer2-cli before connecting and then try to connect. It should print exact information about the YANG modules it is loading and you should be able to find the problem then.

michalvasko avatar Jul 23 '25 06:07 michalvasko

I have shared the Verbose logs only, where i found that based on the yangs available in monitoring yang, netopeer-cli is fetching the yang via get-schema and failing there. Which is cause close-session as well. So I am not able to debug anything further

preetbhansali avatar Jul 24 '25 05:07 preetbhansali

Please provide the output, of the commands verb verbose and then connect. It does not matter the connection is not successful.

michalvasko avatar Jul 25 '25 07:07 michalvasko

connectVerboseLog.log

I have attached the requested logs

preetbhansali avatar Jul 30 '25 09:07 preetbhansali

I see, thanks. So it seems you are not connecting to netopeer2-server and based on the output I would say the YANG modules really are not valid but whatever server you are connecting to does not check that.

michalvasko avatar Jul 30 '25 09:07 michalvasko

You are right that we are not using netopeer2-server, But I don't understand why are you saying that yang modules are not valid? I am considering published and stable yang models from below:

https://github.com/OpenROADM/OpenROADM_MSA_Public/tree/13.1.1/model/Common https://github.com/OpenROADM/OpenROADM_MSA_Public/tree/13.1.1/model/Device

preetbhansali avatar Jul 31 '25 04:07 preetbhansali

The error is correct, the YANG modules are not valid the way they are used. This typedef path should be

"/org-openroadm-key-chain:key-chains/org-openroadm-key-chain:key-chain-list/org-openroadm-key-chain:name";

michalvasko avatar Jul 31 '25 06:07 michalvasko

Although it is partially present, but isn't prefix a optional for the top-level node in the same module.

preetbhansali avatar Jul 31 '25 07:07 preetbhansali

Yes, the nodes without prefix are resolved to the prefix of the leafref leaf in this case, which is the wrong one (RFC ref).

michalvasko avatar Jul 31 '25 08:07 michalvasko

I don't see any pyang --lint error

onc-pbhansal-1|</yang$ pyang --lint org-openroadm-ospf.yang -p . org-openroadm-ospf.yang:50: error: RFC 8407: 4.8: statement "revision" must have a "reference" substatement org-openroadm-ospf.yang:54: error: RFC 8407: 4.8: statement "revision" must have a "reference" substatement org-openroadm-ospf.yang:58: error: RFC 8407: 4.8: statement "revision" must have a "reference" substatement org-openroadm-ospf.yang:62: error: RFC 8407: 4.8: statement "revision" must have a "reference" substatement org-openroadm-ospf.yang:66: error: RFC 8407: 4.8: statement "revision" must have a "reference" substatement org-openroadm-ospf.yang:70: error: RFC 8407: 4.8: statement "revision" must have a "reference" substatement org-openroadm-ospf.yang:74: error: RFC 8407: 4.8: statement "revision" must have a "reference" substatement org-openroadm-ospf.yang:78: error: RFC 8407: 4.8: statement "revision" must have a "reference" substatement org-openroadm-ospf.yang:82: error: RFC 8407: 4.8: statement "revision" must have a "reference" substatement org-openroadm-ospf.yang:86: error: RFC 8407: 4.8: statement "revision" must have a "reference" substatement org-openroadm-ospf.yang:90: error: RFC 8407: 4.8: statement "revision" must have a "reference" substatement org-openroadm-ospf.yang:94: error: RFC 8407: 4.8: statement "revision" must have a "reference" substatement org-openroadm-ospf.yang:98: error: RFC 8407: 4.8: statement "revision" must have a "reference" substatement org-openroadm-ospf.yang:102: error: RFC 8407: 4.8: statement "revision" must have a "reference" substatement org-openroadm-ospf.yang:106: error: RFC 8407: 4.8: statement "revision" must have a "reference" substatement org-openroadm-ospf.yang:110: error: RFC 8407: 4.8: statement "revision" must have a "reference" substatement org-openroadm-ospf.yang:114: error: RFC 8407: 4.8: statement "revision" must have a "reference" substatement org-openroadm-ospf.yang:118: error: RFC 8407: 4.8: statement "revision" must have a "reference" substatement org-openroadm-ospf.yang:122: error: RFC 8407: 4.8: statement "revision" must have a "reference" substatement org-openroadm-ospf.yang:126: error: RFC 8407: 4.8: statement "revision" must have a "reference" substatement onc-pbhansal-1|</yang$ pyang --lint org-openroadm-key-chain.yang -p . org-openroadm-key-chain.yang:34: error: RFC 8407: 4.8: statement "revision" must have a "reference" substatement org-openroadm-key-chain.yang:38: error: RFC 8407: 4.8: statement "revision" must have a "reference" substatement org-openroadm-key-chain.yang:42: error: RFC 8407: 4.8: statement "revision" must have a "reference" substatement

preetbhansali avatar Jul 31 '25 15:07 preetbhansali

Then pyang is not checking this or it is not checking it properly. I can walk you through the RFC to prove what I wrote is true and correct.

michalvasko avatar Aug 01 '25 05:08 michalvasko