Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect handling of the replace op. in edit-config request #49

Closed
rastislavs opened this issue Nov 2, 2016 · 19 comments
Closed

Incorrect handling of the replace op. in edit-config request #49

rastislavs opened this issue Nov 2, 2016 · 19 comments
Assignees

Comments

@rastislavs
Copy link
Contributor

rastislavs commented Nov 2, 2016

Request to replace GigabitEthernet0/8/0 config (that already exists in the datastore) with new values:

#779
     <rpc message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
       <edit-config>
         <target>
           <running/>
         </target>
         <config xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0">
           <interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces">
             <interface xc:operation="replace">
               <name>GigabitEthernet0/8/0</name>
               <type>ethernetCsmacd</type>
               <ipv4 xmlns="urn:ietf:params:xml:ns:yang:ietf-ip">
                 <address>
                   <ip>192.0.2.4</ip>
                   <prefix-length>24</prefix-length>
                 </address>
               </ipv4>
             </interface>
           </interfaces>
         </config>
       </edit-config>
     </rpc>
##

#93
<rpc-reply message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"><ok/></rpc-reply>
##

The only edit-like operation that comes to sysrepo is this one set-item:

[INF] (rp_dt_set_item_wrapper:559) Set item request running datastore, xpath: /ietf-interfaces:interfaces/interface[name='GigabitEthernet0/8/0']

And nothing actually changes in the datastore...

Full Netopeer2 logs:

[2016/11/02 15:09:26.164570, 3] ssh_packet_socket_callback:  packet: read type 94 [len=28,padding=15,comp=12,payload=12]
[2016/11/02 15:09:26.164579, 3] ssh_packet_process:  Dispatching handler for packet type 94
[2016/11/02 15:09:26.164585, 3] channel_rcv_data:  Channel receiving 3 bytes data in 0 (local win=1278787 remote win=2094207)
[2016/11/02 15:09:26.164592, 3] channel_default_bufferize:  placing 3 bytes into channel buffer (stderr=0)
[2016/11/02 15:09:26.164597, 3] channel_rcv_data:  Channel windows are now (local win=1278784 remote win=2094207)
[2016/11/02 15:09:26.164604, 3] ssh_channel_read_timeout:  Read (1) buffered : 2 bytes. Window: 1278784
[2016/11/02 15:09:26.164612, 3] ssh_channel_read_timeout:  Read (1) buffered : 1 bytes. Window: 1278784
netopeer2-server[25700]: Session 1: received message:
     <rpc message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
       <edit-config>
         <target>
           <running/>
         </target>
         <config xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0">
           <interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces">
             <interface xc:operation="replace">
               <name>GigabitEthernet0/8/0</name>
               <ipv4 xmlns="urn:ietf:params:xml:ns:yang:ietf-ip">
                 <address>
                   <ip>192.0.2.4</ip>
                   <prefix-length>24</prefix-length>
                 </address>
               </ipv4>
             </interface>
           </interfaces>
         </config>
       </edit-config>
     </rpc>
netopeer2-server[25700]: DICT: inserting "rpc" with collision 
netopeer2-server[25700]: DICT: inserting "message-id" with collision 
netopeer2-server[25700]: DICT: inserting "101" with collision 
netopeer2-server[25700]: DICT: inserting (refcount) "urn:ietf:params:xml:ns:netconf:base:1.0"
netopeer2-server[25700]: DICT: inserting (refcount) "edit-config"
netopeer2-server[25700]: DICT: inserting (refcount) "target"
netopeer2-server[25700]: DICT: inserting (refcount) "running"
netopeer2-server[25700]: DICT: inserting (refcount) ""
netopeer2-server[25700]: DICT: inserting (refcount) ""
netopeer2-server[25700]: DICT: inserting (refcount) "config"
netopeer2-server[25700]: DICT: inserting "xc" with collision 
netopeer2-server[25700]: DICT: inserting (refcount) "urn:ietf:params:xml:ns:netconf:base:1.0"
netopeer2-server[25700]: DICT: inserting (refcount) "interfaces"
netopeer2-server[25700]: DICT: inserting (refcount) "urn:ietf:params:xml:ns:yang:ietf-interfaces"
netopeer2-server[25700]: DICT: inserting (refcount) "interface"
netopeer2-server[25700]: DICT: inserting "operation" with collision 
netopeer2-server[25700]: DICT: inserting (refcount) "replace"
netopeer2-server[25700]: DICT: inserting (refcount) "name"
netopeer2-server[25700]: DICT: inserting "GigabitEthernet0/8/0" with collision 
netopeer2-server[25700]: DICT: inserting (refcount) "ipv4"
netopeer2-server[25700]: DICT: inserting (refcount) "urn:ietf:params:xml:ns:yang:ietf-ip"
netopeer2-server[25700]: DICT: inserting (refcount) "address"
netopeer2-server[25700]: DICT: inserting (refcount) "ip"
netopeer2-server[25700]: DICT: inserting "192.0.2.4" with collision 
netopeer2-server[25700]: DICT: inserting (refcount) "prefix-length"
netopeer2-server[25700]: DICT: inserting "24" with collision 
netopeer2-server[25700]: DICT: inserting (refcount) ""
netopeer2-server[25700]: DICT: inserting (refcount) ""
netopeer2-server[25700]: DICT: inserting (refcount) ""
netopeer2-server[25700]: DICT: inserting (refcount) ""
netopeer2-server[25700]: DICT: inserting (refcount) ""
netopeer2-server[25700]: DICT: inserting (refcount) ""
netopeer2-server[25700]: DICT: inserting (refcount) ""
netopeer2-server[25700]: DICT: inserting (refcount) "urn:ietf:params:xml:ns:netconf:base:1.0"
netopeer2-server[25700]: DICT: inserting (refcount) "xc"
netopeer2-server[25700]: DICT: inserting (refcount) "merge"
netopeer2-server[25700]: DICT: inserting (refcount) "test-then-set"
netopeer2-server[25700]: DICT: inserting (refcount) "stop-on-error"
netopeer2-server[25700]: Resolving unresolved data nodes and their constraints...
netopeer2-server[25700]: All data nodes and constraints resolved.
netopeer2-server[25700]: XPATH: expression "/ietf-netconf:edit-config/target/*":
netopeer2-server[25700]: XPATH:	Token Operator(Path), in expression "/"
netopeer2-server[25700]: XPATH:	Token NameTest, in expression "ietf-netconf:edit-config"
netopeer2-server[25700]: XPATH:	Token Operator(Path), in expression "/"
netopeer2-server[25700]: XPATH:	Token NameTest, in expression "target"
netopeer2-server[25700]: XPATH:	Token Operator(Path), in expression "/"
netopeer2-server[25700]: XPATH:	Token NameTest, in expression "*"
netopeer2-server[25700]: XPATH: eval_absolute_location_path parsed Operator(Path)[0]
netopeer2-server[25700]: DICT: inserting (refcount) "edit-config"
netopeer2-server[25700]: XPATH: eval_node_test              parsed NameTest[1]
netopeer2-server[25700]: XPATH: eval_relative_location_path parsed Operator(Path)[25]
netopeer2-server[25700]: DICT: inserting (refcount) "target"
netopeer2-server[25700]: XPATH: eval_node_test              parsed NameTest[26]
netopeer2-server[25700]: XPATH: eval_relative_location_path parsed Operator(Path)[32]
netopeer2-server[25700]: DICT: inserting "*" with collision 
netopeer2-server[25700]: XPATH: eval_node_test              parsed NameTest[33]
netopeer2-server[25700]: XPATH: expression "/ietf-netconf:edit-config/default-operation":
netopeer2-server[25700]: XPATH:	Token Operator(Path), in expression "/"
netopeer2-server[25700]: XPATH:	Token NameTest, in expression "ietf-netconf:edit-config"
netopeer2-server[25700]: XPATH:	Token Operator(Path), in expression "/"
netopeer2-server[25700]: XPATH:	Token NameTest, in expression "default-operation"
netopeer2-server[25700]: XPATH: eval_absolute_location_path parsed Operator(Path)[0]
netopeer2-server[25700]: DICT: inserting (refcount) "edit-config"
netopeer2-server[25700]: XPATH: eval_node_test              parsed NameTest[1]
netopeer2-server[25700]: XPATH: eval_relative_location_path parsed Operator(Path)[25]
netopeer2-server[25700]: DICT: inserting (refcount) "default-operation"
netopeer2-server[25700]: XPATH: eval_node_test              parsed NameTest[26]
netopeer2-server[25700]: XPATH: expression "/ietf-netconf:edit-config/test-option":
netopeer2-server[25700]: XPATH:	Token Operator(Path), in expression "/"
netopeer2-server[25700]: XPATH:	Token NameTest, in expression "ietf-netconf:edit-config"
netopeer2-server[25700]: XPATH:	Token Operator(Path), in expression "/"
netopeer2-server[25700]: XPATH:	Token NameTest, in expression "test-option"
netopeer2-server[25700]: XPATH: eval_absolute_location_path parsed Operator(Path)[0]
netopeer2-server[25700]: DICT: inserting (refcount) "edit-config"
netopeer2-server[25700]: XPATH: eval_node_test              parsed NameTest[1]
netopeer2-server[25700]: XPATH: eval_relative_location_path parsed Operator(Path)[25]
netopeer2-server[25700]: DICT: inserting (refcount) "test-option"
netopeer2-server[25700]: XPATH: eval_node_test              parsed NameTest[26]
netopeer2-server[25700]: XPATH: expression "/ietf-netconf:edit-config/error-option":
netopeer2-server[25700]: XPATH:	Token Operator(Path), in expression "/"
netopeer2-server[25700]: XPATH:	Token NameTest, in expression "ietf-netconf:edit-config"
netopeer2-server[25700]: XPATH:	Token Operator(Path), in expression "/"
netopeer2-server[25700]: XPATH:	Token NameTest, in expression "error-option"
netopeer2-server[25700]: XPATH: eval_absolute_location_path parsed Operator(Path)[0]
netopeer2-server[25700]: DICT: inserting (refcount) "edit-config"
netopeer2-server[25700]: XPATH: eval_node_test              parsed NameTest[1]
netopeer2-server[25700]: XPATH: eval_relative_location_path parsed Operator(Path)[25]
netopeer2-server[25700]: DICT: inserting (refcount) "error-option"
netopeer2-server[25700]: XPATH: eval_node_test              parsed NameTest[26]
netopeer2-server[25700]: XPATH: expression "/ietf-netconf:edit-config/config":
netopeer2-server[25700]: XPATH:	Token Operator(Path), in expression "/"
netopeer2-server[25700]: XPATH:	Token NameTest, in expression "ietf-netconf:edit-config"
netopeer2-server[25700]: XPATH:	Token Operator(Path), in expression "/"
netopeer2-server[25700]: XPATH:	Token NameTest, in expression "config"
netopeer2-server[25700]: XPATH: eval_absolute_location_path parsed Operator(Path)[0]
netopeer2-server[25700]: DICT: inserting (refcount) "edit-config"
netopeer2-server[25700]: XPATH: eval_node_test              parsed NameTest[1]
netopeer2-server[25700]: XPATH: eval_relative_location_path parsed Operator(Path)[25]
netopeer2-server[25700]: DICT: inserting (refcount) "config"
netopeer2-server[25700]: XPATH: eval_node_test              parsed NameTest[26]
netopeer2-server[25700]: EDIT_CONFIG: ds 30661888, defop 1, testopt 0, config:
<interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces">
  <interface nc:operation="replace">
    <name>GigabitEthernet0/8/0</name>
    <ipv4 xmlns="urn:ietf:params:xml:ns:yang:ietf-ip">
      <address>
        <ip>192.0.2.4</ip>
        <prefix-length>24</prefix-length>
      </address>
    </ipv4>
  </interface>
</interfaces>
netopeer2-server[25700]: (cl_request_process:416) Sending session-refresh request.
netopeer2-server[25700]: (cl_request_process:438) session-refresh request sent, waiting for response.
netopeer2-server[25700]: (cl_request_process:460) session-refresh response received, processing.
netopeer2-server[25700]: EDIT_CONFIG: list /ietf-interfaces:interfaces/interface[name='GigabitEthernet0/8/0'], operation 3
netopeer2-server[25700]: (cl_request_process:416) Sending set-item request.
netopeer2-server[25700]: (cl_request_process:438) set-item request sent, waiting for response.
netopeer2-server[25700]: (cl_request_process:460) set-item response received, processing.
netopeer2-server[25700]: EDIT_CONFIG: success (/ietf-interfaces:interfaces/interface[name='GigabitEthernet0/8/0']).
netopeer2-server[25700]: (cl_request_process:416) Sending commit request.
netopeer2-server[25700]: (cl_request_process:438) commit request sent, waiting for response.
netopeer2-server[25700]: (cl_request_process:460) commit response received, processing.
netopeer2-server[25700]: EDIT_CONFIG: done.
netopeer2-server[25700]: Session 1: sending message:

#93

[2016/11/02 15:09:26.204926, 3] ssh_socket_unbuffered_write:  Enabling POLLOUT for socket
[2016/11/02 15:09:26.204942, 3] packet_send2:  packet: wrote [len=28,padding=13,comp=14,payload=14]
[2016/11/02 15:09:26.204950, 3] channel_write_common:  channel_write wrote 5 bytes
netopeer2-server[25700]: Session 1: sending message:
<rpc-reply message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"><ok/></rpc-reply>
[2016/11/02 15:09:26.204976, 3] packet_send2:  packet: wrote [len=108,padding=5,comp=102,payload=102]
[2016/11/02 15:09:26.205001, 3] channel_write_common:  channel_write wrote 93 bytes
[2016/11/02 15:09:26.205049, 3] ssh_socket_unbuffered_write:  Enabling POLLOUT for socket
netopeer2-server[25700]: Session 1: sending message:

##

[2016/11/02 15:09:26.205097, 3] packet_send2:  packet: wrote [len=28,padding=14,comp=13,payload=13]
[2016/11/02 15:09:26.205149, 3] channel_write_common:  channel_write wrote 4 bytes
[2016/11/02 15:09:26.205203, 3] ssh_socket_unbuffered_write:  Enabling POLLOUT for socket
@rastislavs rastislavs changed the title Incorrect handling of the replace op. in edit-config request: Incorrect handling of the replace op. in edit-config request Nov 2, 2016
@rastislavs
Copy link
Contributor Author

found in devel-server branch, not sure about master...

@fanchanghu
Copy link
Contributor

it seems you do not define xmlns nc, so nc:operation is ignored. @joanlandry

@michalvasko
Copy link
Member

Hi,
the original issue should be resolved now.

Regards,
Michal

@rastislavs
Copy link
Contributor Author

I'm afraid that the original issue still isn't resolved. I'm using devel branches of all libraries (with the libyang fix mentioned above). The edit-config in my first comment (replace operation on interface list) still triggers just one sr_set_item request to sysrepo:

[INF] (rp_dt_set_item_wrapper:559) Set item request running datastore, xpath: /ietf-interfaces:interfaces/interface[name='GigabitEthernet0/8/0']

I would expect something like sr_delete_item on the interface list and then several set-items on the list and individual leaves.

@michalvasko
Copy link
Member

Hi,
debug output of the server is also the same?

Regards,
Michal

@michalvasko michalvasko reopened this Nov 18, 2016
@rastislavs
Copy link
Contributor Author

Yes, the debug output looks similar:

