[YANGTOOLS-636] Issue parsing model which imports the same module twice with different prefixes. Created: 21/Jul/16  Updated: 10/Apr/22  Resolved: 22/Jul/16

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

Type: Bug
Reporter: Giles Heron Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Attachments: File Cisco-IOS-XR-watchd-cfg@2015-11-09.yang    
Issue Links:
Duplicate
duplicates YANGTOOLS-628 Parser: Only the last prefix works if... Resolved
External issue ID: 6249

 Description   

ODL is unable to NETCONF mount an IOS-XR device which exposes a YANG model which has 2 imports of the same module, but with different prefixes. The error occurs when attempting to reference that module:

2016-07-21 16:43:34,488 | ERROR | sing-executor-12 | NetconfDevice | 156 - org.opendaylight.netconf.sal-netconf-connector - 1.3.2.Beryllium-SR2 | RemoteDevice

{XR9KV}

: Initialization in sal failed, disconnecting from device
java.lang.IllegalArgumentException: Failed to parse node 'node:active-nodes' in path '/node:active-nodes/node:active-node'
at org.opendaylight.yangtools.yang.parser.stmt.rfc6020.Utils.nodeIdentifierFromPath(Utils.java:414)[51:org.opendaylight.yangtools.yang-parser-impl:0.8.2.Beryllium-SR2]
at org.opendaylight.yangtools.yang.parser.stmt.rfc6020.AugmentStatementImpl$Definition.parseArgumentValue(AugmentStatementImpl.java:75)[51:org.opendaylight.yangtools.yang-parser-impl:0.8.2.Beryllium-SR2]
at org.opendaylight.yangtools.yang.parser.stmt.rfc6020.AugmentStatementImpl$Definition.parseArgumentValue(AugmentStatementImpl.java:62)[51:org.opendaylight.yangtools.yang-parser-impl:0.8.2.Beryllium-SR2]
at org.opendaylight.yangtools.yang.parser.stmt.reactor.StatementDefinitionContext.parseArgumentValue(StatementDefinitionContext.java:34)[51:org.opendaylight.yangtools.yang-parser-impl:0.8.2.Beryllium-SR2]
at org.opendaylight.yangtools.yang.parser.stmt.reactor.SubstatementContext.<init>(SubstatementContext.java:49)[51:org.opendaylight.yangtools.yang-parser-impl:0.8.2.Beryllium-SR2]
at org.opendaylight.yangtools.yang.parser.stmt.reactor.StatementContextBase$1.build(StatementContextBase.java:327)[51:org.opendaylight.yangtools.yang-parser-impl:0.8.2.Beryllium-SR2]
at org.opendaylight.yangtools.yang.parser.stmt.reactor.StatementContextWriter.defferedCreate(StatementContextWriter.java:45)[51:org.opendaylight.yangtools.yang-parser-impl:0.8.2.Beryllium-SR2]
at org.opendaylight.yangtools.yang.parser.stmt.reactor.StatementContextWriter.startStatement(StatementContextWriter.java:32)[51:org.opendaylight.yangtools.yang-parser-impl:0.8.2.Beryllium-SR2]
at org.opendaylight.yangtools.yang.parser.impl.YangStatementParserListenerImpl.enterStatement(YangStatementParserListenerImpl.java:82)[51:org.opendaylight.yangtools.yang-parser-impl:0.8.2.Beryllium-SR2]
at org.opendaylight.yangtools.antlrv4.code.gen.YangStatementParser$StatementContext.enterRule(YangStatementParser.java:113)[51:org.opendaylight.yangtools.yang-parser-impl:0.8.2.Beryllium-SR2]
...

The current workaround is:

(1) attempt to mount the device using RESTCONF. This will fail.
(2) go into the “cache/schema” directory under distribution-karaf-0.4.2-beryllium-SR2
(3) edit the file “Cisco-IOS-XR-watchd-cfg@2015-11-09”.
(4) delete the line " import Cisco-IOS-XR-config-mda-cfg

{ prefix "a1"; }


(5) unmount the device using RESTCONF.
(6) re-mount the device using RESTCONF. This time it should succeed.



 Comments   
Comment by Giles Heron [ 21/Jul/16 ]

Attachment Cisco-IOS-XR-watchd-cfg@2015-11-09.yang has been added with description: YANG model causing the failure

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