[NETCONF-465] NETCONF NullPointer exception when no YANG modules found in schema cache Created: 06/Sep/17  Updated: 15/Mar/19  Resolved: 12/Oct/17

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

Type: Bug
Reporter: Sven Wisotzky Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: Windows
Platform: PC


External issue ID: 9112

 Description   

The device does not support yang-library nor netconf-monitoring, so it is required to import schema files manually into the schema cache. If an operator/administrator has forgotten to import all schema files correctly, there is no meaningful error message - but a NullPointerException occurs.

opendaylight-user@root>netconf:connect-device -id VSR -p 830 -P admin -U admin -i 127.0.0.1
Netconf connector added succesfully
opendaylight-user@root>netconf:list-devices
Error executing command: java.lang.NullPointerException
opendaylight-user@root>netconf:show-device -id VSR
Error executing command: java.lang.NullPointerException
opendaylight-user@root>netconf:disconnect-device -id VSR
Netconf connector disconnected succesfully
opendaylight-user@root>netconf:list-devices
NETCONF ID | NETCONF IP | NETCONF Port | Status
---------------------------------------------------------
controller-config | 127.0.0.1 | 1830 | connected

2017-09-06 13:08:31,317 | ERROR | l for user karaf | ShellUtil | 27 - org.apache.karaf.shell.console - 3.0.8 | Exception caught while executing command
java.lang.NullPointerException
at org.opendaylight.netconf.console.impl.NetconfCommandsImpl.listDevices(NetconfCommandsImpl.java:69)
at org.opendaylight.netconf.console.commands.NetconfListDevicesCommand.doExecute(NetconfListDevicesCommand.java:30)
at org.apache.karaf.shell.console.AbstractAction.execute(AbstractAction.java:33)[27:org.apache.karaf.shell.console:3.0.8]
at org.apache.karaf.shell.commands.basic.AbstractCommand.execute(AbstractCommand.java:33)[27:org.apache.karaf.shell.console:3.0.8]
at Proxyfee4cdea_a169_4db3_aa7b_653131df28e5.execute(Unknown Source)[:]
at Proxyfee4cdea_a169_4db3_aa7b_653131df28e5.execute(Unknown Source)[:]
at org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:78)[27:org.apache.karaf.shell.console:3.0.8]
at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:480)[27:org.apache.karaf.shell.console:3.0.8]
at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:406)[27:org.apache.karaf.shell.console:3.0.8]
at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)[27:org.apache.karaf.shell.console:3.0.8]
at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:182)[27:org.apache.karaf.shell.console:3.0.8]
at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:119)[27:org.apache.karaf.shell.console:3.0.8]
at org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:94)
at org.apache.karaf.shell.console.impl.jline.ConsoleImpl.run(ConsoleImpl.java:210)
at org.apache.karaf.shell.console.impl.jline.LocalConsoleManager$2$1$1.run(LocalConsoleManager.java:109)
at java.security.AccessController.doPrivileged(Native Method)[:1.8.0_131]
at org.apache.karaf.jaas.modules.JaasHelper.doAs(JaasHelper.java:57)[28:org.apache.karaf.jaas.modules:3.0.8]
at org.apache.karaf.shell.console.impl.jline.LocalConsoleManager$2$1.run(LocalConsoleManager.java:102)[27:org.apache.karaf.shell.console:3.0.8]
2017-09-06 13:08:48,666 | ERROR | l for user karaf | ShellUtil | 27 - org.apache.karaf.shell.console - 3.0.8 | Exception caught while executing command
java.lang.NullPointerException
at org.opendaylight.netconf.console.impl.NetconfCommandsImpl.showDevice(NetconfCommandsImpl.java:113)
at org.opendaylight.netconf.console.commands.NetconfShowDeviceCommand.doExecute(NetconfShowDeviceCommand.java:72)
at org.apache.karaf.shell.console.AbstractAction.execute(AbstractAction.java:33)[27:org.apache.karaf.shell.console:3.0.8]
at org.apache.karaf.shell.commands.basic.AbstractCommand.execute(AbstractCommand.java:33)[27:org.apache.karaf.shell.console:3.0.8]
at Proxyfee4cdea_a169_4db3_aa7b_653131df28e5.execute(Unknown Source)[:]
at Proxyfee4cdea_a169_4db3_aa7b_653131df28e5.execute(Unknown Source)[:]
at org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:78)[27:org.apache.karaf.shell.console:3.0.8]
at org.apache.felix.gogo.runtime.Closure.executeCmd(Closure.java:480)[27:org.apache.karaf.shell.console:3.0.8]
at org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:406)[27:org.apache.karaf.shell.console:3.0.8]
at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)[27:org.apache.karaf.shell.console:3.0.8]
at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:182)[27:org.apache.karaf.shell.console:3.0.8]
at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:119)[27:org.apache.karaf.shell.console:3.0.8]
at org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:94)
at org.apache.karaf.shell.console.impl.jline.ConsoleImpl.run(ConsoleImpl.java:210)
at org.apache.karaf.shell.console.impl.jline.LocalConsoleManager$2$1$1.run(LocalConsoleManager.java:109)
at java.security.AccessController.doPrivileged(Native Method)[:1.8.0_131]
at org.apache.karaf.jaas.modules.JaasHelper.doAs(JaasHelper.java:57)[28:org.apache.karaf.jaas.modules:3.0.8]
at org.apache.karaf.shell.console.impl.jline.LocalConsoleManager$2$1.run(LocalConsoleManager.java:102)[27:org.apache.karaf.shell.console:3.0.8]



 Comments   
Comment by Tomas Cere [ 26/Sep/17 ]

This is only NPE in the cli tool, you can still use restconf, hence lowering prio.

Comment by Tomas Cere [ 06/Oct/17 ]

Managed to look this over briefly, this has nothing to do with schemas missing from the cache. The problem is the commands badly handle situations when the device is still connecting.

https://git.opendaylight.org/gerrit/#/c/64021/

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