[2016/11/22 12:57:49.845661, 3] ssh_packet_socket_callback:  packet: read type 94 [len=28,padding=15,comp=12,payload=12]
[2016/11/22 12:57:49.845667, 3] ssh_packet_process:  Dispatching handler for packet type 94
[2016/11/22 12:57:49.845672, 3] channel_rcv_data:  Channel receiving 3 bytes data in 0 (local win=1278744 remote win=2094290)
[2016/11/22 12:57:49.845675, 3] channel_default_bufferize:  placing 3 bytes into channel buffer (stderr=0)
[2016/11/22 12:57:49.845695, 3] channel_rcv_data:  Channel windows are now (local win=1278741 remote win=2094290)
[2016/11/22 12:57:49.845724, 3] ssh_channel_read_timeout:  Read (1) buffered : 2 bytes. Window: 1278741
[2016/11/22 12:57:49.845730, 3] ssh_channel_read_timeout:  Read (1) buffered : 1 bytes. Window: 1278741
netopeer2-server[8937]: Session 1: received message:
     <rpc message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
       <edit-config>
         <target>
           <running/>
         </target>
         <config xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0">
           <interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces">
             <interface xc:operation="replace">
               <name>GigabitEthernet0/8/0</name>
               <type>ethernetCsmacd</type>
               <ipv4 xmlns="urn:ietf:params:xml:ns:yang:ietf-ip">
                 <address>
                   <ip>192.0.2.4</ip>
                   <prefix-length>24</prefix-length>
                 </address>
               </ipv4>
             </interface>
           </interfaces>
         </config>
       </edit-config>
     </rpc>
netopeer2-server[8937]: DICT: inserting "rpc" with collision 
netopeer2-server[8937]: DICT: inserting "message-id" with collision 
netopeer2-server[8937]: DICT: inserting "101" with collision 
netopeer2-server[8937]: DICT: inserting (refcount) "urn:ietf:params:xml:ns:netconf:base:1.0"
netopeer2-server[8937]: DICT: inserting (refcount) "edit-config"
netopeer2-server[8937]: DICT: inserting (refcount) "target"
netopeer2-server[8937]: DICT: inserting (refcount) "running"
netopeer2-server[8937]: DICT: inserting (refcount) ""
netopeer2-server[8937]: DICT: inserting (refcount) ""
netopeer2-server[8937]: DICT: inserting (refcount) "config"
netopeer2-server[8937]: DICT: inserting "xc" with collision 
netopeer2-server[8937]: DICT: inserting (refcount) "urn:ietf:params:xml:ns:netconf:base:1.0"
netopeer2-server[8937]: DICT: inserting (refcount) "interfaces"
netopeer2-server[8937]: DICT: inserting (refcount) "urn:ietf:params:xml:ns:yang:ietf-interfaces"
netopeer2-server[8937]: DICT: inserting (refcount) "interface"
netopeer2-server[8937]: DICT: inserting "operation" with collision 
netopeer2-server[8937]: DICT: inserting (refcount) "replace"
netopeer2-server[8937]: DICT: inserting (refcount) "name"
netopeer2-server[8937]: DICT: inserting "GigabitEthernet0/8/0" with collision 
netopeer2-server[8937]: DICT: inserting (refcount) "type"
netopeer2-server[8937]: DICT: inserting (refcount) "ethernetCsmacd"
netopeer2-server[8937]: DICT: inserting (refcount) "ipv4"
netopeer2-server[8937]: DICT: inserting (refcount) "urn:ietf:params:xml:ns:yang:ietf-ip"
netopeer2-server[8937]: DICT: inserting (refcount) "address"
netopeer2-server[8937]: DICT: inserting (refcount) "ip"
netopeer2-server[8937]: DICT: inserting "192.0.2.4" with collision 
netopeer2-server[8937]: DICT: inserting (refcount) "prefix-length"
netopeer2-server[8937]: DICT: inserting "24" with collision 
netopeer2-server[8937]: DICT: inserting (refcount) ""
netopeer2-server[8937]: DICT: inserting (refcount) ""
netopeer2-server[8937]: DICT: inserting (refcount) ""
netopeer2-server[8937]: DICT: inserting (refcount) ""
netopeer2-server[8937]: DICT: inserting (refcount) ""
netopeer2-server[8937]: DICT: inserting (refcount) ""
netopeer2-server[8937]: DICT: inserting (refcount) ""
netopeer2-server[8937]: DICT: inserting (refcount) "urn:ietf:params:xml:ns:netconf:base:1.0"
netopeer2-server[8937]: DICT: inserting (refcount) "xc"
netopeer2-server[8937]: DICT: inserting (refcount) "merge"
netopeer2-server[8937]: DICT: inserting (refcount) "test-then-set"
netopeer2-server[8937]: DICT: inserting (refcount) "stop-on-error"
netopeer2-server[8937]: Resolving unresolved data nodes and their constraints...
netopeer2-server[8937]: All data nodes and constraints resolved.
netopeer2-server[8937]: XPATH: expression "/ietf-netconf:edit-config/target/*":
netopeer2-server[8937]: XPATH:	Token Operator(Path), in expression "/"
netopeer2-server[8937]: XPATH:	Token NameTest, in expression "ietf-netconf:edit-config"
netopeer2-server[8937]: XPATH:	Token Operator(Path), in expression "/"
netopeer2-server[8937]: XPATH:	Token NameTest, in expression "target"
netopeer2-server[8937]: XPATH:	Token Operator(Path), in expression "/"
netopeer2-server[8937]: XPATH:	Token NameTest, in expression "*"
netopeer2-server[8937]: XPATH: eval_absolute_location_path parsed Operator(Path)[0]
netopeer2-server[8937]: DICT: inserting (refcount) "edit-config"
netopeer2-server[8937]: XPATH: eval_node_test              parsed NameTest[1]
netopeer2-server[8937]: XPATH: eval_relative_location_path parsed Operator(Path)[25]
netopeer2-server[8937]: DICT: inserting (refcount) "target"
netopeer2-server[8937]: XPATH: eval_node_test              parsed NameTest[26]
netopeer2-server[8937]: XPATH: eval_relative_location_path parsed Operator(Path)[32]
netopeer2-server[8937]: DICT: inserting "*" with collision 
netopeer2-server[8937]: XPATH: eval_node_test              parsed NameTest[33]
netopeer2-server[8937]: XPATH: expression "/ietf-netconf:edit-config/default-operation":
netopeer2-server[8937]: XPATH:	Token Operator(Path), in expression "/"
netopeer2-server[8937]: XPATH:	Token NameTest, in expression "ietf-netconf:edit-config"
netopeer2-server[8937]: XPATH:	Token Operator(Path), in expression "/"
netopeer2-server[8937]: XPATH:	Token NameTest, in expression "default-operation"
netopeer2-server[8937]: XPATH: eval_absolute_location_path parsed Operator(Path)[0]
netopeer2-server[8937]: DICT: inserting (refcount) "edit-config"
netopeer2-server[8937]: XPATH: eval_node_test              parsed NameTest[1]
netopeer2-server[8937]: XPATH: eval_relative_location_path parsed Operator(Path)[25]
netopeer2-server[8937]: DICT: inserting (refcount) "default-operation"
netopeer2-server[8937]: XPATH: eval_node_test              parsed NameTest[26]
netopeer2-server[8937]: XPATH: expression "/ietf-netconf:edit-config/test-option":
netopeer2-server[8937]: XPATH:	Token Operator(Path), in expression "/"
netopeer2-server[8937]: XPATH:	Token NameTest, in expression "ietf-netconf:edit-config"
netopeer2-server[8937]: XPATH:	Token Operator(Path), in expression "/"
netopeer2-server[8937]: XPATH:	Token NameTest, in expression "test-option"
netopeer2-server[8937]: XPATH: eval_absolute_location_path parsed Operator(Path)[0]
netopeer2-server[8937]: DICT: inserting (refcount) "edit-config"
netopeer2-server[8937]: XPATH: eval_node_test              parsed NameTest[1]
netopeer2-server[8937]: XPATH: eval_relative_location_path parsed Operator(Path)[25]
netopeer2-server[8937]: DICT: inserting (refcount) "test-option"
netopeer2-server[8937]: XPATH: eval_node_test              parsed NameTest[26]
netopeer2-server[8937]: XPATH: expression "/ietf-netconf:edit-config/error-option":
netopeer2-server[8937]: XPATH:	Token Operator(Path), in expression "/"
netopeer2-server[8937]: XPATH:	Token NameTest, in expression "ietf-netconf:edit-config"
netopeer2-server[8937]: XPATH:	Token Operator(Path), in expression "/"
netopeer2-server[8937]: XPATH:	Token NameTest, in expression "error-option"
netopeer2-server[8937]: XPATH: eval_absolute_location_path parsed Operator(Path)[0]
netopeer2-server[8937]: DICT: inserting (refcount) "edit-config"
netopeer2-server[8937]: XPATH: eval_node_test              parsed NameTest[1]
netopeer2-server[8937]: XPATH: eval_relative_location_path parsed Operator(Path)[25]
netopeer2-server[8937]: DICT: inserting (refcount) "error-option"
netopeer2-server[8937]: XPATH: eval_node_test              parsed NameTest[26]
netopeer2-server[8937]: XPATH: expression "/ietf-netconf:edit-config/config":
netopeer2-server[8937]: XPATH:	Token Operator(Path), in expression "/"
netopeer2-server[8937]: XPATH:	Token NameTest, in expression "ietf-netconf:edit-config"
netopeer2-server[8937]: XPATH:	Token Operator(Path), in expression "/"
netopeer2-server[8937]: XPATH:	Token NameTest, in expression "config"
netopeer2-server[8937]: XPATH: eval_absolute_location_path parsed Operator(Path)[0]
netopeer2-server[8937]: DICT: inserting (refcount) "edit-config"
netopeer2-server[8937]: XPATH: eval_node_test              parsed NameTest[1]
netopeer2-server[8937]: XPATH: eval_relative_location_path parsed Operator(Path)[25]
netopeer2-server[8937]: DICT: inserting (refcount) "config"
netopeer2-server[8937]: XPATH: eval_node_test              parsed NameTest[26]
netopeer2-server[8937]: DICT: inserting (refcount) "ethernetCsmacd"
netopeer2-server[8937]: DICT: inserting (refcount) "ethernetCsmacd"
netopeer2-server[8937]: EDIT_CONFIG: ds 22989280, defop 1, testopt 0, config:
<interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0">
  <interface nc:operation="replace">
    <name>GigabitEthernet0/8/0</name>
    <type>ethernetCsmacd</type>
    <ipv4 xmlns="urn:ietf:params:xml:ns:yang:ietf-ip">
      <address>
        <ip>192.0.2.4</ip>
        <prefix-length>24</prefix-length>
      </address>
    </ipv4>
  </interface>
</interfaces>
netopeer2-server[8937]: (cl_request_process:416) Sending session-refresh request.
netopeer2-server[8937]: (cl_request_process:438) session-refresh request sent, waiting for response.
netopeer2-server[8937]: (cl_request_process:460) session-refresh response received, processing.
netopeer2-server[8937]: EDIT_CONFIG: list /ietf-interfaces:interfaces/interface[name='GigabitEthernet0/8/0'], operation 3
netopeer2-server[8937]: (cl_request_process:416) Sending set-item request.
netopeer2-server[8937]: (cl_request_process:438) set-item request sent, waiting for response.
netopeer2-server[8937]: (cl_request_process:460) set-item response received, processing.
netopeer2-server[8937]: EDIT_CONFIG: success (/ietf-interfaces:interfaces/interface[name='GigabitEthernet0/8/0']).
netopeer2-server[8937]: (cl_request_process:416) Sending commit request.
netopeer2-server[8937]: (cl_request_process:438) commit request sent, waiting for response.
netopeer2-server[8937]: (cl_request_process:460) commit response received, processing.
netopeer2-server[8937]: EDIT_CONFIG: done.
netopeer2-server[8937]: Session 1: sending message:

#93

[2016/11/22 12:57:49.885303, 3] ssh_socket_unbuffered_write:  Enabling POLLOUT for socket
[2016/11/22 12:57:49.885315, 3] packet_send2:  packet: wrote [len=28,padding=13,comp=14,payload=14]
[2016/11/22 12:57:49.885319, 3] channel_write_common:  channel_write wrote 5 bytes
netopeer2-server[8937]: Session 1: sending message:
<rpc-reply message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"><ok/></rpc-reply>
[2016/11/22 12:57:49.885338, 3] packet_send2:  packet: wrote [len=108,padding=5,comp=102,payload=102]
[2016/11/22 12:57:49.885342, 3] channel_write_common:  channel_write wrote 93 bytes
[2016/11/22 12:57:49.885347, 3] ssh_socket_unbuffered_write:  Enabling POLLOUT for socket
netopeer2-server[8937]: Session 1: sending message:

##

[2016/11/22 12:57:49.885359, 3] packet_send2:  packet: wrote [len=28,padding=14,comp=13,payload=13]
[2016/11/22 12:57:49.885362, 3] channel_write_common:  channel_write wrote 4 bytes
[2016/11/22 12:57:49.885366, 3] ssh_socket_unbuffered_write:  Enabling POLLOUT for socket

@michalvasko michalvasko self-assigned this Nov 23, 2016
@michalvasko
Copy link
Member

Hi,
the output is different (notice that namespace with nc prefix now is defined), but there still was a problem in edit-config, should be fixed now it devel (careful with the type, the value is from iana-if-type module!).

Regards,
Michal

@rastislavs
Copy link
Contributor Author

Hi,
now it's better, however the overall result of the request in my first comment is not replace, but merge. Datastore state before issuing the request:

<interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces">
  <interface>
    <name>GigabitEthernet0/8/0</name>
    <type>ethernetCsmacd</type>
    <ipv4 xmlns="urn:ietf:params:xml:ns:yang:ietf-ip">
      <address>
        <ip>192.0.2.10</ip>
        <prefix-length>24</prefix-length>
      </address>
    </ipv4>
  </interface>
</interfaces>

after the request:

<interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces">
  <interface>
    <name>GigabitEthernet0/8/0</name>
    <type>ethernetCsmacd</type>
    <ipv4 xmlns="urn:ietf:params:xml:ns:yang:ietf-ip">
      <address>
        <ip>192.0.2.10</ip>
        <prefix-length>24</prefix-length>
      </address>
      <address>
        <ip>192.0.2.4</ip>
        <prefix-length>24</prefix-length>
      </address>
    </ipv4>
  </interface>
</interfaces>

Logs:

netopeer2-server[16702]: Session 1: received message:
     <rpc message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
       <edit-config>
         <target>
           <running/>
         </target>
         <config xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0">
           <interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces">
             <interface xc:operation="replace">
               <name>GigabitEthernet0/8/0</name>
               <type>ethernetCsmacd</type>
               <ipv4 xmlns="urn:ietf:params:xml:ns:yang:ietf-ip">
                 <address>
                   <ip>192.0.2.4</ip>
                   <prefix-length>24</prefix-length>
                 </address>
               </ipv4>
             </interface>
           </interfaces>
         </config>
       </edit-config>
     </rpc>
