Device getSession returns empty

Hi, I am facing issue while try to send rpc to confd using below format.

String sessionName = ip + “_” + resourceID;
NetconfSession session = null;
try {
session = device.getSession(sessionName);
if(session == null) {
device.newSession(sessionName);
}
}catch(Exception e) {
device.newSession(sessionName);
}

String reply = device.getSession(sessionName).rpc(rpc).toXMLString();

Here getting empty result for reply. Can you anybody help here what will be the reason. Suspecting session not getting created towards confd.
Is there any way can we check is there any limit for confd sessions?

You can configure a session limit using /confdConfig/sessionLimits in your confd.confd; and if you did and the problem is due to that, you should see a log message in this regard in your logs, certainly the audit log should create something along the lines of “could not create new session”.

If you did not configure the limit, then there is none effectively and the problem lies elsewhere. Inspect your logs (audit log, devel log - with developerLogLevel set to trace).

Another possibility is that there is something wrong with the client; I suggest you discuss that with the client maintainers. (It appears to be JNC, but the “original” JNC would not behave like that, is it a fork?)

Hi ,

Thanks for reply. We have checked sessionLimits from confd cli. Below is the output

show table confdConfig sessionLimits
maxSessions unbounded;
sessionLimit cli {
maxSessions 100;
}
sessionLimit netconf {
maxSessions unbounded;
}
maxConfigSessions unbounded;

Is this limit cause any issue? What is meant by unbounded can you please let me know.
And I have taken audit.log and devel.log not found error like “could not create new session”.

And there is not code changes from JNC. We have used original JNC code.

Your configuration should be fine - “unbounded” simply means that ConfD does not limit the number of connections. Have a look at your netconf log and possibly netconf trace if you can see anything wrong. The newSession() call should appear as “new ssh session for …” in netconf log and as the hello-message exchange in netconf trace.