cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
5804
Views
15
Helpful
22
Replies

YDK issues Lab 10.8 DEVASC ELearning Training Use Cisco SDK and Python for Automation Scripting

Luis Perez
Level 1
Level 1

Problems executing python script in this specific lab of DEVASC training course, when you instantiate CRUDService() it fails with messages: "TypeError: ydk_.services.CRUDService.__init__() must be called when overriding __init__"  

 

Ive tried to make changes inside of the crud_service, executor_service and netconf_service python files as mentioned here https://github.com/ygorelik/ydk-gen/commit/2c53f5dc736d73064c03dc1c404982d1c9011d64 actually the previous issue dissapear but now is showing issus related with the read method of the CRUDService object. 

 

The python script executed is attached.

 

Someone knows which steps we have to take in account to make this script suscessfully work?

 

 

22 Replies 22

sclake
Cisco Employee
Cisco Employee

Any ideas on the above issue Yan? 

This doesn't sound like a WSL-related error.

Thanks.  Scott.

Hi Scott

I have tested the latest YDK on WSL Ubuntu-18.04 and 20.04. I was using Ubuntu images from Microsoft Store. In both installations the YDK worked fine. I tested them on CiscoDevNet XR and XE sandboxes and did not find any issues. I would assume that there are some issues with your script (installation looks fine to me). Could you please share the script for further troubleshooting. 

Yan Gorelik
YDK Solutions

Hi Yan,

So the script is copied verbatim out of the ydk-samples repo but regardless, i ran it against the XE Sandbox from my Ubuntu 20.04 on WSL2 and it worked fine.  For some reason the Autopods are locked out tonight so when they come back online, i will test against a few other systems and see if i can replicate my success.  At least we have a reference case now.  I'll let you know what happens.

Thanks for getting back to me on this.  It is important!

Best,

Scott.

Hi Yan.

 

Ok so i tried to run the exact same script against some physical iosxe systems and pretty much got 3 different error responses.  I have attached the session log which shows the execution of the python command against the physical systems along with the same command pointed towards the sandbox.  I also included the sh ver and show netconf-yang status command output. I also executed an ssh to port 830 and it was successful each time responding with the capabilities from each of the 3 phy systems.

 

None of the error conditions triggered on not finding the ios-xe ydk model, which is the last error i left off with.

 

BTW, the script is in this thread and like I mentioned previously, downloaded and not modified from the ydk-samples repo.

 

Thanks much for your continued help on this!!

 

Scott.

Hi Scott

I have executed the script now in WSL Ubuntu-20.04 and it worked for me just fine. As the device I used CiscoDevNet sandbox 'developer:C1sco12345@ios-xe-mgmt.cisco.com:10000'.

For further troubleshooting could you please add the following piece of code to enable debug level logging:

import logging

logger = logging.getLogger("ydk")
logger.setLevel(logging.DEBUG)
handler = logging.StreamHandler()
formatter = logging.Formatter(("%(asctime)s - %(name)s - %(levelname)s - %(message)s"))
handler.setFormatter(formatter)
logger.addHandler(handler)

 

I am mostly interested in Segmentation fault error, which appears when polling device 10.62.149.175.

Yan Gorelik
YDK Solutions

Hi Scott

I've just reproduced that error when I tried to run the script against XR device. Obviously, it does not have that path!

Yan Gorelik
YDK Solutions

Yan, 

So I wanted to clarify something here.  My understanding is that docker for windows is dependent on the linux installation in WSL2.  Thus, when you say YDK is not supported on docker for windows, this implies that it is also not supported under WSL2 (however, some engineers have had success installing and running ydk it under ubuntu 18.04).  Just for my own understanding, why is the ydk library and other supporting functions so dependent on linux in a vm when it seems that MSFT is offering WSL2 is a solution that is directly comparable to a linux vm, like-for-like.  Are we saying that wsl2 is not a qualified linux virtualization solution because they have not replicated the linux kernel functionality as well as vmware/vagrant?  Personally, I am tied to windows 10 for the foreseeable future and the docker/wsl2 solution is by far less resource intensive on my laptop than running a vm, so i'm extremely interested in pursuing the docker-over-wsl2 method of supporting my development activities.

Scott.

Hi Scott

What I meant is that YDK has never been certified on WSL2 platform. If you could make it work, great! Please share the details of YDK installation with community. I am sure, it will be greatly appreciated by multiple YDK users.

Yan Gorelik
YDK Solutions