netopeer2-server[16702]: DICT: inserting "rpc" with collision 
netopeer2-server[16702]: DICT: inserting "message-id" with collision 
netopeer2-server[16702]: DICT: inserting "101" with collision 
netopeer2-server[16702]: DICT: inserting (refcount) "urn:ietf:params:xml:ns:netconf:base:1.0"
netopeer2-server[16702]: DICT: inserting (refcount) "edit-config"
netopeer2-server[16702]: DICT: inserting (refcount) "target"
netopeer2-server[16702]: DICT: inserting (refcount) "running"
netopeer2-server[16702]: DICT: inserting (refcount) ""
netopeer2-server[16702]: DICT: inserting (refcount) ""
netopeer2-server[16702]: DICT: inserting (refcount) "config"
netopeer2-server[16702]: DICT: inserting "xc" with collision 
netopeer2-server[16702]: DICT: inserting (refcount) "urn:ietf:params:xml:ns:netconf:base:1.0"
netopeer2-server[16702]: DICT: inserting (refcount) "interfaces"
netopeer2-server[16702]: DICT: inserting (refcount) "urn:ietf:params:xml:ns:yang:ietf-interfaces"
netopeer2-server[16702]: DICT: inserting (refcount) "interface"
netopeer2-server[16702]: DICT: inserting (refcount) "operation"
netopeer2-server[16702]: DICT: inserting (refcount) "replace"
netopeer2-server[16702]: DICT: inserting (refcount) "name"
netopeer2-server[16702]: DICT: inserting "GigabitEthernet0/8/0" with collision 
netopeer2-server[16702]: DICT: inserting (refcount) "type"
netopeer2-server[16702]: DICT: inserting (refcount) "ethernetCsmacd"
netopeer2-server[16702]: DICT: inserting (refcount) "ipv4"
netopeer2-server[16702]: DICT: inserting (refcount) "urn:ietf:params:xml:ns:yang:ietf-ip"
netopeer2-server[16702]: DICT: inserting (refcount) "address"
netopeer2-server[16702]: DICT: inserting (refcount) "ip"
netopeer2-server[16702]: DICT: inserting "192.0.2.4" with collision 
netopeer2-server[16702]: DICT: inserting (refcount) "prefix-length"
netopeer2-server[16702]: DICT: inserting "24" with collision 
netopeer2-server[16702]: DICT: inserting (refcount) ""
netopeer2-server[16702]: DICT: inserting (refcount) ""
netopeer2-server[16702]: DICT: inserting (refcount) ""
netopeer2-server[16702]: DICT: inserting (refcount) ""
netopeer2-server[16702]: DICT: inserting (refcount) ""
netopeer2-server[16702]: DICT: inserting (refcount) ""
netopeer2-server[16702]: DICT: inserting (refcount) ""
netopeer2-server[16702]: DICT: inserting (refcount) "urn:ietf:params:xml:ns:netconf:base:1.0"
netopeer2-server[16702]: DICT: inserting (refcount) "xc"
netopeer2-server[16702]: DICT: inserting (refcount) "merge"
netopeer2-server[16702]: DICT: inserting (refcount) "test-then-set"
netopeer2-server[16702]: DICT: inserting (refcount) "stop-on-error"
netopeer2-server[16702]: Resolving unresolved data nodes and their constraints...
netopeer2-server[16702]: All data nodes and constraints resolved.
netopeer2-server[16702]: XPATH: expression "/ietf-netconf:edit-config/target/*":
netopeer2-server[16702]: XPATH:	Token Operator(Path), in expression "/"
netopeer2-server[16702]: XPATH:	Token NameTest, in expression "ietf-netconf:edit-config"
netopeer2-server[16702]: XPATH:	Token Operator(Path), in expression "/"
netopeer2-server[16702]: XPATH:	Token NameTest, in expression "target"
netopeer2-server[16702]: XPATH:	Token Operator(Path), in expression "/"
netopeer2-server[16702]: XPATH:	Token NameTest, in expression "*"
netopeer2-server[16702]: XPATH: eval_absolute_location_path parsed Operator(Path)[0]
netopeer2-server[16702]: DICT: inserting (refcount) "edit-config"
netopeer2-server[16702]: XPATH: eval_node_test              parsed NameTest[1]
netopeer2-server[16702]: XPATH: eval_relative_location_path parsed Operator(Path)[25]
netopeer2-server[16702]: DICT: inserting (refcount) "target"
netopeer2-server[16702]: XPATH: eval_node_test              parsed NameTest[26]
netopeer2-server[16702]: XPATH: eval_relative_location_path parsed Operator(Path)[32]
netopeer2-server[16702]: DICT: inserting "*" with collision 
netopeer2-server[16702]: XPATH: eval_node_test              parsed NameTest[33]
netopeer2-server[16702]: XPATH: expression "/ietf-netconf:edit-config/default-operation":
netopeer2-server[16702]: XPATH:	Token Operator(Path), in expression "/"
netopeer2-server[16702]: XPATH:	Token NameTest, in expression "ietf-netconf:edit-config"
netopeer2-server[16702]: XPATH:	Token Operator(Path), in expression "/"
netopeer2-server[16702]: XPATH:	Token NameTest, in expression "default-operation"
netopeer2-server[16702]: XPATH: eval_absolute_location_path parsed Operator(Path)[0]
netopeer2-server[16702]: DICT: inserting (refcount) "edit-config"
netopeer2-server[16702]: XPATH: eval_node_test              parsed NameTest[1]
netopeer2-server[16702]: XPATH: eval_relative_location_path parsed Operator(Path)[25]
netopeer2-server[16702]: DICT: inserting (refcount) "default-operation"
netopeer2-server[16702]: XPATH: eval_node_test              parsed NameTest[26]
netopeer2-server[16702]: XPATH: expression "/ietf-netconf:edit-config/test-option":
netopeer2-server[16702]: XPATH:	Token Operator(Path), in expression "/"
netopeer2-server[16702]: XPATH:	Token NameTest, in expression "ietf-netconf:edit-config"
netopeer2-server[16702]: XPATH:	Token Operator(Path), in expression "/"
netopeer2-server[16702]: XPATH:	Token NameTest, in expression "test-option"
netopeer2-server[16702]: XPATH: eval_absolute_location_path parsed Operator(Path)[0]
netopeer2-server[16702]: DICT: inserting (refcount) "edit-config"
netopeer2-server[16702]: XPATH: eval_node_test              parsed NameTest[1]
netopeer2-server[16702]: XPATH: eval_relative_location_path parsed Operator(Path)[25]
netopeer2-server[16702]: DICT: inserting (refcount) "test-option"
netopeer2-server[16702]: XPATH: eval_node_test              parsed NameTest[26]
netopeer2-server[16702]: XPATH: expression "/ietf-netconf:edit-config/error-option":
netopeer2-server[16702]: XPATH:	Token Operator(Path), in expression "/"
netopeer2-server[16702]: XPATH:	Token NameTest, in expression "ietf-netconf:edit-config"
netopeer2-server[16702]: XPATH:	Token Operator(Path), in expression "/"
netopeer2-server[16702]: XPATH:	Token NameTest, in expression "error-option"
netopeer2-server[16702]: XPATH: eval_absolute_location_path parsed Operator(Path)[0]
netopeer2-server[16702]: DICT: inserting (refcount) "edit-config"
netopeer2-server[16702]: XPATH: eval_node_test              parsed NameTest[1]
netopeer2-server[16702]: XPATH: eval_relative_location_path parsed Operator(Path)[25]
netopeer2-server[16702]: DICT: inserting (refcount) "error-option"
netopeer2-server[16702]: XPATH: eval_node_test              parsed NameTest[26]
netopeer2-server[16702]: XPATH: expression "/ietf-netconf:edit-config/config":
netopeer2-server[16702]: XPATH:	Token Operator(Path), in expression "/"
netopeer2-server[16702]: XPATH:	Token NameTest, in expression "ietf-netconf:edit-config"
netopeer2-server[16702]: XPATH:	Token Operator(Path), in expression "/"
netopeer2-server[16702]: XPATH:	Token NameTest, in expression "config"
netopeer2-server[16702]: XPATH: eval_absolute_location_path parsed Operator(Path)[0]
netopeer2-server[16702]: DICT: inserting (refcount) "edit-config"
netopeer2-server[16702]: XPATH: eval_node_test              parsed NameTest[1]
netopeer2-server[16702]: XPATH: eval_relative_location_path parsed Operator(Path)[25]
netopeer2-server[16702]: DICT: inserting (refcount) "config"
netopeer2-server[16702]: XPATH: eval_node_test              parsed NameTest[26]
netopeer2-server[16702]: DICT: inserting (refcount) "ethernetCsmacd"
netopeer2-server[16702]: DICT: inserting (refcount) "ethernetCsmacd"
netopeer2-server[16702]: EDIT_CONFIG: ds 25354112, defop 1, testopt 0, config:
<interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0">
  <interface nc:operation="replace">
    <name>GigabitEthernet0/8/0</name>
    <type>ethernetCsmacd</type>
    <ipv4 xmlns="urn:ietf:params:xml:ns:yang:ietf-ip">
      <address>
        <ip>192.0.2.4</ip>
        <prefix-length>24</prefix-length>
      </address>
    </ipv4>
  </interface>
