cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
775
Views
0
Helpful
3
Replies

ERROR - CapabilityRequest failed with error

Xi Zhang
Cisco Employee
Cisco Employee

I am trying to test ydk(0.8.3) gnmi function with iosxr 6.5.1. Just executing the gnmi/samples/hello_ydk_gnmi.py but got following error response.

 

[root@localhost ~]# python hello_ydk_gnmi.py -v ssh://cisco:1qaz@WSX@10.124.209.91:57344 /root/ydk/10.124.209.91_830


2019-07-16 20:43:56,876 - ydk - ERROR - CapabilityRequest failed with error:
Socket closed
Traceback (most recent call last):
File "hello_ydk_gnmi.py", line 48, in <module>
password=device.password)
File "/root/virtualenv-rasta/lib64/python3.6/site-packages/ydk/gnmi/providers/gnmi_provider.py", line 40, in __init__
server_certificate, private_key)
RuntimeError: YServiceProviderError: CapabilityRequest failed with error:
Socket closed

 

I have verify the device gnmi function with opencconfig gnmi_client. It works fine.

 

Show Version:

 

RP/0/RP0/CPU0:r1#show version
Wed Jul 17 11:23:47.593 CST
Cisco IOS XR Software, Version 6.5.1
Copyright (c) 2013-2018 by Cisco Systems, Inc.

Build Information:
Built By : ahoang
Built On : Wed Aug 8 17:29:38 PDT 2018
Built Host : iox-ucs-019
Workspace : /auto/srcarchive17/prod/6.5.1/xrv9k/ws
Version : 6.5.1
Location : /opt/cisco/XR/packages/

cisco IOS-XRv 9000 () processor
System uptime is 3 weeks 4 days 17 hours 31 minutes

1 Accepted Solution

Accepted Solutions

Xi Zhang
Cisco Employee
Cisco Employee
missed "no-tls" command under grpc configuration on device.

RP/0/RP0/CPU0:r1#show run grpc
Wed Jul 17 16:30:17.745 CST
grpc
port 57344
no-tls
!

View solution in original post

3 Replies 3

Xi Zhang
Cisco Employee
Cisco Employee
missed "no-tls" command under grpc configuration on device.

RP/0/RP0/CPU0:r1#show run grpc
Wed Jul 17 16:30:17.745 CST
grpc
port 57344
no-tls
!

ygorelik
Cisco Employee
Cisco Employee

Hello Xi Zhang

 

Your password contains control character '@', therefore it should be taken in single quotes. The script executed from my space with YDK-0.8.3:

 

# python hello_ydk_gnmi.py -v ssh://cisco:'1qaz@WSX'@10.124.209.91:57344 /home/ygorelik/.ydk/10.124.209.91

2019-07-17 00:51:39,578 - ydk - INFO - gNMIServiceProvider Connected to 10.124.209.91 via Insecure Channel
2019-07-17 00:51:39,579 - ydk - INFO - Executing CRUD read operation on [Cisco-IOS-XR-shellutil-oper:system-time]
2019-07-17 00:51:39,580 - ydk - INFO -
=============== Get Request Sent ================
path {
origin: "Cisco-IOS-XR-shellutil-oper"
elem {
name: "system-time"
}
}
encoding: JSON_IETF


2019-07-17 00:51:39,775 - ydk - INFO -
============= Get Response Received =============
notification {
timestamp: 1563378607154796089
update {
path {
origin: "Cisco-IOS-XR-shellutil-oper"
elem {
name: "system-time"
}
}
val {
json_ietf_val: "{\"clock\":{\"year\":2019,\"month\":7,\"day\":17,\"hour\":23,\"minute\":50,\"second\":7,\"millisecond\":143,\"wday\":3,\"time-zone\":\"CST\",\"time-source\":\"ntp\"},\"uptime\":{\"host-name\":\"r1\",\"uptime\":2267896}}"
}
}
}
error {
}


2019-07-17 00:51:39,775 - ydk - INFO - Get Operation Succeeded
System 'r1' uptime is 26 days, 5:58:16
2019-07-17 00:51:39,779 - ydk - INFO - Disconnected from device

Hello, ygrelik

 

Thank you for your reply. I had tested even without the quotes, the password still could be recognized correctly. The root cause is one configuration ('no-tls' under grpc) missed on device.

 

thanks!