[CONTROLLER-230] Error 500 on GET/OPTIONS Created: 24/Mar/14 Updated: 25/Jul/23 Resolved: 11/Sep/14 |
|
| Status: | Resolved |
| Project: | controller |
| Component/s: | restconf |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | ||
| Reporter: | Wojciech Dec | Assignee: | Unassigned |
| Resolution: | Cannot Reproduce | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Operating System: Mac OS |
||
| External issue ID: | 573 |
| Priority: | Normal |
| Description |
|
On doing a GET ODL receive sends an 500 HTTP error, with the following output. Possibly a netconf problem... <html><head><title>Apache Tomcat/7.0.32 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;}H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;}H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;}BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;}B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;}P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 500 - </h1><HR size="1" noshade="noshade"><p><b>type</b> Exception report</p><p><b>message</b> <u></u></p><p><b>description</b> <u>The server encountered an internal error that prevented it from fulfilling this request.</u></p><p><b>exception</b> <pre>java.lang.NullPointerException |
| Comments |
| Comment by Tony Tkacik [ 28/Mar/14 ] |
|
Please make sure if the ietf-inet-types and ietf-yang-types are in cache/schema folder. Some network devices fail to provide this YANG modules, and reading anything IP related then will fail in similar extension. |
| Comment by Tony Tkacik [ 28/Mar/14 ] |
|
Please make sure if the ietf-inet-types and ietf-yang-types are in cache/schema folder. Some network devices fail to provide this YANG modules, and reading anything IP related then will fail in similar extension. |
| Comment by Wojciech Dec [ 28/Mar/14 ] |
|
Hi, yes, the schema are all there. I traced down the problem to the following however: |
| Comment by Tony Tkacik [ 02/Apr/14 ] |
|
Changed to enhancement, since this is improving error reporting. |
| Comment by Wojciech Dec [ 02/Apr/14 ] |
|
Sending a GET for a resource foo that is not in the data store should return an Error 400. Replying with an Error 500 (server error + java backtrace) does not appear to be proper, and it doesn't look like an enhancement, esp since it is also not compliant with the Restconf spec. It is also inconsistent with the rest of the RESTConf ASPI response codes, which when interrogated with a GET for a non existing item "foo" in the data tree returns an Error 400: URI has bad format. "foo" was not found in parent data node. |
| Comment by Wojciech Dec [ 02/Apr/14 ] |
|
Same behavior observed on OPTIONS. |
| Comment by Wojciech Dec [ 23/May/14 ] |
|
Changing back to bug, since it's in effect an improperly handled exception. |
| Comment by Tom Pantelis [ 28/May/14 ] |
|
At the very least the NullPointerException is a bug and should be fixed. The code path has since changed so the methods/line numbers don't match the trace above but it looks like line 430 in XmlDocumentUtils.toDomNode is here: NodeList nodes = element.getChildNodes(); So getChildNodes returned null which indicates an empty root element. We should protect against that. I suspect the device returned a valid response but with no data. Whether rest should report 400 or 404 is another story. Basically the mount point is a pass thru to the device so rest should report whatever the device reports. If the query was invalid then the device should report it as such but apparently it didn't. |
| Comment by Tony Tkacik [ 11/Sep/14 ] |
|
This bug is observed in old code path to Netconf, which is not actual anymore. Unable to reproduce with new code path to Netconf. |