[NETCONF-822] Discover RPC operation through RESTCONF is failing with response 500 Created: 29/Sep/21 Updated: 05/Oct/21 Resolved: 05/Oct/21 |
|
| Status: | Resolved |
| Project: | netconf |
| Component/s: | restconf-nb |
| Affects Version/s: | 2.0.5 |
| Fix Version/s: | 2.0.6 |
| Type: | Bug | Priority: | Highest |
| Reporter: | Peter Suna | Assignee: | Robert Varga |
| Resolution: | Done | Votes: | 0 |
| Labels: | pt, regression | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Attachments: |
|
||||||||||||||||
| Issue Links: |
|
||||||||||||||||
| Description |
|
Steps to reproduce:
Caused by: java.lang.IllegalArgumentException: Data tree child (urn:ietf:params:xml:ns:yang:ietf-restconf)operations not present at org.opendaylight.yangtools.yang.model.util.SchemaInferenceStack.lambda$pushData$5(SchemaInferenceStack.java:799) ~[?:?] at java.util.Optional.orElseThrow(Optional.java:408) ~[?:?] at org.opendaylight.yangtools.yang.model.util.SchemaInferenceStack.pushData(SchemaInferenceStack.java:798) ~[?:?] at org.opendaylight.yangtools.yang.model.util.SchemaInferenceStack.pushFirstData(SchemaInferenceStack.java:807) ~[?:?] at org.opendaylight.yangtools.yang.model.util.SchemaInferenceStack.pushData(SchemaInferenceStack.java:787) ~[?:?] at org.opendaylight.yangtools.yang.model.util.SchemaInferenceStack.enterDataTree(SchemaInferenceStack.java:473) ~[?:?] at org.opendaylight.yangtools.yang.data.util.NormalizedNodeStreamWriterStack.enterDataTree(NormalizedNodeStreamWriterStack.java:187) ~[?:?] at org.opendaylight.yangtools.yang.data.util.NormalizedNodeStreamWriterStack.startContainerNode(NormalizedNodeStreamWriterStack.java:259) ~[?:?] at org.opendaylight.yangtools.yang.data.codec.gson.JSONNormalizedNodeStreamWriter.startContainerNode(JSONNormalizedNodeStreamWriter.java:305) ~[?:?] at org.opendaylight.restconf.nb.rfc8040.jersey.providers.ParameterAwareNormalizedNodeWriter.wasProcessedAsCompositeNode(ParameterAwareNormalizedNodeWriter.java:265) ~[?:?] at org.opendaylight.restconf.nb.rfc8040.jersey.providers.ParameterAwareNormalizedNodeWriter.write(ParameterAwareNormalizedNodeWriter.java:117) ~[?:?] at org.opendaylight.restconf.nb.rfc8040.jersey.providers.ParameterAwareNormalizedNodeWriter$OrderedParameterAwareNormalizedNodeWriter.write(ParameterAwareNormalizedNodeWriter.java:323) ~[?:?] at org.opendaylight.restconf.nb.rfc8040.jersey.providers.JsonNormalizedNodeBodyWriter.writeNormalizedNode(JsonNormalizedNodeBodyWriter.java:134) ~[?:?] at org.opendaylight.restconf.nb.rfc8040.jersey.providers.JsonNormalizedNodeBodyWriter.writeTo(JsonNormalizedNodeBodyWriter.java:72) ~[?:?] at org.opendaylight.restconf.nb.rfc8040.jersey.providers.JsonNormalizedNodeBodyWriter.writeTo(JsonNormalizedNodeBodyWriter.java:47) ~[?:?] More in attached Karaf logs and debug capture. |
| Comments |
| Comment by Robert Varga [ 29/Sep/21 ] |
|
So from cursory glance there seems to be a disconnect between OperationsContainerSchemaNode, which reports its SchemaPath as /operations and JsonNormalizedNodeBodyWriter, which uses that to guide the JSON codec, which in turn talks to SchemaInferenceStack. Previously we just passed the OperationsContainerSchemaNode down the codec pipeline, which did its magic and happened to not trip over things like leafrefs (because there none), it's just simple empty leaves. This is rather unfortunate, as there is no straightforward way to fix this while retaining YANG-based codecs. Essentially ietf-restconf.yang forbids those leaves from existing as a baseline, simply because they do not exist in YANG model. The 'description' statement, no matter how long it is, simply is not something YANG parser can use to conjure up the corresponding 'leaf' statements into existence. |
| Comment by Robert Varga [ 29/Sep/21 ] |
|
So there are essentially two things we could do:
The second option does not work for bierman02, as it does not have a YANG extension and therefore YANG parser will not do anything for it. So let us:
|
| Comment by Robert Varga [ 29/Sep/21 ] |
|
So this is a major regression and it warrants a standalone release and perhaps re-spinning the (now 2 weeks late) Phosphorus GA. |