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

Found empty data tag, meaning requested data are not found on Netconf server

MahdiR
Level 1
Level 1

 

Trying to retrieve information from an interface gives me the following error:

Found empty data tag, meaning requested data are not found on Netconf server

I know that the information exists in the box, but it seems like Netconf cannot see the data!

I've read the logger output but still doesn't know what is wrong. Will appreciate any help.

I've attached the output from the logger.

 

Here is my code:

import logging
import ydk.models.ietf.ietf_interfaces as ietf_ifc
from ydk.services.netconf_service import NetconfService, Datastore
from ydk.providers.netconf_provider import NetconfServiceProvider

def enable_logging(level):
    log = logging.getLogger('ydk')
    log.setLevel(level)
    handler = logging.StreamHandler()
    formatter = logging.Formatter(
        "%(asctime)s - %(name)s - %(levelname)s - %(message)s")
    handler.setFormatter(formatter)
    log.addHandler(handler)


if __name__ == "__main__":
    enable_logging(logging.DEBUG)

    service = NetconfService()
    provider = NetconfServiceProvider(address=address,
                                      username=username,
                                      password=password,
                                      port=830)

    model = ietf_ifc.InterfacesState()

    ifc = ietf_ifc.InterfacesState.Interface()
    ifc.name = "TenGigabitEthernet1/3"
    model.interface.append(ifc)

    result = service.get(provider, model)
    print(result)

 

 

1 Accepted Solution

Accepted Solutions

yangorelik
Spotlight
Spotlight

Hi Mahdi

Indeed your request did not return any data and therefore the INFO message:

2020-11-12 07:45:33,174 - ydk - INFO - ============= Received RPC from device =============
<?xml version="1.0" encoding="UTF-8"?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1">
<data/>
</rpc-reply>
2020-11-12 07:45:33,174 - ydk - INFO - Found empty data tag, meaning requested data are not found on Netconf server
None

Most likely the interface name is incorrect or the interface is not configured. Get all interfaces by dropping specific one in the object building, then run your script with the matching specific interface name. If you still get the empty data tag, consult device software engineers.

 

Yan Gorelik
YDK Solutions

View solution in original post

2 Replies 2

yangorelik
Spotlight
Spotlight

Hi Mahdi

Indeed your request did not return any data and therefore the INFO message:

2020-11-12 07:45:33,174 - ydk - INFO - ============= Received RPC from device =============
<?xml version="1.0" encoding="UTF-8"?>
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1">
<data/>
</rpc-reply>
2020-11-12 07:45:33,174 - ydk - INFO - Found empty data tag, meaning requested data are not found on Netconf server
None

Most likely the interface name is incorrect or the interface is not configured. Get all interfaces by dropping specific one in the object building, then run your script with the matching specific interface name. If you still get the empty data tag, consult device software engineers.

 

Yan Gorelik
YDK Solutions

Removing the filter yields the same result!

Might be something wrong with Netconf configuration on the device as you suggest.

Thanks for the help