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

Not able to create_node when it is augumented from another module i get runtime erro couldn't send payload

jarulsel@cisco.com
Cisco Employee
Cisco Employee

Here is code snippet on what i am trying

>>> from ydk.path import NetconfSession
>>> from ydk.path import Codec
>>> from ydk.types import EncodingFormat
>>> session = NetconfSession('10.64.86.95', 'lab', 'lab')

>>> root = session.get_root_schema()

>>> voice = root.create_datanode("Cisco-IOS-XE-native:native" , "")

>>> gw = voice.create_datanode("ios-voice:voice/vrf", "1")      -----> ios-voice is prefix of another module which is augumented in native. The container voice and it leaf vrf are a grouping in module Cisco-IOS-XE-voice (prefix:ios-voice).
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
RuntimeError: YClientError: Could not send payload
whenever i want to create node of leafs or container which are augumented from another module it reports "RuntimeError: YClientError: Could not send payload"

while if i create node of leaf  from the same module native , then it gets created .
>>> gw = voice.create_datanode("user-name/name", "test")

Is there anything i am  need to take care to create nodes of leafs which are from another module.

1 Accepted Solution

Accepted Solutions

Thanks Abhirame for looking into this,
here is log with debug level enable

>>> gw = voice.create_datanode("ios-voice:voice/vrf", "1")
2019-04-08 16:57:23,578 - ydk - DEBUG - Populating schemas for ios-voice:voice/vrf
2019-04-08 16:57:23,578 - ydk - DEBUG - Populating schemas for ios-voice:voice/vrf
2019-04-08 16:57:23,612 - ydk - DEBUG - Looking to populate schemas for ios-voice:voice/vrf
2019-04-08 16:57:23,612 - ydk - DEBUG - Looking to populate schemas for ios-voice:voice/vrf
2019-04-08 16:57:23,613 - ydk - DEBUG - Ready to populate schemas for ios-voice:voice/vrf
2019-04-08 16:57:23,613 - ydk - DEBUG - Ready to populate schemas for ios-voice:voice/vrf
2019-04-08 16:57:23,613 - ydk - DEBUG - Getting new modules for ios-voice:voice/vrf
2019-04-08 16:57:23,613 - ydk - DEBUG - Getting new modules for ios-voice:voice/vrf
2019-04-08 16:57:23,613 - ydk - DEBUG - Getting new modules from 'ios-voice:voice/vrf'
2019-04-08 16:57:23,613 - ydk - DEBUG - Getting new modules from 'ios-voice:voice/vrf'
2019-04-08 16:57:23,615 - ydk - DEBUG - Loading module 'ios-voice', revision ''
2019-04-08 16:57:23,615 - ydk - DEBUG - Loading module 'ios-voice', revision ''
2019-04-08 16:57:23,616 - ydk - DEBUG - Getting module 'ios-voice' submodule 'none'
2019-04-08 16:57:23,616 - ydk - DEBUG - Getting module 'ios-voice' submodule 'none'
2019-04-08 16:57:23,616 - ydk - DEBUG - Looking for file in folder: /root/.ydk/10.64.86.95_830
2019-04-08 16:57:23,616 - ydk - DEBUG - Looking for file in folder: /root/.ydk/10.64.86.95_830
2019-04-08 16:57:23,617 - ydk - DEBUG - Opening file '/root/.ydk/10.64.86.95_830/ios-voice.yang'
2019-04-08 16:57:23,617 - ydk - DEBUG - Opening file '/root/.ydk/10.64.86.95_830/ios-voice.yang'
2019-04-08 16:57:23,618 - ydk - DEBUG - Path found with rev: false. Path without rev: false
2019-04-08 16:57:23,618 - ydk - DEBUG - Path found with rev: false. Path without rev: false
2019-04-08 16:57:23,619 - ydk - DEBUG - Getting module 'ios-voice' using get-schema
2019-04-08 16:57:23,619 - ydk - DEBUG - Getting module 'ios-voice' using get-schema
2019-04-08 16:57:23,622 - ydk - DEBUG - Trace: Missing message-id in rpc.
2019-04-08 16:57:23,622 - ydk - DEBUG - Trace: Missing message-id in rpc.
2019-04-08 16:57:23,624 - ydk - DEBUG - Netconf SSH Client: sending rpc
2019-04-08 16:57:23,624 - ydk - DEBUG - Netconf SSH Client: sending rpc
2019-04-08 16:57:23,624 - ydk - ERROR - Connection error occurred: Invalid session to send <rpc>.
2019-04-08 16:57:23,624 - ydk - ERROR - Connection error occurred: Invalid session to send <rpc>.
2019-04-08 16:57:23,625 - ydk - ERROR - Could not send payload <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"><get-schema xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring"><identifier>ios-voice</identifier><format>yang</format></get-schema></rpc>
2019-04-08 16:57:23,625 - ydk - ERROR - Could not send payload <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"><get-schema xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring"><identifier>ios-voice</identifier><format>yang</format></get-schema></rpc>
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
RuntimeError: YClientError: Could not send payload