</interfaces>
netopeer2-server[16702]: (cl_request_process:420) Sending session-refresh request.
netopeer2-server[16702]: (cl_request_process:442) session-refresh request sent, waiting for response.
netopeer2-server[16702]: (cl_request_process:464) session-refresh response received, processing.
netopeer2-server[16702]: EDIT_CONFIG: list /ietf-interfaces:interfaces/interface[name='GigabitEthernet0/8/0'], operation 3
netopeer2-server[16702]: (cl_request_process:420) Sending set-item request.
netopeer2-server[16702]: (cl_request_process:442) set-item request sent, waiting for response.
netopeer2-server[16702]: (cl_request_process:464) set-item response received, processing.
netopeer2-server[16702]: EDIT_CONFIG: success (/ietf-interfaces:interfaces/interface[name='GigabitEthernet0/8/0']).
netopeer2-server[16702]: EDIT_CONFIG: leaf /ietf-interfaces:interfaces/interface[name='GigabitEthernet0/8/0']/type, operation 3
netopeer2-server[16702]: (cl_request_process:420) Sending set-item request.
netopeer2-server[16702]: (cl_request_process:442) set-item request sent, waiting for response.
netopeer2-server[16702]: (cl_request_process:464) set-item response received, processing.
netopeer2-server[16702]: EDIT_CONFIG: success (/ietf-interfaces:interfaces/interface[name='GigabitEthernet0/8/0']/type).
netopeer2-server[16702]: EDIT_CONFIG: presence container /ietf-interfaces:interfaces/interface[name='GigabitEthernet0/8/0']/ietf-ip:ipv4, operation 3
netopeer2-server[16702]: (cl_request_process:420) Sending set-item request.
netopeer2-server[16702]: (cl_request_process:442) set-item request sent, waiting for response.
netopeer2-server[16702]: (cl_request_process:464) set-item response received, processing.
netopeer2-server[16702]: EDIT_CONFIG: success (/ietf-interfaces:interfaces/interface[name='GigabitEthernet0/8/0']/ietf-ip:ipv4).
netopeer2-server[16702]: EDIT_CONFIG: list /ietf-interfaces:interfaces/interface[name='GigabitEthernet0/8/0']/ietf-ip:ipv4/address[ip='192.0.2.4'], operation 3
netopeer2-server[16702]: (cl_request_process:420) Sending set-item request.
netopeer2-server[16702]: (cl_request_process:442) set-item request sent, waiting for response.
netopeer2-server[16702]: (cl_request_process:464) set-item response received, processing.
netopeer2-server[16702]: EDIT_CONFIG: success (/ietf-interfaces:interfaces/interface[name='GigabitEthernet0/8/0']/ietf-ip:ipv4/address[ip='192.0.2.4']).
netopeer2-server[16702]: EDIT_CONFIG: leaf /ietf-interfaces:interfaces/interface[name='GigabitEthernet0/8/0']/ietf-ip:ipv4/address[ip='192.0.2.4']/prefix-length, operation 3
netopeer2-server[16702]: (cl_request_process:420) Sending set-item request.
netopeer2-server[16702]: (cl_request_process:442) set-item request sent, waiting for response.
netopeer2-server[16702]: (cl_request_process:464) set-item response received, processing.
netopeer2-server[16702]: EDIT_CONFIG: success (/ietf-interfaces:interfaces/interface[name='GigabitEthernet0/8/0']/ietf-ip:ipv4/address[ip='192.0.2.4']/prefix-length).
netopeer2-server[16702]: (cl_request_process:420) Sending commit request.
netopeer2-server[16702]: (cl_request_process:442) commit request sent, waiting for response.
netopeer2-server[16702]: (cl_request_process:464) commit response received, processing.
netopeer2-server[16702]: EDIT_CONFIG: done.
netopeer2-server[16702]: Session 1: sending message:

#93

[2016/11/30 08:49:44.414255, 3] ssh_socket_unbuffered_write:  Enabling POLLOUT for socket
[2016/11/30 08:49:44.414273, 3] packet_send2:  packet: wrote [len=28,padding=13,comp=14,payload=14]
[2016/11/30 08:49:44.414295, 3] channel_write_common:  channel_write wrote 5 bytes
netopeer2-server[16702]: Session 1: sending message:
<rpc-reply message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"><ok/></rpc-reply>
[2016/11/30 08:49:44.414358, 3] packet_send2:  packet: wrote [len=108,padding=5,comp=102,payload=102]
[2016/11/30 08:49:44.414364, 3] channel_write_common:  channel_write wrote 93 bytes
[2016/11/30 08:49:44.414398, 3] ssh_socket_unbuffered_write:  Enabling POLLOUT for socket
netopeer2-server[16702]: Session 1: sending message:

##

[2016/11/30 08:49:44.414427, 3] packet_send2:  packet: wrote [len=28,padding=14,comp=13,payload=13]
[2016/11/30 08:49:44.414437, 3] channel_write_common:  channel_write wrote 4 bytes
[2016/11/30 08:49:44.414453, 3] ssh_socket_unbuffered_write:  Enabling POLLOUT for socket

@joanlandry
Copy link

joanlandry commented Nov 30, 2016

I am seeing the same issue using replace - the schema does not change - merge works fine.
I am using the master branch. Let me know if you need debug logs.

michalvasko added a commit that referenced this issue Dec 1, 2016
@michalvasko
Copy link
Member

Hi,
please try it again and perhaps it will finally work as expected.

Regards,
Michal

@rastislavs
Copy link
Contributor Author

It works now, thanks.

@rosy8
Copy link

rosy8 commented Mar 17, 2017

Hi Michal,

1) container X { ==>>with op ="replace
     list a {
      key "abc" ===>> keep the leaf name same
      leaf  y;  ======>>change the value of leaf node
   }
 }

Finding issue for "replace' at container level as shown below.

