cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
3793
Views
0
Helpful
2
Replies

NETCONF get-config error - Wrong document: namespaces not specified

sosul
Level 1
Level 1

I have a problem with NETCONF get-config operation to Nexus 7000 with OS version 7.3(1)D1(1).

 

Sent message has xmlns attribute in rpc tag.

<?xml version="1.0" encoding="utf-8"?>
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="5">
  <get-config>
    <source>
      <running/>
    </source>
  </get-config>
</rpc>

However, the result says that rpc is a bad element for missing namespaces attribute.

<?xml version="1.0" encoding="utf-8"?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="5">
  <rpc-error>
    <error-type>rpc</error-type>
    <error-tag>missing-attribute</error-tag>
    <error-severity>error</error-severity>
    <error-message>Wrong document: namespaces not specified</error-message>
    <error-info>
      <bad-element>rpc</bad-element>
    </error-info>
  </rpc-error>
</rpc-reply>

In comparison, my get-config query has no problem with ASR 9000, IOS XR 6.1.4.

<?xml version="1.0" encoding="utf-8"?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="5">
  <data>
...

How can I walk around this error?

2 Replies 2

sosul
Level 1
Level 1

Answering to my own question.

Unlike other devices, NX-OS requires two xmlns's as attribute of rpc element, one for netconf base and the other for Cisco data store.

 

RPC message below got a response without errors. (However the result is not as what I expect. I'm going to post another question regarding it.) "urib" can be any other subtree defined by Cisco NX-OS.

 

<nf:get-config
    xmlns:nf="urn:ietf:params:xml:ns:netconf:base:1.0"
    xmlns="http://www.cisco.com/nxos:7.3.1.D1.1.:urib">
    <nf:source>
        <nf:running/>
    </nf:source>
</nf:get-config>

I could make get-config RPC work in this way. "urib" can be replaced by any other defined subtree.

<nf:get-config
    xmlns:nf="urn:ietf:params:xml:ns:netconf:base:1.0"
    xmlns="http://www.cisco.com/nxos:7.3.1.D1.1.:urib">
  <nf:source>
    <nf:running/>
  </nf:source>
</nf:get-config>
However it lead me another issue that the result is in form of CLI commands, not XML-structured. So I asked to Cisco about it as this.

Result from NX-OS:

<?xml version="1.0" encoding="utf-8"?>
<data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"
    xmlns:pfx1="http://www.cisco.com/nxos:7.3.1.D1.1.:urib"
    xmlns:nf="urn:ietf:params:xml:ns:netconf:base:1.0">!Command: show running-config
!Time: Tue Jan 16 18:00:27 2018

version 7.3(1)D1(1)
hostname MASKED_FOR_ANONYMITY

feature telnet
feature ospf
......
xml server max-session 6
xml server validate all</data>
Result from IOS-XR:

<?xml version="1.0" encoding="utf-8"?>
<data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <aaa xmlns="http://cisco.com/ns/yang/Cisco-IOS-XR-aaa-locald-admin-cfg">
    <usernames>
      <username>
......
</data>

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: