Uploaded image for project: 'netconf'
  1. netconf
  2. NETCONF-833

Leaf Node cannot be deleted inside NETCONF device via RESTCONF

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Medium Medium
    • 2.0.12
    • 2.0.5
    • netconf

      Populate leaf node data cannot be erased by RESTCONF DELETE request. Request will fail on

      {
          "errors": {
              "error": [
                  {
                      "error-tag": "operation-failed",
                      "error-info": "java.lang.IllegalStateException: Value has not been set",
                      "error-message": "Transaction failed",
                      "error-type": "application"
                  }
              ]
          }
      }
      

      In attachment is provided karaf.log file.

      Used YANG model:

      module test-model {  
        namespace "test:model";
        prefix tm;  
        revision 2021-11-11 {
          description "Initial revision.";
        }
        
        container test-container {
          leaf test-data {
            type string;
          }
        }
      }
      

      Steps to reproduce:

      1. Add test-model.yang file to karaf schema `netconf/karaf/target/assembly/cache/schema`
      2. Start netconf-testtool with path to test-model.yang
      java -Xmx1G -jar netconf-testtool-2.0.9-SNAPSHOT-executable.jar --schemas-dir SCHEMA_PATH --device-count 1 --debug false --starting-port 36001 --ssh true --md-sal false
      
      1. Start karaf and install features `odl-restconf-all` and `odl-netconf-topology`
      2. Connect netconf-testtol to Netconf:
      curl --request PUT 'http://localhost:8181/rests/data/network-topology:network-topology/topology=topology-netconf/node=new-netconf-device' \
      --header 'Content-Type: application/json' \
      --header 'Accept: application/json' \
      --header 'Authorization: Basic YWRtaW46YWRtaW4=' \
      --data-raw '{
          "node": [
              {
                  "node-id": "new-netconf-device",
                  "netconf-node-topology:port": 36001,
                  "netconf-node-topology:reconnect-on-changed-schema": false,
                  "netconf-node-topology:connection-timeout-millis": 20000,
                  "netconf-node-topology:tcp-only": false,
                  "netconf-node-topology:max-connection-attempts": 0,
                  "netconf-node-topology:username": "admin",
                  "netconf-node-topology:password": "admin",
                  "netconf-node-topology:sleep-factor": 1.5,
                  "netconf-node-topology:host": "127.0.0.1",
                  "netconf-node-topology:between-attempts-timeout-millis": 2000,
                  "netconf-node-topology:keepalive-delay": 120
              }
          ]
      }'
      
      1. Verify that device is connected.
      2. Populate test-data inside netconf-testtool
      curl --request PUT 'http://localhost:8181/rests/data/network-topology:network-topology/topology=topology-netconf/node=new-netconf-device/yang-ext:mount/test-model:test-container' \
      --header 'Content-Type: application/json' \
      --header 'Accept: application/json' \
      --header 'Authorization: Basic YWRtaW46YWRtaW4=' \
      --data-raw '{
          "test-model:test-container": {
              "test-data": "data"
          }
      }'
      
      1. Verify that data was written
      2. Try to delete test-data
      curl --request DELETE 'http://localhost:8181/rests/data/network-topology:network-topology/topology=topology-netconf/node=new-netconf-device/yang-ext:mount/test-model:test-container/test-data' \
      --header 'Content-Type: application/json' \
      --header 'Accept: application/json' \
      --header 'Authorization: Basic YWRtaW46YWRtaW4=' \
      --data-raw ''
      

       

       

      The issue was reported on lighty.io:

      https://github.com/PANTHEONtech/lighty/issues/843

        1. delete-container.log
          2 kB
        2. delete-leaf.log
          2 kB
        3. fix.log
          2 kB
        4. karaf.log
          756 kB

            ivanhrasko Ivan Hrasko
            PeterSuna Peter Suna
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: