11-11-2020 11:58 PM
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)
Solved! Go to Solution.
11-12-2020 07:08 AM
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.
11-12-2020 07:08 AM
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.
11-12-2020 11:11 PM
Removing the filter yields the same result!
Might be something wrong with Netconf configuration on the device as you suggest.
Thanks for the help
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide