[sysrepo-devel] callhome configuration not working

Vishal vishalwc at yahoo.com
Thu Jan 5 13:45:02 UTC 2017


I did as follows sysrepo/build/src/sysrepoctl -L 4 --feature-enable=call-home  --module=ietf-netconf-server
sysrepo/build/src/sysrepoctl -L 4 --feature-enable=ssh-call-home  --module=ietf-netconf-server

by sysrepoctl -l command  could verify the feature is enable for the module 
sysrepo/build/src/sysrepocfg --import=stock_key_config.xml --format=xml --datastore=startup ietf-keystore
sysrepo/build/src/sysrepocfg --import=callhome_bk.xml --format=xml --datastore=startup ietf-netconf-server

I could see the changes got in startup data files and subsequently and started the sysrepod and netopeer2 in sequence  

stock_key_config.xml as follows 

<keystore xmlns="urn:ietf:params:xml:ns:yang:ietf-keystore">    <private-keys>        <private-key>            <name>ssh_host_rsa_key</name>        </private-key>    </private-keys></keystore>
callhome_bk.xm contetnt as follows 
<netconf-server xmlns="urn:ietf:params:xml:ns:yang:ietf-netconf-server">  <call-home>    <netconf-client>      <name>main</name>      <ssh>        <endpoints>          <endpoint>            <name>endpt_name</name>            <address>127.0.0.1</address>            <port>6666</port>          </endpoint>        </endpoints>        <host-keys>          <host-key>          <name>rsa_key</name>          <public-key>ssh_host_rsa_key</public-key>          </host-key>        </host-keys>      </ssh>      <connection-type>        <persistent/>      </connection-type>    </netconf-client>  </call-home></netconf-server>

Than the server was listening on 830 port 
I started the netopeer2-cli on the same server and than listen it was NOT getting any call home connection

Please let me know am I missing something 

RegardsVishal 

 

    On Tuesday, 20 December 2016 12:44 PM, Rastislav Szabo -X (raszabo - PANTHEON TECHNOLOGIES at Cisco) <raszabo at cisco.com> wrote:
 

 Hi,

> is there something in netopeer2 preventing a get on a name with an apostrophe in it

It seems. Since guys from CESNET are already on leave, they probably won’t reply so soon, so I would suggest you to open an issue on Netopeer's github page for this.

Rastislav

-----Original Message-----
From: sysrepo-devel [mailto:sysrepo-devel-bounces at sysrepo.org] On Behalf Of Joan Landry
Sent: Monday, December 19, 2016 8:01 PM
To: Lukas Macko -X (lmacko - PANTHEON TECHNOLOGIES at Cisco) <lmacko at cisco.com>; Michal Vaško <mvasko at cesnet.cz>
Cc: sysrepo-devel at sysrepo.org
Subject: Re: [sysrepo-devel] is an apostrophe not an allowed character in a key?

Hi,
I was able to successfully set with an apostrophe in the name of the key using your suggestion
      snprintf(xpath_buf, 256, "/ensemble-config:ensemble-config/ensemble-domains:domains/domain[name=\"%s\"]/owner-tag", name);

Where name = abcd'def


However a  get rpc error is returned when I tried to read it back s - is there something in netopeer2 preventing a get on a name with an apostrophe in it?

 RPC Error Reply 42 for session 1:
<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <rpc-error>
    <error-type>application</error-type>
    <error-tag>operation-failed</error-tag>
    <error-severity>error</error-severity>
    <error-message 
      xmlns:xml="http://www.w3.org/XML/1998/namespace" xml:lang="en">Unexpected character(s) 'd' (def']).</error-message>
  </rpc-error>
</rpc-reply>


Netopeer2
[2016/12/19 13:48:15.346591, 3] ssh_packet_socket_callback:  packet: read type 94 [len=508,padding=8,comp=499,payload=499]
[2016/12/19 13:48:15.346647, 3] ssh_packet_process:  Dispatching handler for packet type 94
[2016/12/19 13:48:15.346774, 3] channel_rcv_data:  Channel receiving 490 bytes data in 0 (local win=1263304 remote win=39563725)
[2016/12/19 13:48:15.346799, 3] channel_default_bufferize:  placing 490 bytes into channel buffer (stderr=0)
[2016/12/19 13:48:15.346823, 3] channel_rcv_data:  Channel windows are now (local win=1262814 remote win=39563725)
[2016/12/19 13:48:15.346852, 3] ssh_channel_read_timeout:  Read (1) buffered : 490 bytes. Window: 1262814
[2016/12/19 13:48:15.346930, 3] ssh_channel_read_timeout:  Read (1) buffered : 489 bytes. Window: 1262814
[2016/12/19 13:48:15.346957, 3] ssh_channel_read_timeout:  Read (1) buffered : 488 bytes. Window: 1262814
[2016/12/19 13:48:15.346981, 3] ssh_channel_read_timeout:  Read (1) buffered : 487 bytes. Window: 1262814
[2016/12/19 13:48:15.347005, 3] ssh_channel_read_timeout:  Read (1) buffered : 486 bytes. Window: 1262814
[2016/12/19 13:48:15.347028, 3] ssh_channel_read_timeout:  Read (1) buffered : 485 bytes. Window: 1262814
[2016/12/19 13:48:15.347055, 3] ssh_channel_read_timeout:  Read (480) buffered : 484 bytes. Window: 1262814
[2016/12/19 13:48:15.347081, 3] ssh_channel_read_timeout:  Read (1) buffered : 4 bytes. Window: 1262814
[2016/12/19 13:48:15.347105, 3] ssh_channel_read_timeout:  Read (1) buffered : 3 bytes. Window: 1262814
[2016/12/19 13:48:15.347129, 3] ssh_channel_read_timeout:  Read (1) buffered : 2 bytes. Window: 1262814
[2016/12/19 13:48:15.347152, 3] ssh_channel_read_timeout:  Read (1) buffered : 1 bytes. Window: 1262814
netopeer2-server[29098]: Session 1: received message:
<?xml version="1.0" encoding="UTF-8"?>
<rpc message-id="42"
  xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <get-config xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
    <source>
      <running/>
    </source>
    <filter><ensemble-config xmlns="http://www.abcl.com/ns/ensemble-config">
          <domains xmlns="http://www.advaoptical.com/ns/ensemble-domains">
          </domains>
        </ensemble-config>
    </filter>
  </get-config>
</rpc>
netopeer2-server[29098]: DICT: inserting "rpc" with collision
netopeer2-server[29098]: DICT: inserting "message-id" with collision
netopeer2-server[29098]: DICT: inserting "42" with collision
netopeer2-server[29098]: DICT: inserting (refcount) "urn:ietf:params:xml:ns:netconf:base:1.0"
netopeer2-server[29098]: DICT: inserting (refcount) "get-config"
netopeer2-server[29098]: DICT: inserting (refcount) "urn:ietf:params:xml:ns:netconf:base:1.0"
netopeer2-server[29098]: DICT: inserting (refcount) "source"
netopeer2-server[29098]: DICT: inserting (refcount) "running"
netopeer2-server[29098]: DICT: inserting (refcount) ""
netopeer2-server[29098]: DICT: inserting (refcount) ""
netopeer2-server[29098]: DICT: inserting (refcount) "filter"
netopeer2-server[29098]: DICT: inserting (refcount) "ensemble-config"
netopeer2-server[29098]: DICT: inserting (refcount) "http://www.abc.com/ns/ensemble-config"
netopeer2-server[29098]: DICT: inserting (refcount) "domains"
netopeer2-server[29098]: DICT: inserting (refcount) "http://www.abcl.com/ns/ensemble-domains"
netopeer2-server[29098]: DICT: inserting "
          " with collision
netopeer2-server[29098]: DICT: inserting (refcount) ""
netopeer2-server[29098]: DICT: inserting (refcount) ""
netopeer2-server[29098]: DICT: inserting (refcount) ""
netopeer2-server[29098]: DICT: inserting (refcount) ""
netopeer2-server[29098]: Resolving unresolved data nodes and their constraints...
netopeer2-server[29098]: All data nodes and constraints resolved.
netopeer2-server[29098]: XPATH: expression "/ietf-netconf:get-config/source/*":
netopeer2-server[29098]: XPATH:    Token Operator(Path), in expression "/"
netopeer2-server[29098]: XPATH:    Token NameTest, in expression "ietf-netconf:get-config"
netopeer2-server[29098]: XPATH:    Token Operator(Path), in expression "/"
netopeer2-server[29098]: XPATH:    Token NameTest, in expression "source"
netopeer2-server[29098]: XPATH:    Token Operator(Path), in expression "/"
netopeer2-server[29098]: XPATH:    Token NameTest, in expression "*"
netopeer2-server[29098]: XPATH: eval_absolute_location_path parsed Operator(Path)[0]
netopeer2-server[29098]: DICT: inserting (refcount) "get-config"
netopeer2-server[29098]: XPATH: eval_node_test              parsed NameTest[1]
netopeer2-server[29098]: XPATH: eval_relative_location_path parsed Operator(Path)[24]
netopeer2-server[29098]: DICT: inserting (refcount) "source"
netopeer2-server[29098]: XPATH: eval_node_test              parsed NameTest[25]
netopeer2-server[29098]: XPATH: eval_relative_location_path parsed Operator(Path)[31]
netopeer2-server[29098]: DICT: inserting (refcount) "*"
netopeer2-server[29098]: XPATH: eval_node_test              parsed NameTest[32]
netopeer2-server[29098]: (cl_request_process:420) Sending session-switch-ds request.
netopeer2-server[29098]: (cl_request_process:442) session-switch-ds request sent, waiting for response.
netopeer2-server[29098]: (cl_request_process:464) session-switch-ds response received, processing.
netopeer2-server[29098]: XPATH: expression "/ietf-netconf:*/filter":
netopeer2-server[29098]: XPATH:    Token Operator(Path), in expression "/"
netopeer2-server[29098]: XPATH:    Token NameTest, in expression "ietf-netconf:*"
netopeer2-server[29098]: XPATH:    Token Operator(Path), in expression "/"
netopeer2-server[29098]: XPATH:    Token NameTest, in expression "filter"
netopeer2-server[29098]: XPATH: eval_absolute_location_path parsed Operator(Path)[0]
netopeer2-server[29098]: DICT: inserting (refcount) "*"
netopeer2-server[29098]: XPATH: eval_node_test              parsed NameTest[1]
netopeer2-server[29098]: XPATH: eval_relative_location_path parsed Operator(Path)[15]
netopeer2-server[29098]: DICT: inserting (refcount) "filter"
netopeer2-server[29098]: XPATH: eval_node_test              parsed NameTest[16]
netopeer2-server[29098]: XPATH: expression "/ietf-netconf:*/ietf-netconf-with-defaults:with-defaults":
netopeer2-server[29098]: XPATH:    Token Operator(Path), in expression "/"
netopeer2-server[29098]: XPATH:    Token NameTest, in expression "ietf-netconf:*"
netopeer2-server[29098]: XPATH:    Token Operator(Path), in expression "/"
netopeer2-server[29098]: XPATH:    Token NameTest, in expression "ietf-netconf-with-defaults:with-defaults"
netopeer2-server[29098]: XPATH: eval_absolute_location_path parsed Operator(Path)[0]
netopeer2-server[29098]: DICT: inserting (refcount) "*"
netopeer2-server[29098]: XPATH: eval_node_test              parsed NameTest[1]
netopeer2-server[29098]: XPATH: eval_relative_location_path parsed Operator(Path)[15]
netopeer2-server[29098]: DICT: inserting (refcount) "with-defaults"
netopeer2-server[29098]: XPATH: eval_node_test              parsed NameTest[16]
netopeer2-server[29098]: (cl_request_process:420) Sending session-refresh request.
netopeer2-server[29098]: (cl_request_process:442) session-refresh request sent, waiting for response.
netopeer2-server[29098]: (cl_request_process:464) session-refresh response received, processing.
netopeer2-server[29098]: (cl_request_process:420) Sending get-items request.
netopeer2-server[29098]: (cl_request_process:442) get-items request sent, waiting for response.
netopeer2-server[29098]: (cl_request_process:464) get-items response received, processing.
netopeer2-server[29098]: (cl_request_process:420) Sending get-items request.
netopeer2-server[29098]: (cl_request_process:442) get-items request sent, waiting for response.
netopeer2-server[29098]: (cl_request_process:464) get-items response received, processing.
netopeer2-server[29098]: DICT: inserting "default" with collision
netopeer2-server[29098]: DICT: inserting (refcount) ""
netopeer2-server[29098]: DICT: inserting (refcount) "true"
netopeer2-server[29098]: DICT: inserting "abcd" with collision
netopeer2-server[29098]: DICT: inserting (refcount) ""
netopeer2-server[29098]: DICT: inserting (refcount) "true"
netopeer2-server[29098]: Unexpected character(s) 'd' (def']).
netopeer2-server[29098]: DICT: inserting "Request could not be completed because the requested operation failed for a non-specific reason." with collision
netopeer2-server[29098]: DICT: inserting "en" with collision
netopeer2-server[29098]: DICT: inserting "Unexpected character(s) 'd' (def'])." with collision
netopeer2-server[29098]: DICT: inserting "en" with collision
netopeer2-server[29098]: Session 1: sending message:

#304

[2016/12/19 13:48:15.369739, 3] ssh_socket_unbuffered_write:  Enabling POLLOUT for socket
[2016/12/19 13:48:15.369781, 3] packet_send2:  packet: wrote [len=28,padding=12,comp=15,payload=15]
[2016/12/19 13:48:15.369805, 3] channel_write_common:  channel_write wrote 6 bytes
netopeer2-server[29098]: Session 1: sending message:
<rpc-reply message-id="42" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"><rpc-error><error-type>application</error-type><error-tag>operation-failed</error-tag><error-severity>error</error-severity><error-message xml:lang="en">Unexpected character(s) 'd' (def']).</error-message></rpc-error></rpc-reply>
[2016/12/19 13:48:15.369887, 3] packet_send2:  packet: wrote [len=332,padding=18,comp=313,payload=313]
[2016/12/19 13:48:15.369912, 3] channel_write_common:  channel_write wrote 304 bytes
[2016/12/19 13:48:15.369944, 3] ssh_socket_unbuffered_write:  Enabling POLLOUT for socket
netopeer2-server[29098]: Session 1: sending message:

##

[2016/12/19 13:48:15.370011, 3] packet_send2:  packet: wrote [len=28,padding=14,comp=13,payload=13]
[2016/12/19 13:48:15.370704, 3] channel_write_common:  channel_write wrote 4 bytes
[2016/12/19 13:48:15.370741, 3] ssh_socket_unbuffered_write:  Enabling POLLOUT for socket




-----Original Message-----
From: Lukas Macko -X (lmacko - PANTHEON TECHNOLOGIES at Cisco) [mailto:lmacko at cisco.com]
Sent: Monday, December 19, 2016 2:10 AM
To: Joan Landry <JoLandry at advaoptical.com>; Michal Vaško <mvasko at cesnet.cz>
Cc: sysrepo-devel at sysrepo.org
Subject: RE: [sysrepo-devel] is an apostrophe not an allowed character in a key?

Hi,

rc = sr_set_item(sess, "/ietf-interfaces:interfaces/interface[name=\"giga'eth0\"]/type", &value, SR_EDIT_DEFAULT);

in the example there is more issue: The identity value should be prefixed by module name  
value.data.string_val = "iana-if-type:ethernetCsmacd";

Regards,
Lukas

> -----Original Message-----
> From: sysrepo-devel [mailto:sysrepo-devel-bounces at sysrepo.org] On 
> Behalf Of Joan Landry
> Sent: Friday, December 16, 2016 10:38 PM
> To: Michal Vaško <mvasko at cesnet.cz>
> Cc: sysrepo-devel at sysrepo.org
> Subject: Re: [sysrepo-devel] is an apostrophe not an allowed character in a key?
> 
> I am sorry I am not sure I fully understand your suggestion on how to 
> correct this issue.
> 
> In the sr_set_item_example.c  example code
> 
>    rc = sr_set_item(sess, "/ietf-
> interfaces:interfaces/interface[name='gigaeth0']/type", &value, 
> SR_EDIT_DEFAULT);
> 
> what should be entered if the name of the interface is gig'123
> 
> I have tried the following combinations and none of them work.
> 
>    rc = sr_set_item(sess, "/ietf-
> interfaces:interfaces/interface[name='gig'123']/type", &value, 
> SR_EDIT_DEFAULT);
>    rc = sr_set_item(sess, "/ietf-
> interfaces:interfaces/interface[name='gig\'123']/type", &value, 
> SR_EDIT_DEFAULT);
>    rc = sr_set_item(sess, "/ietf-
> interfaces:interfaces/interface[name='gig\"'\"123']/type", &value, 
> SR_EDIT_DEFAULT);
> 
> any info on this would be greatly appreciated.
> thanks
> 
> -----Original Message-----
> From: Michal Vaško [mailto:mvasko at cesnet.cz]
> Sent: Thursday, December 15, 2016 3:14 AM
> To: Joan Landry <JoLandry at advaoptical.com>
> Cc: sysrepo-devel at sysrepo.org
> Subject: Re: [sysrepo-devel] is an apostrophe not an allowed character in a key?
> 
> Hi,
> XPath defines [1] that a literal (which is a string value, such as 
> your key value) enclosed in single-quotes cannot contain a 
> single-quote and in double-quotes cannot contain a double-quote. Hence use double-quotes.
> 
> Regards,
> Michal
> 
> [1] https://www.w3.org/TR/xpath/#NT-Literal
> 
> On Wednesday, December 14, 2016 20:20 CET, Joan Landry 
> <JoLandry at advaoptical.com> wrote:
> 
> > I am seeing that if the key name of something includes and 
> > apostrophe libyang
> sees it as an error.
> >
> > Is the apostrophe not allowed as a character of a key leaf?
> >
> > To set the name my code does the following:
> >      snprintf(xpath_buf, 256,
> > "/ensemble-config:ensemble-config/abc-ensemble-domains:domains/domai
> > n[
> > name='%s']/owner-tag", name);
> >
> > where if name has normal characters there is no issue - but if name 
> > contains
> an apostrophe I get an error:
> > example: abcd'efg
> >
> > INF] (rp_dt_set_item_wrapper:559) Set item request running 
> > datastore,
> > xpath:
> > /ensemble-config:ensemble-config/ensemble-
> domains:domains/domain[name=
> > 'abcd'efg']/persistence [DBG] (dm_ly_log_cb:853) libyang error:
> > Unexpected character(s) 'e' (efg']/persisten).
> > [DBG] (dm_ly_log_cb:853) libyang error: Resolving XPath expression
> "/ensemble-config:ensemble-config/ensemble-
> domains:domains/domain[name='abcd'efg']/persistence" failed.
> > [ERR] (rp_dt_set_item:323) Requested node is not valid
> > /adva-ensemble-config:ensemble-config/adva-ensemble-
> domains:domains/do
> > main[name='abcd'efg']/persistence [ERR] (rp_dt_set_item_wrapper:574) 
> > Set item failed [ERR] (rp_set_item_req_process:939) Set item failed 
> > for '/ensemble-config:ensemble-config/ensemble-
> domains:domains/domain[name='abcd'efg']/persistence', session 
> id=602346779.
> >
> > In case above name is defined as a string.
> >
> >    list domain {
> >      key "name";
> >      leaf name {
> >        type string;
> >      }
> 
> 
> 
> _______________________________________________
> sysrepo-devel mailing list
> sysrepo-devel at sysrepo.org
> http://lists.sysrepo.org/listinfo/sysrepo-devel
_______________________________________________
sysrepo-devel mailing list
sysrepo-devel at sysrepo.org
http://lists.sysrepo.org/listinfo/sysrepo-devel
_______________________________________________
sysrepo-devel mailing list
sysrepo-devel at sysrepo.org
http://lists.sysrepo.org/listinfo/sysrepo-devel


   
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sysrepo.org/archives/sysrepo-devel/attachments/20170105/788fba47/attachment.html>


More information about the sysrepo-devel mailing list