Mar 17 06:37:01   netopeer.sh[16306]: [2017/03/17 06:37:01.824583, 3] ssh_channel_read_timeout:  Read (1) buffered : 1 bytes. Window: 1267517
Mar 17 06:37:01   netopeer.sh[16306]: netopeer2-server[16353]: Session 1: received message:
Mar 17 06:37:01   netopeer.sh[16306]: <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="13">
Mar 17 06:37:01   netopeer.sh[16306]: <edit-config>
Mar 17 06:37:01   netopeer.sh[16306]: <target>
Mar 17 06:37:01   netopeer.sh[16306]: <candidate/>
Mar 17 06:37:01   netopeer.sh[16306]: </target>
Mar 17 06:37:01   netopeer.sh[16306]: <config>
Mar 17 06:37:01   netopeer.sh[16306]: <YYY-config xmlns="http://www.aaa.com/ns/XXX-config">
Mar 17 06:37:01   netopeer2-server[16353]: Resolving unresolved data nodes and their constraints...
Mar 17 06:37:01   netopeer2-server[16353]: All data nodes and constraints resolved.
Mar 17 06:37:01   netopeer.sh[16306]: <rate-profiles xmlns="http://www.aaa.com/ns/XXX-rate-profile" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" nc:operation="replace">   ====>> At container level
Mar 17 06:37:01   netopeer.sh[16306]: <rate-profile>
Mar 17 06:37:01   netopeer.sh[16306]: <name>xyz</name>
Mar 17 06:37:01   netopeer.sh[16306]: <cir>300000</cir>
Mar 17 06:37:01   netopeer.sh[16306]: <eir>200000</eir>
Mar 17 06:37:01   netopeer.sh[16306]: <cbs>163840</cbs>
Mar 17 06:37:01   netopeer.sh[16306]: <ebs>163840</ebs>
Mar 17 06:37:01   netopeer.sh[16306]: <color-enabled>false</color-enabled>
Mar 17 06:37:01   netopeer.sh[16306]: <coupling-enabled>false</coupling-enabled>
Mar 17 06:37:01   netopeer.sh[16306]: </rate-profile>
Mar 17 06:37:01   netopeer.sh[16306]: </rate-profiles>
Mar 17 06:37:01   netopeer.sh[16306]: </YYY-config>
Mar 17 06:37:01   netopeer.sh[16306]: </config>
Mar 17 06:37:01   netopeer.sh[16306]: </edit-config>
Mar 17 06:37:01   netopeer.sh[16306]: </rpc>
Mar 17 06:37:01   netopeer.sh[16306]: netopeer2-server[16353]: Resolving unresolved data nodes and their constraints...
Mar 17 06:37:01   netopeer.sh[16306]: netopeer2-server[16353]: All data nodes and constraints resolved.
Mar 17 06:37:01   netopeer.sh[16306]: netopeer2-server[16353]: EDIT_CONFIG: ds 10109888, defop merge, testopt 0, config:
Mar 17 06:37:01   netopeer.sh[16306]: <YYY-config xmlns="http://www.aaa.com/ns/XXX-config" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0">
Mar 17 06:37:01   netopeer.sh[16306]: <rate-profiles xmlns="http://www.aaa.com/ns/XXX-rate-profile" nc:operation="replace">
Mar 17 06:37:01   netopeer.sh[16306]: <rate-profile>
Mar 17 06:37:01   netopeer.sh[16306]: <name>xyz</name>
Mar 17 06:37:01   netopeer.sh[16306]: <cir>300000</cir>
Mar 17 06:37:01   netopeer.sh[16306]: <eir>200000</eir>
Mar 17 06:37:01   netopeer.sh[16306]: <cbs>163840</cbs>
Mar 17 06:37:01   netopeer.sh[16306]: <ebs>163840</ebs>
Mar 17 06:37:01   netopeer.sh[16306]: <color-enabled>false</color-enabled>
Mar 17 06:37:01   netopeer.sh[16306]: <coupling-enabled>false</coupling-enabled>
Mar 17 06:37:01   netopeer.sh[16306]: </rate-profile>
Mar 17 06:37:01   netopeer.sh[16306]: </rate-profiles>
Mar 17 06:37:01   netopeer.sh[16306]: </YYY-config>
Mar 17 06:37:01   netopeer.sh[16306]: netopeer2-server[16353]: EDIT_CONFIG: list /XXX-config:YYY-config/XXX-rate-profile:rate-profiles/rate-profile[name='xyz'], operation inner replace  ===>>Inner Replace
Mar 17 06:37:01   netopeer.sh[16306]: netopeer2-server[16353]: Sending set-item request.
Mar 17 06:37:01   netopeer.sh[16306]: netopeer2-server[16353]: set-item request sent, waiting for response.
Mar 17 06:37:01   netopeer2-server[16353]: Error by processing of the set-item request (session id=1897904990): The item already exists.
Mar 17 06:37:01   netopeer2-server[16353]: Error by processing of the request.
Mar 17 06:37:01   sysrepo.sh[5129]: [DBG] fd 6 readable
Mar 17 06:37:01   sysrepo.sh[5129]: [DBG] 139 bytes of data received on fd 6
Mar 17 06:37:01   sysrepo.sh[5129]: [DBG] fd 6 would block
Mar 17 06:37:01   sysrepo.sh[5129]: [DBG] New message of size 135 bytes received.
Mar 17 06:37:01   sysrepo.sh[5129]: [DBG] Circular buffer enqueue to position=1, current count=1.
Mar 17 06:37:01   sysrepo.sh[5129]: [DBG] Threads: active=0/4, 1 requests in queue
Mar 17 06:37:01   sysrepo.sh[5129]: [DBG] Thread id=140737297827584 signaled.
Mar 17 06:37:01   sysrepo.sh[5129]: [DBG] Circular buffer dequeue, new buffer head=2, count=0.
Mar 17 06:37:01   sysrepo.sh[5129]: [DBG] Processing set_item request.
Mar 17 06:37:01   sysrepo.sh[5129]: [INF] Set item request candidate datastore, xpath: /XXX-config:YYY-config/XXX-rate-profile:rate-profiles/rate-profile[name='xyz']
Mar 17 06:37:01   sysrepo.sh[5129]: [DBG] Module XXX-config already loaded
Mar 17 06:37:01   sysrepo.sh[5129]: [DBG] libyang error: Node already exists.
Mar 17 06:37:01   sysrepo.sh[5129]: [ERR] Setting of item failed /XXX-config:YYY-config/XXX-rate-profile:rate-profiles/rate-profile[name='xyz'] 74
Mar 17 06:37:01   sysrepo.sh[5129]: [ERR] Set item failed
Mar 17 06:37:01   sysrepo.sh[5129]: [ERR] Set item failed for '/XXX-config:YYY-config/XXX-rate-profile:rate-profiles/rate-profile[name='xyz']', session id=1897904990.
Mar 17 06:37:01   sysrepo.sh[5129]: [DBG] Circular buffer enqueue to position=3, current count=1.
Mar 17 06:37:01   sysrepo.sh[5129]: [DBG] Thread id=140737297827584 will wait.
Mar 17 06:37:01   sysrepo.sh[5129]: [DBG] New message enqueued into CM message queue.
Mar 17 06:37:01   sysrepo.sh[5129]: [DBG] Circular buffer dequeue, new buffer head=4, count=0.
Mar 17 06:37:01   sysrepo.sh[5129]: [DBG] Sending 30 bytes of data.
Mar 17 06:37:01   sysrepo.sh[5129]: [DBG] 30 bytes of data sent.
Mar 17 06:37:01   netopeer.sh[16306]: netopeer2-server[16353]: set-item response received, processing.
Mar 17 06:37:01   netopeer.sh[16306]: netopeer2-server[16353]: Error by processing of the set-item request (session id=1897904990): The item already exists.
Mar 17 06:37:01   netopeer.sh[16306]: netopeer2-server[16353]: Error by processing of the request.
Mar 17 06:37:01   netopeer.sh[16306]: netopeer2-server[16353]: EDIT_CONFIG: stop-on-error (Request could not be completed because the relevant data model content already exists.).
Mar 17 06:37:01   netopeer.sh[16306]: netopeer2-server[16353]: Sending validate request.
Mar 17 06:37:01   netopeer.sh[16306]: netopeer2-server[16353]: validate request sent, waiting for response.
Mar 17 06:37:01   sysrepo.sh[5129]: [DBG] fd 6 readable
Mar 17 06:37:01   sysrepo.sh[5129]: [DBG] 30 bytes of data received on fd 6
Mar 17 06:37:01   sysrepo.sh[5129]: [DBG] fd 6 would block
Mar 17 06:37:01   sysrepo.sh[5129]: [DBG] New message of size 26 bytes received.
Mar 17 06:37:01   sysrepo.sh[5129]: [DBG] Circular buffer enqueue to position=2, current count=1.
Mar 17 06:37:01   sysrepo.sh[5129]: [DBG] Threads: active=0/4, 1 requests in queue
Mar 17 06:37:01   sysrepo.sh[5129]: [DBG] Thread id=140737306220288 signaled.
Mar 17 06:37:01   sysrepo.sh[5129]: [DBG] Circular buffer dequeue, new buffer head=3, count=0.
Mar 17 06:37:01   sysrepo.sh[5129]: [DBG] Processing validate request.
Mar 17 06:37:01   sysrepo.sh[5129]: [DBG] Circular buffer enqueue to position=4, current count=1.
Mar 17 06:37:01   sysrepo.sh[5129]: [DBG] Thread id=140737306220288 will wait.
Mar 17 06:37:01   sysrepo.sh[5129]: [DBG] New message enqueued into CM message queue.
Mar 17 06:37:01   sysrepo.sh[5129]: [DBG] Circular buffer dequeue, new buffer head=5, count=0.
Mar 17 06:37:01   sysrepo.sh[5129]: [DBG] Sending 30 bytes of data.
Mar 17 06:37:01   sysrepo.sh[5129]: [DBG] 30 bytes of data sent.
Mar 17 06:37:01   netopeer.sh[16306]: netopeer2-server[16353]: validate response received, processing.
Mar 17 06:37:01   netopeer.sh[16306]: netopeer2-server[16353]: Session 1: sending message:
Mar 17 06:37:01   netopeer.sh[16306]: #477
Mar 17 06:37:01   netopeer.sh[16306]: [2017/03/17 06:37:01.825627, 3] ssh_socket_unbuffered_write:  Enabling POLLOUT for socket
Mar 17 06:37:01   netopeer.sh[16306]: [2017/03/17 06:37:01.825641, 3] packet_send2:  packet: wrote [len=28,padding=12,comp=15,payload=15]
Mar 17 06:37:01   netopeer.sh[16306]: [2017/03/17 06:37:01.825648, 3] channel_write_common:  channel_write wrote 6 bytes
Mar 17 06:37:01   netopeer.sh[16306]: netopeer2-server[16353]: Session 1: sending message:
Mar 17 06:37:01   netopeer.sh[16306]: <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="13"><rpc-error><error-type>application</error-type><error-tag>data-exists</error-tag><error-severity>error</error-severity><error-path>/XXX-config:YYY-config/XXX-rate-profile:rate-profiles/rate-profile[name='xyz']</error-path><error-message xml:lang="en">Request could not be completed because the relevant data model content already exists.</error-message></rpc-error></rpc-reply>
Mar 17 06:37:01   netopeer.sh[16306]: [2017/03/17 06:37:01.825679, 3] packet_send2:  packet: wrote [len=492,padding=5,comp=486,payload=486]
Mar 17 06:37:01   netopeer.sh[16306]: [2017/03/17 06:37:01.825687, 3] channel_write_common:  channel_write wrote 477 bytes
Mar 17 06:37:01   netopeer.sh[16306]: [2017/03/17 06:37:01.825697, 3] ssh_socket_unbuffered_write:  Enabling POLLOUT for socket
Mar 17 06:37:01   netopeer.sh[16306]: netopeer2-server[16353]: Session 1: sending message:
Mar 17 06:37:01   netopeer.sh[16306]: ##
Mar 17 06:37:01   netopeer.sh[16306]: [2017/03/17 06:37:01.825716, 3] packet_send2:  packet: wrote [len=28,padding=14,comp=13,payload=13]
Mar 17 06:37:01   netopeer.sh[16306]: [2017/03/17 06:37:01.825723, 3] channel_write_common:  channel_write wrote 4 bytes
Mar 17 06:37:01   netopeer.sh[16306]: [2017/03/17 06:37:01.825731, 3] ssh_socket_unbuffered_write:  Enabling POLLOUT for socket
Mar 17 06:37:30   ctrlAgent[11424]: WARN [ctrlWorker.py:ctrl_monitor_worker:340] Failed to stat /etc/ovn/openstack_vars.json

@michalvasko
Copy link
Member

Hi,
could you please provide again the original configuration, your edit-config and the unexpected result? Thanks.

Regards,
Michal

@michalvasko michalvasko reopened this Mar 17, 2017
@rosy8
Copy link

rosy8 commented Mar 17, 2017

Hi Michal,

=======Existing running config ===========================

<?xml version="1.0" encoding="utf-8"?>
<data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <ensemble-config xmlns="http://www.aaa.com/ns/XXX-config">
    <rate-profiles xmlns="http://www.aaa.com/ns/XXX-rate-profile">
      <rate-profile>
        <name>xyz</name>
        <cir>0</cir>
        <eir>0</eir>
        <cbs>163840</cbs>
        <ebs>163840</ebs>
        <color-enabled>false</color-enabled>
        <coupling-enabled>false</coupling-enabled>
      </rate-profile>
    </rate-profiles>
  </ensemble-config>
</data>

=============Edit-config with op+replace at container level ======================

<?xml version="1.0" encoding="utf-8"?>
<rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="">
  <edit-config>
    <target>
      <candidate/>
    </target>
    <config>
      <ensemble-config xmlns="http://www.aaa.com/ns/XXX-config">
        <rate-profiles xmlns="http://www.aaa.com/ns/XXX-rate-profile" nc:operation="replace" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0">
          <rate-profile>
            <name>xyz</name>  ======>> same list with only leaf value updated 
            <cir>100000</cir>
            <eir>100000</eir>
            <cbs>1048576</cbs> 
            <ebs>163840</ebs>
            <color-enabled>false</color-enabled>
            <coupling-enabled>false</coupling-enabled>
          </rate-profile>
        </rate-profiles>
      </ensemble-config>
    </config>
  </edit-config>
</rpc>

=====================Expected config =====================

<?xml version="1.0" encoding="utf-8"?>
<data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <ensemble-config xmlns="http://www.aaa.com/ns/XXX-config">
    <rate-profiles xmlns="http://www.aaa.com/ns/XXX-rate-profile">
      <rate-profile>
        <name>xyz</name>
            <cir>100000</cir>
            <eir>100000</eir>
            <cbs>1048576</cbs> 
            <ebs>163840</ebs>
        <color-enabled>false</color-enabled>
        <coupling-enabled>false</coupling-enabled>
      </rate-profile>
    </rate-profiles>
  </ensemble-config>
</data>

Regards,
Rosy

@rosy8
Copy link

rosy8 commented Mar 17, 2017

Hi Michal,

The one I have posted is replace at container level. But we had tried with replace op at leaf level. And found that that also have some issue. But replace op at list level is working fine.

Regards,
Rosy

@rosy8
Copy link

rosy8 commented Mar 20, 2017

Hi Michal,

Did you get a chance to look in to this issue ?
Thanks in advance.

Regards,
Rosy

michalvasko added a commit that referenced this issue Mar 21, 2017
@michalvasko
Copy link
Member

Hi Rosy,
yes, I finally got to it, please try it now.

Regards,
Michal

@rosy8
Copy link

rosy8 commented Mar 21, 2017

Hi Michal,

Sure. So with the latest code now replace will work at the container and leaf level too ?
Thank you very much.

Regards,
Rosy

@michalvasko
Copy link
Member

Well, I hope so.

Michal

syyyr pushed a commit to syyyr/netopeer2 that referenced this issue Sep 10, 2020
Use proper size for inet_ntop's buffer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants