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

RESTCONF PATCH with empty body results in a NPE

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Medium Medium
    • 2.0.3, 1.13.5
    • 2.0.2
    • restconf-nb

      A simple request

      curl -u admin:admin -X PATCH http://localhost:8181/rests/data/network-topology:network-topology/topology=topology-netconf
      

      results in

       

      *   Trying ::1:8181...
      * Connected to localhost (::1) port 8181 (#0)
      * Server auth using Basic with user 'admin'
      > PATCH /rests/data/network-topology:network-topology/topology=topology-netconf HTTP/1.1
      > Host: localhost:8181
      > Authorization: Basic YWRtaW46YWRtaW4=
      > User-Agent: curl/7.76.1
      > Accept: */*
      >  
      * Mark bundle as not supporting multiuse
      < HTTP/1.1 500 Server Error
      < Set-Cookie: JSESSIONID=node0muwoo6y6g4fcpsxwwqwnqira1.node0; Path=/; HttpOnly
      < Set-Cookie: rememberMe=deleteMe; Path=/; Max-Age=0; Expires=Thu, 12-Aug-2021 13:49:51 GMT; SameSite=lax
      < Connection: close
      <  
      * Closing connection 0
      

       

      which is caused by this splat:

      2021-08-13T15:47:13,449 | WARN  | qtp376242490-399 | HttpChannel                      | 154 - org.eclipse.jetty.util - 9.4.40.v20210413 | /rests/data/network-topology:network-topology/topology=topology-netconf
      javax.servlet.ServletException: javax.servlet.ServletException: java.lang.NullPointerException
              at org.ops4j.pax.web.service.jetty.internal.JettyServerHandlerCollection.handle(JettyServerHandlerCollection.java:90) ~[?:?]
      
      [snip]
      
      Caused by: java.lang.NullPointerException
              at java.util.Objects.requireNonNull(Objects.java:221) ~[?:?]
              at org.opendaylight.restconf.nb.rfc8040.rests.services.impl.RestconfDataServiceImpl.patchData(RestconfDataServiceImpl.java:331) ~[?:?]
              at org.opendaylight.restconf.nb.rfc8040.rests.services.impl.RestconfDataServiceImpl.patchData(RestconfDataServiceImpl.java:326) ~[?:?]
              at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
      
      

            rovarga Robert Varga
            rovarga Robert Varga
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: