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

RestconfSchemaService returns 500 for device model

    XMLWordPrintable

Details

    • Bug
    • Status: Open
    • Medium
    • Resolution: Unresolved
    • 7.0.0
    • None
    • restconf-nb

    Description

      When sending a GET request to the test-tool device with, for example, the 'toaster2' model, it responds with a 500 error when asked for the 'Accept: application/yang' header.

      http://192.168.56.100:8181/rests/modules/network-topology:network-topology/topology=topology-netconf/node=36001-sim-device/yang-ext:mount/toaster2/2009-11-20

      The same request but with "Accept: application/yin+xml" header is working.

      • Sending application/yang headers is working for controller models.
      • In Karaf logs, there are no errors.
      • Creating SchemaExportContext is successful for the device model. The exception is thrown in YangSchemaExportBodyWriter with the message:  "Unable to retrieve source from SourceProvider."
      0 = {StackTraceElement@25842} "org.opendaylight.restconf.nb.rfc8040.jersey.providers.YangSchemaExportBodyWriter.writeTo(YangSchemaExportBodyWriter.java:42)"
      1 = {StackTraceElement@25843} "org.opendaylight.restconf.nb.rfc8040.jersey.providers.YangSchemaExportBodyWriter.writeTo(YangSchemaExportBodyWriter.java:28)"
      2 = {StackTraceElement@25844} "org.glassfish.jersey.message.internal.WriterInterceptorExecutor$TerminalWriterInterceptor.invokeWriteTo(WriterInterceptorExecutor.java:242)"
      3 = {StackTraceElement@25845} "org.glassfish.jersey.message.internal.WriterInterceptorExecutor$TerminalWriterInterceptor.aroundWriteTo(WriterInterceptorExecutor.java:227)"
      4 = {StackTraceElement@25846} "org.glassfish.jersey.message.internal.WriterInterceptorExecutor.proceed(WriterInterceptorExecutor.java:139)"
      5 = {StackTraceElement@25847} "org.glassfish.jersey.server.internal.JsonWithPaddingInterceptor.aroundWriteTo(JsonWithPaddingInterceptor.java:85)"

      The issue arises from the invocation of context.sourceProvider() within the YangSchemaExportBodyWriter class. This DOMYangTextSourceProvider contains controller models. Probably it will be required to explore alternative methods for generating the YangTextSchemaSource. For example, as it is done in 
      YinSchemaExportBodyWriter.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            ivanhrasko Ivan Hrasko
            PeterSuna Peter Suna
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: