[YANGTOOLS-532] YIN generation failed on openflow-protocol module Created: 20/Oct/15  Updated: 10/Apr/22  Resolved: 03/Nov/15

Status: Resolved
Project: yangtools
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug
Reporter: Daniel Malachovsky Assignee: Peter Kajsa
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Attachments: File openflow-protocol.xml    
External issue ID: 4504
Priority: Normal

 Description   

YIN generated from openflow-protocol module is incomplete. See attachment.

How to reproduce:

  • running controller
  • installed odl-openflowjava-protocol, odl-restonf features
  • get http://controllerIP:8181/restconf/modules/module/openflow-protocol/2013-07-31/schema
  • result is incomplete XML

End of XML looks like:

<notification name="error-message">
<status value="current"></status>
<reference>
<text>OFPT_ERROR message in Openflow Switch 1.3 Spec</text>
</reference>
<uses name="error"></uses>

Other openflow-* YIN are generated fine, but openflow-protocol is fairly big, so maybe that's the issue.



 Comments   
Comment by Daniel Malachovsky [ 20/Oct/15 ]

Attachment openflow-protocol.xml has been added with description: Response from /restconf/modules/module/openflow-protocol/2013-07-31/schema

Comment by Martin Ciglan [ 21/Oct/15 ]

karaf log at the time of request:

Caused by: javax.xml.stream.XMLStreamException: Prefix cannot be null
at com.sun.xml.internal.stream.writers.XMLStreamWriterImpl.writeStartElement(XMLStreamWriterImpl.java:1295)[:1.8.0_25]
at com.sun.xml.internal.stream.writers.XMLStreamWriterImpl.writeStartElement(XMLStreamWriterImpl.java:1273)[:1.8.0_25]
at org.opendaylight.yangtools.yang.model.export.SingleModuleYinStatementWriter.writeStartXmlElement(SingleModuleYinStatementWriter.java:218)[238:org.opendaylight.yangtools.yang-model-export:0.8.0.SNAPSHOT]
at org.opendaylight.yangtools.yang.model.export.SingleModuleYinStatementWriter.startStatement(SingleModuleYinStatementWriter.java:71)[238:org.opendaylight.yangtools.yang-model-export:0.8.0.SNAPSHOT]
... 52 more

Comment by Martin Ciglan [ 21/Oct/15 ]

I took relevant set of YANG models from openflowjava & ietf and export them via yang-model-export to YIN without any issue. I'll try to debug it further more...

Comment by Martin Ciglan [ 22/Oct/15 ]

my latest findings while debugging mentioned request:
there is an issue with yang-ext module as I can see status at relevant breakpoint:

namespace: "urn:opendaylight:yang:extension:yang-ext""
localName: "augment-identifier"

In XMLStreamWriterImpl.writeStartElement() and then NamespaceContextImpl.getPrefix(namespaceURI) returns null as we can observe in log. I can't see mentioned namespace in collection where look-up occurs:

0 =

{java.lang.String@13663}

"xml"
1 =

{java.lang.String@13664}

"http://www.w3.org/XML/1998/namespace"
2 =

{java.lang.String@13665}

"xmlns"
3 =

{java.lang.String@13666}

"http://www.w3.org/2000/xmlns/"
4 =

{java.lang.String@13195} ""
5 = {java.lang.String@13098} "urn:ietf:params:xml:ns:yang:yin:1"
6 = {java.lang.String@13195}

""
7 =

{java.lang.String@13098}

"urn:ietf:params:xml:ns:yang:yin:1"
8 =

{java.lang.String@13667}

"yang"
9 =

{java.lang.String@13668}

"urn:ietf:params:xml:ns:yang:ietf-yang-types"
10 =

{java.lang.String@13669}

"oxm"
11 =

{java.lang.String@13670}

"urn:opendaylight:openflow:oxm"
12 =

{java.lang.String@13671}

"oft"
13 =

{java.lang.String@13672}

"urn:opendaylight:openflow:common:types"
14 =

{java.lang.String@13673}

"ofinstruction"
15 =

{java.lang.String@13674}

"urn:opendaylight:openflow:common:instruction"
16 =

{java.lang.String@13675}

"ofproto"
17 =

{java.lang.String@13676}

"urn:opendaylight:openflow:protocol"
18 =

{java.lang.String@13677}

"ofaction"
19 =

{java.lang.String@13678}

"urn:opendaylight:openflow:common:action"

It needs further investigation.

Comment by Peter Kajsa [ 28/Oct/15 ]

fix: https://git.opendaylight.org/gerrit/#/c/28894/1

Comment by Daniel Malachovsky [ 30/Oct/15 ]

Tested the fix, export works correctly now.

Generated at Wed Feb 07 20:53:31 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.