I found the issue as it is checking for Module name and i was using module prefix . Once i changed ios-voice to module name which is 'Cisco-IOS-XE-voice:voice/vrf ' it is able to create the node.

Thanks for the pointer .
regards

jayaseelan

View solution in original post

2 Replies 2

abhirame
Cisco Employee
Cisco Employee

Can you please enable logging (see this) and post the logs?

Thanks Abhirame for looking into this,
here is log with debug level enable

>>> gw = voice.create_datanode("ios-voice:voice/vrf", "1")
2019-04-08 16:57:23,578 - ydk - DEBUG - Populating schemas for ios-voice:voice/vrf
2019-04-08 16:57:23,578 - ydk - DEBUG - Populating schemas for ios-voice:voice/vrf
2019-04-08 16:57:23,612 - ydk - DEBUG - Looking to populate schemas for ios-voice:voice/vrf
2019-04-08 16:57:23,612 - ydk - DEBUG - Looking to populate schemas for ios-voice:voice/vrf
2019-04-08 16:57:23,613 - ydk - DEBUG - Ready to populate schemas for ios-voice:voice/vrf
2019-04-08 16:57:23,613 - ydk - DEBUG - Ready to populate schemas for ios-voice:voice/vrf
2019-04-08 16:57:23,613 - ydk - DEBUG - Getting new modules for ios-voice:voice/vrf
2019-04-08 16:57:23,613 - ydk - DEBUG - Getting new modules for ios-voice:voice/vrf
2019-04-08 16:57:23,613 - ydk - DEBUG - Getting new modules from 'ios-voice:voice/vrf'
2019-04-08 16:57:23,613 - ydk - DEBUG - Getting new modules from 'ios-voice:voice/vrf'
2019-04-08 16:57:23,615 - ydk - DEBUG - Loading module 'ios-voice', revision ''
2019-04-08 16:57:23,615 - ydk - DEBUG - Loading module 'ios-voice', revision ''
2019-04-08 16:57:23,616 - ydk - DEBUG - Getting module 'ios-voice' submodule 'none'
2019-04-08 16:57:23,616 - ydk - DEBUG - Getting module 'ios-voice' submodule 'none'
2019-04-08 16:57:23,616 - ydk - DEBUG - Looking for file in folder: /root/.ydk/10.64.86.95_830
2019-04-08 16:57:23,616 - ydk - DEBUG - Looking for file in folder: /root/.ydk/10.64.86.95_830
2019-04-08 16:57:23,617 - ydk - DEBUG - Opening file '/root/.ydk/10.64.86.95_830/ios-voice.yang'
2019-04-08 16:57:23,617 - ydk - DEBUG - Opening file '/root/.ydk/10.64.86.95_830/ios-voice.yang'
2019-04-08 16:57:23,618 - ydk - DEBUG - Path found with rev: false. Path without rev: false
2019-04-08 16:57:23,618 - ydk - DEBUG - Path found with rev: false. Path without rev: false
2019-04-08 16:57:23,619 - ydk - DEBUG - Getting module 'ios-voice' using get-schema
2019-04-08 16:57:23,619 - ydk - DEBUG - Getting module 'ios-voice' using get-schema
2019-04-08 16:57:23,622 - ydk - DEBUG - Trace: Missing message-id in rpc.
2019-04-08 16:57:23,622 - ydk - DEBUG - Trace: Missing message-id in rpc.
2019-04-08 16:57:23,624 - ydk - DEBUG - Netconf SSH Client: sending rpc
2019-04-08 16:57:23,624 - ydk - DEBUG - Netconf SSH Client: sending rpc
2019-04-08 16:57:23,624 - ydk - ERROR - Connection error occurred: Invalid session to send <rpc>.
2019-04-08 16:57:23,624 - ydk - ERROR - Connection error occurred: Invalid session to send <rpc>.
2019-04-08 16:57:23,625 - ydk - ERROR - Could not send payload <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"><get-schema xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring"><identifier>ios-voice</identifier><format>yang</format></get-schema></rpc>
2019-04-08 16:57:23,625 - ydk - ERROR - Could not send payload <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"><get-schema xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring"><identifier>ios-voice</identifier><format>yang</format></get-schema></rpc>
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
RuntimeError: YClientError: Could not send payload

I found the issue as it is checking for Module name and i was using module prefix . Once i changed ios-voice to module name which is 'Cisco-IOS-XE-voice:voice/vrf ' it is able to create the node.

Thanks for the pointer .
regards

jayaseelan

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: