[CONTROLLER-717] Remote Netconf Server Initialization Failed With NullPointerException Created: 22/Aug/14 Updated: 25/Jul/23 Resolved: 03/Sep/14 |
|
| Status: | Resolved |
| Project: | controller |
| Component/s: | netconf |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | ||
| Reporter: | Sachi Gupta | Assignee: | Maros Marsalek |
| 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: | 1601 |
| Priority: | Highest |
| Description |
|
Remote Netconf Server Connection With new cloned Opendaylight controller(Cloned on Aug 21, 2013) failed with java null pointer exception. Steps followed to replicate the issue: 1. Clone new Opnedaylight controller Running the controller failed to initialize sal and throws java null pointer exception as below 2014-08-22 10:59:21.743 IST [remote-connector-processing-executor-2] WARN o.o.c.s.c.netconf.NetconfDevice - RemoteDevice {m10sachi}: Unexpected error resolving device sources: java.lang.NullPointerException2014-08-22 10:59:21.770 IST [remote-connector-processing-executor-2] ERROR o.o.c.s.c.netconf.NetconfDevice - RemoteDevice{m10sachi} : Initialization in sal failed, disconnecting from device : Session terminated Session closed |
| Comments |
| Comment by Maros Marsalek [ 22/Aug/14 ] |
|
Hi, I have fixed the NullPointer exception. But it looks like your device does not respond correctly to get request with filter netconf-state/schemas. So it looks like your device supports netconf monitoring, but does not expose any schemas. Here is the commit to fix null pointer: But since your device does not support netconf monitoring, you would have to place your schemas into cache folder before ODL start. |
| Comment by Sachi Gupta [ 22/Aug/14 ] |
|
Hi, The null pointer exception is resolved with your patch Have added the schema files in cache/schema folder but still getting one more exception as below: 2014-08-22 15:01:49.289 IST [remote-connector-processing-executor-2] WARN o.o.c.s.c.n.NetconfStateSchemas - RemoteDevice {m10sachi}: Unable to detect available schemas, get to (urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring?revision=2010-10-04)netconf-state/(urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring?revision=2010-10-04)schemas was empty2014-08-22 15:01:49.313 IST [remote-connector-processing-executor-3] ERROR o.o.c.s.c.netconf.NetconfDevice - RemoteDevice{m10sachi} : Initialization in sal failed, disconnecting from device at org.opendaylight.controller.sal.connect.netconf.NetconfDevice$RecursiveSchemaSetup.setUpSchema(NetconfDevice.java:305) [bundlefile:na] at org.opendaylight.controller.sal.connect.netconf.NetconfDevice$RecursiveSchemaSetup.run(NetconfDevice.java:294) [bundlefile:na] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [na:1.7.0_55] at java.util.concurrent.FutureTask.run(FutureTask.java:262) [na:1.7.0_55] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_55] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_55] at java.lang.Thread.run(Thread.java:744) [na:1.7.0_55] 2014-08-22 15:01:49.316 IST [remote-connector-processing-executor-3] WARN o.o.c.s.c.n.l.NetconfDeviceCommunicator - RemoteDevice{m10sachi} : Session terminated Session closed |
| Comment by Maros Marsalek [ 25/Aug/14 ] |
|
I see, can you show me the hello message produced by your device ? |
| Comment by Sachi Gupta [ 26/Aug/14 ] |
|
Hi Maros, The hello message produced by the device is as follows: <hello xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> |
| Comment by Maros Marsalek [ 26/Aug/14 ] |
|
Looking at the hello message, not many yang based capabilities there. Except maybe: <capability>http://yang.juniper.net/yang/1.1/jc?module=configuration</capability>. What yang modules did you put under cache/schema folder ? Or what yang modules do you expect to be downloaded from the device and used ? Because your device provides no schemas, and in hello message there is maybe one yang schema reported. In case you need to override the capabilities from hello message, there is a way via netconf-connector configuretion. |
| Comment by Sachi Gupta [ 26/Aug/14 ] |
|
Hi Maros, I have already added configuration.yang file in cache/schema folder, but faced the above mentioned issue. Note: The same setup was working fine with the older odl code(Cloned on June 19,2014) but showing the issues with new odl code(Cloned on Aug 21, 2014) |
| Comment by Maros Marsalek [ 26/Aug/14 ] |
|
Can you show me the whole log ? or can I connect to your device from my PC to debug ? |
| Comment by Sachi Gupta [ 26/Aug/14 ] |
|
Hi Maros, Device does not have internet connectivity, so you will not be able to connect to my netconf device. Sharing with you the log file. |
| Comment by Sachi Gupta [ 26/Aug/14 ] |
|
Attachment Opendaylight.log:26-08-2014 has been added with description: Log File Attached |
| Comment by Maros Marsalek [ 27/Aug/14 ] |
|
Ok, So your device has this capability in hello message Netconf-connector currently ignores capabilities without revision parameter. What you can do as a workaround: 1. add revision to the schema in cache/schema folder. |
| Comment by Sachi Gupta [ 27/Aug/14 ] |
|
Hi Maros, Exception: . Expected but not found: [urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf?module=odl-sal-netconf-connector- cfg&revision=2013-10-28, http://yang.juniper.net/yang/1.1/jc?module=configuration&revision=1970-01-01] . Expected but not found: [urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf?module=odl-sal-netconf-connector- cfg&revision=2013-10-28, http://yang.juniper.net/yang/1.1/jc?module=configuration&revision=1970-01-01] and if i add the <yang-module-capabilities> Thanks in advance. |
| Comment by Sachi Gupta [ 27/Aug/14 ] |
|
Attachment snapshot.txt has been added with description: netconf-connector snapshot |
| Comment by Sachi Gupta [ 02/Sep/14 ] |
|
Hi Maros, I have hard coded the capabilities in NetconfClientSession.java file(as mentioned in After doing this also, I am facing the same error of "Sal Initialization Failure" 2014-09-02 11:16:36.317 IST [remote-connector-processing-executor-2] WARN o.o.c.s.c.n.NetconfStateSchemas - RemoteDevice {sachi}: Unable to detect available schemas, get to (urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring?revision=2010-10-04)netconf-state/(urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring?revision=2010-10-04)schemas was empty2014-09-02 11:16:36.319 IST [remote-connector-processing-executor-3] INFO o.o.c.s.c.netconf.NetconfDevice - schema required resources 2014-09-02 11:16:36.324 IST [remote-connector-processing-executor-3] ERROR o.o.c.s.c.netconf.NetconfDevice - RemoteDevice{sachi} : Initialization in sal failed, disconnecting from device at org.opendaylight.controller.sal.connect.netconf.NetconfDevice$RecursiveSchemaSetup.setUpSchema(NetconfDevice.java:306) [bundlefile:na] at org.opendaylight.controller.sal.connect.netconf.NetconfDevice$RecursiveSchemaSetup.run(NetconfDevice.java:295) [bundlefile:na] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [na:1.7.0_55] at java.util.concurrent.FutureTask.run(FutureTask.java:262) [na:1.7.0_55] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_55] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_55] at java.lang.Thread.run(Thread.java:744) [na:1.7.0_55] 2014-09-02 11:16:36.325 IST [remote-connector-processing-executor-3] WARN o.o.c.s.c.n.l.NetconfDeviceCommunicator - RemoteDevice{sachi} : Session terminated Session closed |
| Comment by Maros Marsalek [ 02/Sep/14 ] |
|
Ok, so you have file configuration@1970-01-01.yang in cache/schema. Does the file contain revision statement with 1970-01-01 revision ? If so, adding this configuration under your netconf-connector: <yang-module-capabilities> should do the trick. Also are you running latest controller ? |
| Comment by Sachi Gupta [ 02/Sep/14 ] |
|
Hi Maros, 1. Yes, configuration@1970-01-01.yang in cache/schema contains 1970-01-01 revision statement as below: module configuration { revision 1970-01-01 { description "Initial revision."; }2. Added configuration under your netconf-connector as below: <required-capabilities> <capability>urn:opendaylight:params:xml:ns:yang:controller:md:sal:connector:netconf?module=odl-sal-netconf-connector-cfg&revision=2013-10-28</capability> 3. Yes, I am running the new controller code cloned on Sept-02. After doing all the changes, its not working. Thanks in advance |
| Comment by Maros Marsalek [ 02/Sep/14 ] |
|
This xml: <yang-module-capabilities> Needs to be under module element. It is part of netconf-connector configuration. |
| Comment by Sachi Gupta [ 02/Sep/14 ] |
|
Hi Maros, Have added the above as part of netconf-connector configuration. Now, I am not getting any error and device is not getting initialized also. Anything else I need to add. Thanks |
| Comment by Maros Marsalek [ 02/Sep/14 ] |
|
Could you please rerun with detailed logs ? Add these lines to configuration/logback.xml before you start ODL. Delete logs/ folder and rerun: <logger name="org.opendaylight.protocol.framework" level="TRACE"/> And please attach produced opendaylight.log file afterwards. And what do you mean by not getting initialized ? There is nothing under nodes/node from restconf ? or just no data are transfered ? |
| Comment by Sachi Gupta [ 02/Sep/14 ] |
|
Send the logs on mmarsale@cisco.com. The size of the file was larger so was not able to attach it on bugzilla. The log says "RemoteDevice {controller-config}: Netconf connector initialized successfully" but it does not show any log for my "sachi-m10" netconf connector. |