[YANGTOOLS-723] ODL fails to mount device - shows empty list of unsatisfied imports Created: 29/Nov/16 Updated: 10/Apr/22 Resolved: 08/Mar/17 |
|
| Status: | Resolved |
| Project: | yangtools |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | ||
| Reporter: | Giles Heron | Assignee: | Robert Varga |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Operating System: Linux |
||
| Attachments: |
|
| External issue ID: | 7267 |
| Description |
|
when mounting some types of device I'm seeing the mount fail with "No more sources for schema context'. I see this in the logs: 2016-11-29 17:39:00,580 | DEBUG | ssing-executor-9 | NetconfDevice | 315 - org.opendaylight.netconf.sal-netconf-connector - 1.4.1.Boron-SR1 | RemoteDevice {3850}: Unable to map any source identifiers to a capability reported by device : []2016-11-29 17:39:00,580 | WARN | ssing-executor-9 | NetconfDevice | 315 - org.opendaylight.netconf.sal-netconf-connector - 1.4.1.Boron-SR1 | RemoteDevice{3850} : Unable to build schema context, unsatisfied imports {}, will reattempt with resolved only So it seems that ODL thinks it has unsatisfied imports, but that the list of such imports is empty. any idea what's going on here? |
| Comments |
| Comment by Giles Heron [ 29/Nov/16 ] |
|
I checked, and I see the same behaviour with Beryllium-SR4 but Lithium-SR4 works ok. So I guess this is something to do with the stricter YANG checking in Beryllium? |
| Comment by Tomas Cere [ 30/Nov/16 ] |
|
The full stack trace would be nice since it's cut off at the interesting part and you cant see the cause of the NPE. |
| Comment by Giles Heron [ 30/Nov/16 ] |
|
I've deleted most of the log to leave the stuff potentially relevant to the error. |
| Comment by Giles Heron [ 30/Nov/16 ] |
|
Attachment karaf.log has been added with description: last couple of hundred lines of the log |
| Comment by Jakub Morvay [ 06/Dec/16 ] |
|
Hi Giles, I've looked at the log and this behavior is indeed strange. Can you please also provide yang models, so I can reproduce this? |
| Comment by Giles Heron [ 06/Dec/16 ] |
|
will mail you a zip of the YANG models (comes to 1.4MB even as a ZIP so can't send it here). |
| Comment by Robert Varga [ 08/Dec/16 ] |
|
This part has been omitted from original report: Caused by: java.lang.NullPointerException NPE is caused by QName.create() being called with a null base, which in turn points to TypeUtils doing: final SchemaPath path = stmtCtx.getSchemaPath().get(); In this path.getParent() is YangInstanceIdentifier.EMPTY, which is the only case where getLastComponent() returns null. The stack classes involved are pointing at an uint typedef or leaf. Models need to be analyzed. boron: https://git.opendaylight.org/gerrit/49143 will report more information so we can track it down. |
| Comment by Robert Varga [ 08/Dec/16 ] |
|
Thinking about this a bit more, the probable cause for this is a free-standing 'type' statement – which would constitute invalid yang. |
| Comment by Viera Zelcamova [ 08/Dec/16 ] |
|
(In reply to Giles Heron from comment #5) Hi Giles, send the models to Peter Kajsa or Igor Foltin (Yang team). Thanks. |
| Comment by Giles Heron [ 08/Dec/16 ] |
|
will do once I have the models. For this one I need access to a real cisco switch that has the issue (7267 doesn't occur with CSR1Kv but only with a real switch). Kevin/Jason have the switches so I need to get hold of them once they're in today. |
| Comment by Robert Varga [ 08/Dec/16 ] |
|
Furthermore, this is a side-effect of when and how we validate sub-statements – which happens only after the parent has been fully declared. Hence I can do container foo { and while it will blow up, it will do so very late in processing, at which point someone may have asked for the effective statement. That leads to TypeEffectiveStatementImpl being invoked in a context, which the implementation does not expect (hey, 'type' can occur only nested in a different statement, hence it's parent path is non-empty... kaboom). BUG-7037 tracks an improvement to lookups, which means that the fact that 'type' statement has no place under container the very first time we attempt to start to define it, throwing a SourceException pinpointing the offender – allowing NETCONF to properly exclude it (and hence fix this particular issue). |
| Comment by Robert Varga [ 14/Dec/16 ] |
|
Workaround patch for parser to add the offender identification – that should be sufficient for NETCONF to prune the offender. The root cause needs to be still investigated. |
| Comment by Robert Varga [ 15/Dec/16 ] |
| Comment by Igor Foltin [ 19/Dec/16 ] |
|
Hi Giles, I tested the models you provided and the only problem came up with the model ned-switching-devs@2016-04-20. deviation /ned:native/ned:class-map/ned:match/ned:access-group/ned:index { } The issue was that the type uint32 statement had an empty parent. |
| Comment by Giles Heron [ 08/Mar/17 ] |
|
Attachment short.log has been added with description: ODL log (starting with the instance data) |
| Comment by Giles Heron [ 08/Mar/17 ] |
|
Attachment openconfig-interfaces@2015-11-20.yang has been added with description: YANG model with missing instance data |