CESNET / netopeer2

NETCONF toolset
BSD 3-Clause "New" or "Revised" License
290 stars 186 forks source link

Unknown element #1598

Closed MaFe1401 closed 2 days ago

MaFe1401 commented 3 days ago

Hi,

Why am I getting this error in netopeer-cli?

> edit-config --target running --config=qbv_config_1.xml
ERROR
    type:     application
    tag:      unknown-element
    severity: error
    message:  Node "gate-parameter-table" not found as a child of "bridge-port" node.
    info:
<bad-element xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">gate-parameter-table</bad-element>

bridge-port is declared at ieee802-dot1q-bridge.yang, while gate-parameter-table is a container found at an augment statement in ieee802-dot1q-sched.yang, and both seem to be correctly installed:

Module Name                   | Revision   | Flags | Owner     | Startup Perms | Submodules | Features                                                                                
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
iana-crypt-hash               | 2014-08-06 | i     |           |               |            |                                                                                        
iana-if-type                  | 2017-01-19 | I     | root:root | 600           |            |                                                                                        
ieee802-dot1q-bridge          | 2021-04-09 | I     | root:root | 600           |            |                                                                                        
ieee802-dot1q-sched           | 2021-04-09 | I     | root:root | 600           |            |                                                                                        
ieee802-dot1q-types           | 2023-08-29 | I     | root:root | 600           |            |                                                                                        
ieee802-types                 | 2020-10-23 | I     | root:root | 600           |            |                                                                                        
ietf-crypto-types             | 2019-07-02 | i     |           |               |            |                                                                                        
ietf-datastores               | 2018-02-14 | I     | root:root | 666           |            |                                                                                        
ietf-inet-types               | 2013-07-15 | i     |           |               |            |                                                                                        
ietf-interfaces               | 2018-02-20 | I     | root:root | 600           |            |                                                                                        
ietf-ip                       | 2018-02-22 | I     | root:root | 600           |            |                                                                                        
ietf-keystore                 | 2019-07-02 | I     | root:root | 600           |            | keystore-supported                                                                      
ietf-netconf                  | 2013-09-29 | I     | root:root | 600           |            | writable-running candidate confirmed-commit rollback-on-error validate startup url xpath
ietf-netconf-acm              | 2018-02-14 | I     | root:root | 666           |            |                                                                                        
ietf-netconf-monitoring       | 2010-10-04 | I     | root:root | 600           |            |                                                                                        
ietf-netconf-nmda             | 2019-01-07 | I     | root:root | 600           |            | origin with-defaults                                                                    
ietf-netconf-notifications    | 2012-02-06 | I     | root:root | 666           |            |                                                                                        
ietf-netconf-server           | 2019-07-02 | I     | root:root | 600           |            | ssh-listen tls-listen ssh-call-home tls-call-home                                      
ietf-netconf-with-defaults    | 2011-06-01 | I     | root:root | 666           |            |                                                                                        
ietf-network-instance         | 2019-01-21 | I     | root:root | 600           |            |                                                                                        
ietf-origin                   | 2018-02-14 | I     | root:root | 666           |            |                                                                                        
ietf-restconf                 | 2017-01-26 | i     |           |               |            |                                                                                        
ietf-ssh-common               | 2019-07-02 | i     |           |               |            |                                                                                        
ietf-ssh-server               | 2019-07-02 | I     | root:root | 600           |            | local-client-auth-supported                                                            
ietf-subscribed-notifications | 2019-09-09 | I     | root:root | 600           |            | encode-xml replay subtree xpath                                                        
ietf-tcp-client               | 2019-07-02 | i     |           |               |            |                                                                                        
ietf-tcp-common               | 2019-07-02 | I     | root:root | 600           |            | keepalives-supported                                                                    
ietf-tcp-server               | 2019-07-02 | i     |           |               |            |                                                                                        
ietf-tls-common               | 2019-07-02 | i     |           |               |            |                                                                                        
ietf-tls-server               | 2019-07-02 | I     | root:root | 600           |            | local-client-auth-supported                                                            
ietf-truststore               | 2019-07-02 | I     | root:root | 600           |            | truststore-supported x509-certificates                                                  
ietf-x509-cert-to-name        | 2014-12-10 | I     | root:root | 600           |            |                                                                                        
ietf-yang-library             | 2019-01-04 | I     | root:root | 666           |            |                                                                                        
ietf-yang-metadata            | 2016-08-05 | i     |           |               |            |                                                                                        
ietf-yang-patch               | 2017-02-22 | i     |           |               |            |                                                                                        
ietf-yang-push                | 2019-09-09 | I     | root:root | 600           |            | on-change                                                                              
ietf-yang-schema-mount        | 2019-01-14 | I     | root:root | 666           |            |                                                                                        
ietf-yang-structure-ext       | 2020-06-17 | i     |           |               |            |                                                                                        
ietf-yang-types               | 2013-07-15 | i     |           |               |            |                                                                                        
nc-notifications              | 2008-07-14 | I     | root:root | 600           |            |                                                                                        
notifications                 | 2008-07-14 | I     | root:root | 600           |            |                                                                                        
sysrepo-monitoring            | 2022-08-19 | I     | root:root | 666           |            |                                                                                        
sysrepo-plugind               | 2022-08-26 | I     | root:root | 666           |            |                                                                                        
yang                          | 2022-06-16 | I     | root:root | 666           |            |                                                                      

The xml that I am sending is as follows:


<interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces">
  <interface>
    <name>PORT_1</name>
    <type xmlns:ianaift="urn:ietf:params:xml:ns:yang:iana-if-type">ianaift:ethernetCsmacd</type>
    <bridge-port xmlns="urn:ieee:std:802.1Q:yang:ieee802-dot1q-bridge">
      <gate-parameter-table xmlns="urn:ieee:std:802.1Q:yang:ieee802-dot1q-sched">
        <gate-enabled>true</gate-enabled>
        <admin-gate-states>255</admin-gate-states>
        <admin-control-list>
          <gate-control-entry>
            <index>0</index>
            <operation-name>set-gate-states</operation-name>
            <time-interval-value>500000</time-interval-value>
            <gate-states-value>255</gate-states-value>
          </gate-control-entry>
          <gate-control-entry>
            <index>1</index>
            <operation-name>set-gate-states</operation-name>
            <time-interval-value>500000</time-interval-value>
            <gate-states-value>188</gate-states-value>
          </gate-control-entry>
        </admin-control-list>
        <admin-cycle-time>
          <numerator>1000000</numerator>
          <denominator>1000000000</denominator>
        </admin-cycle-time>
        <admin-cycle-time-extension>8</admin-cycle-time-extension>
        <admin-base-time>
          <seconds>0</seconds>
          <nanoseconds>0</nanoseconds>
        </admin-base-time>
        <config-change>true</config-change>
      </gate-parameter-table>
    </bridge-port>
  </interface>
</interfaces>
``
michalvasko commented 3 days ago

Is gate-parameter-table pehaps in a grouping? Those nodes inherit the namespace of the parent so try removing its namespace in the XML data.

MaFe1401 commented 2 days ago

Hi @michalvasko , no it isn't. Same error when removing the namespace.

michalvasko commented 2 days ago

Is there perhaps an if-feature statement with a disabled feature? I can only guess unless you attach the relevant YANG modules.

MaFe1401 commented 2 days ago

That was the problem! Thank you @michalvasko. Didn't know about if-features, kind of a beginner in the Netconf / YANG world, but finally made it work. Cheers! imagen