[NETCONF-803] RESTCONF PATCH with empty body results in a NPE Created: 13/Aug/21 Updated: 13/Aug/21 Resolved: 13/Aug/21 |
|
| Status: | Resolved |
| Project: | netconf |
| Component/s: | restconf-nb |
| Affects Version/s: | 2.0.2 |
| Fix Version/s: | 2.0.3, 1.13.5 |
| Type: | Bug | Priority: | Medium |
| Reporter: | Robert Varga | Assignee: | Robert Varga |
| Resolution: | Done | Votes: | 0 |
| Labels: | pt | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
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) ~[?:?] |