Uploaded image for project: 'Configuration Persistence Service'
  1. Configuration Persistence Service
  2. CPS-464

Request to update node leaves (patch) responds with Internal Server Error

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Medium Medium
    • Istanbul Release
    • Istanbul Release
    • CPS-Core
    • None

      Expected behaviour:

      • When sending a request to update a node leave, either
        • the request is successfully proceeded and response code is 2xx
        • or client request is not valid and response code is 4xx with a meaningful explanation of the reason why the request is not valid.

      Actual behaviour:

      • Request is not proceeded and response code is 500

      Steps to reproduce:

      1. Create a dataspace: 

      curl -X POST 'http://localhost:8080/cps/api/v1/dataspaces?dataspace-name=bsa-dataspace-7' \-H 'Authorization: Basic Y3BzdXNlcjpjcHNyMGNrcyE='
      

      2. Create a schema set with attached bookstore.yang 

      curl -X POST 'http://localhost:8080/cps/api/v1/dataspaces/bsa-dataspace-7/schema-sets' \-H 'Authorization: Basic Y3BzdXNlcjpjcHNyMGNrcyE=' \-F 'file=@"/bookstore.yang"' \-F 'schema-set-name="bsa-schema-set"'
      

      3. Create an anchor

      curl -X POST 'http://localhost:8080/cps/api/v1/dataspaces/bsa-dataspace-7/anchors?schema-set-name=bsa-schema-set&anchor-name=bsa-anchor' \
      -H 'Authorization: Basic Y3BzdXNlcjpjcHNyMGNrcyE='
      

      4. Add a node

      curl -X POST 'http://localhost:8080/cps/api/v1/dataspaces/bsa-dataspace-7/anchors/bsa-anchor/nodes' \
      -H 'Authorization: Basic Y3BzdXNlcjpjcHNyMGNrcyE=' \
      -H 'Content-Type: application/json' \
      --data-raw '{
         "bookstore":{
            "bookstore-name": "Chapters",
            "categories": [
               {
                  "code": "01",
                  "name": "SciFi",
                  "books": [
                     {
                        "authors": [
                           "Iain M. Banks"
                        ],
                        "lang": "en",
                        "price": "895",
                        "pub_year": "1994",
                        "title": "Feersum Endjinn"
                     },
                     {
                        "authors": [
                           "Ursula K. Le Guin",
                           "Joe Haldeman",
                           "Orson Scott Card",
                           "david Brin",
                           "Rober Silverberg",
                           "Dan Simmons",
                           "Greg Bear"
                        ],
                        "lang": "en",
                        "price": "1099",
                        "pub_year": "1999",
                        "title": "Far Horizons"
                     }
                  ]
               },
               {
                  "name": "kids",
                  "code": "02",
                  "books": [
                     {
                        "authors": [
                           "Philip Pullman"
                        ],
                        "lang": "en",
                        "price": "699",
                        "pub_year": "1995",
                        "title": "The Golden Compass"
                     }
                  ]
               }
            ]
         }
      }
      '
      

      5. Update a node leaf:

      curl -g -X PATCH 'http://localhost:8080/cps/api/v1/dataspaces/bsa-dataspace-7/anchors/bsa-anchor/nodes?xpath=/bookstore/categories[@code=%2701%27]' \-H 'Authorization: Basic Y3BzdXNlcjpjcHNyMGNrcyE=' \-H 'Content-Type: application/json' \--data-raw '{    "name": "bsa"}'
      

      Http response is:

      {
          "status": "500 INTERNAL_SERVER_ERROR",
          "message": null,
          "details": "Check logs for details."
      }
      

      See error.log for the logs

       

       

       

        1. bookstore.yang
          0.9 kB
        2. error.log
          22 kB

            niamhcore niamhcore
            brusak brusak
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: