ConfD User Community

Configure the example


#1

Dear support,

We use external DB and I run the confd as part of my system.
I also added the smp.xfs file as part of the yang files directory (it is the same yang file as used in the simpe_trans example).

I am trying to configure from cli (for test) a server and see the callbacks in my application, with no luck.
I see the following:

isim_Host1(config)# servers server abc ip 1.1.1.1 port 1
Error: failed to create path - application communication failure

What do I do wrong?
Is it an error in my application?

Thanks for your reply,
Inbal


#2

Hi Inbal,
The necessary callbacks needed for your ext DB are missing or returned an error. The error is complaining that the “create” callback is not registered or returning an error.

What do you see in your developer log? Someting like:
<ERR> 21-Aug-2016::16:33:55.982 confd[42126]: devel-c no registration found for callpoint simplecp/create of type=external path /smp:servers/server{test}
The libonfd library printouts that you set with confd_init() is also helpful.

See struct confd_data_cbs and confd_register_data_cb() in the simple_withtrans.c example and the confd_lib_dp man page.


#3

Hi, thanks for your reply.
Where can I find these log files? under which directory ?
I found few log files, which of them is relevant?

thanks again


#4

Their locations are specified in confd.conf. The default being used in the examples is the same directory as the project. The relevant portion of confd.conf is as follows:

<logs>
  <confdLog>
    <enabled>true</enabled>
    <file>
      <enabled>true</enabled>
      <name>./confd.log</name>
    </file>
  </confdLog>

  <developerLog>
    <enabled>true</enabled>
    <file>
      <enabled>true</enabled>
      <name>./devel.log</name>
    </file>
  </developerLog>
</logs>

The relevant ones for debugging callpoints are devel.log and confd.log.


#5

Hi,

I see in the confd.log:
Daemon confdAdaptor timed out
what does it mean? how can we solve that?
in confd_devel.log I found the following:
23-Aug-2016::11:10:48.586 isim_Host1 confd[16946]: devel-c Daemon confdAdaptor registered for non-existing stream ‘’
which registartion is the problem? of the application cb or the transaction cb?
Is there a debug way to see all registration?

10x


#6

The error message
23-Aug-2016::11:10:48.586 isim_Host1 confd[16946]: devel-c Daemon confdAdaptor registered for non-existing stream

say that your application has registered for a notification stream that doesn’t exist. Look at the confd_register_notification_stream() call in your code. The second argument is a pointer to a struct, one of which member is called streamname, that you must fill in.

It looks like it might be empty in your case.


#7

Thanks for your reply.
I have the following error:
24-Aug-2016::09:57:02.269 isim_Host1 confd[19200]: devel-c no registration found for
callpoint simplecp/get_elem of type=external path /smp:servers/server{abc}/name

I do have a registration to this cp as follows:
dataCbP->get_elem = ConfDAdaptorSampleMapper::get_elem;
dataCbP->get_next = ConfDAdaptorSampleMapper::get_next;
dataCbP->set_elem = ConfDAdaptorYangBaseMapper::set_elem;
dataCbP->create = ConfDAdaptorYangBaseMapper::create;
dataCbP->remove = ConfDAdaptorYangBaseMapper::remove;
strcpy(dataCbP->callpoint, “simplecp”);

and then:
int confd_retval = confd_register_data_cb(dctx, &data);

I also check the return value, and see that it prints CONFD_OK.

the get_elem is static function (c++).

can you guide me how to proceed?
thanks in advanced
Inbal


#8

If dataCbP points to the data struct you pass to confd_register_data_cb() your code should work.

Do you see any error messages before the one complaining about “no registration found for callpoint …”?

One possible cause for the error could be that your data provider application crash before you issue the CLI command, if it did there might be a critical error message in confd.log.


#9

I see this error in confd_devel.log before the “no registration found”:
24-Aug-2016::09:56:26.526 isim_Host1 confd[19200]: devel-c Control socket request timed out daemon confdAdaptor id 0

in confd.log I see the following:
24-Aug-2016::09:32:38.720 isim_Host1 confd[ 24-Aug-2016::09:56:26.528 isim_Ho
st1 confd[19200]: - Daemon confdAdaptor timed out
24-Aug-2016::09:56:26.568 isim_Host1 confd[19200]: - no registration found for callpoint simplecp/get_elem of type=external

The process that ConfdAdaptor was register with is still running.


#10

can you elaborate regarding this socket request timeout? what can be the cause?

During the provider startup process, which performs the Confd_init and register to callbacks, I see following printouts right after confd init was called:

TRACE Connected (maapi) to ConfD
TRACE MAAPI_LOAD_ALL_NS
TRACE MAAPI_LOAD_HASH_DB
TRACE Connected (dp) to ConfD
TRACE Received daemon id 2
TRACE Connected (dp) to ConfD
ConfDAdaptorManager::Init confd init was done

Then we register and print the follwoing for CONFD_OK:
ConfDAdaptorManager::RegisterYourself was called ConfDAdaptorCallBackClient::RegisterYourself was done
ConfDAdaptorYangBaseMapper::RegisterYoutselfToDataCB simplecp was done
ConfDAdaptorObjFactory::RegisterList was done
TRACE Picked up old user session: 11 for user:system ctx:system
TRACE Picked up old user session: 10 for user:system ctx:system
TRACE Picked up old user session: 1 for user:system ctx:system

the confd_connect is as follows:

struct sockaddr_in addr;
addr.sin_addr.s_addr = inet_addr("127.0.0.1");
addr.sin_family = AF_INET;
addr.sin_port = htons(CONFD_PORT);

ctlsock = socket(PF_INET, SOCK_STREAM, 0);
if (ctlsock < 0)
	printf("!!!!! ConfDAdaptorManager::Init ctlsock < 0\n");

confd_load_schemas((struct sockaddr*)&addr, sizeof (struct sockaddr_in)); //for debug

if (confd_connect(dctx, ctlsock, CONTROL_SOCKET, (struct sockaddr*)&addr, sizeof (struct sockaddr_in)) < 0)
	printf("!!!!! ConfDAdaptorManager::Init confd_connect(ctlsock) < 0\n");

Non of the error prints is seen in the init log.
do you see any thing in the info I provided that can cause this application communication failure?


#11

This error message suggest you don’t respond in time to a transaction callback. Please see the simple_trans example and chapter 7 in the User Guide for further information.


#12

Hi,

I wrote my code while looking at the simple trans example after reading the user guide.
I reproduce this scenario again with CONFD_PROTO_TRACE for more info.

I see in the init the following:
TRACE Connected (dp) to ConfD

28-Aug-2016::09:03:41.883 28951/b6d7b980/22 SEND {1,confdAdaptor,0}
28-Aug-2016::09:03:41.884 28951/b6d7b980/22 GOT {0,0}
TRACE Received daemon id 0
TRACE Connected (dp) to ConfD

28-Aug-2016::09:03:41.884 28951/b6d7b980/23 SEND {2,0,23}
@@@ ConfDAdaptorManager::Init confd init was done ***

28-Aug-2016::09:03:41.885 28951/b6d7b980/22 SEND {9,0,497}
*** ConfDAdaptorManager::RegisterYourself was succeed***
*** ConfDAdaptorCallBackClient::RegisterYourself was done***

28-Aug-2016::09:03:41.885 28951/b6d7b980/22 SEND {3,0,{130,simplecp,130047,0,1}}
@@@ ConfDAdaptorYangBaseMapper::RegisterYoutselfToDataCB simplecp was done
@@@ ConfDAdaptorObjFactory::RegisterList was done

28-Aug-2016::09:03:41.885 28951/b6d7b980/22 SEND {11,0}
28-Aug-2016::09:03:41.886 28951/b6d7b980/22 GOT {12,[{11,#Bin,#Bin<>,system,3,{0,0,0,0},0,1472374954,#Bin<>,0},{10,#Bin,#Bin<>,system,3,{0,0,0,0},0,1472374954,#Bin<>,0},{1,#Bin,#Bin<>,system,3,{0,0,0,0},0,1472374951,#Bin<>,0}]}
TRACE Picked up old user session: 11 for user:system ctx:system
TRACE Picked up old user session: 10 for user:system ctx:system
TRACE Picked up old user session: 1 for user:system ctx:system
@@@ ConfDAdaptorManager::Init was done ***

what does the SEND and GOT means?
what does the #BIN mean?

BTW - when I do --status, I see the following:
callpoints:
id=simplecp daemonId=0 daemonName=confdAdaptor

Then, when I try to configure the servers server XY, the cli stops and there is no print, just
isim_Host1(config)# servers server xy
System message at 2016-08-28 11:52:40…
Subsystem stopped: confdAdaptor

and the --status shows:
callpoints:
id=simplecp ** not registered

thanks


#13

Hi,

After initialising and registering your callbacks, do you go into a loop to check for read events?
It seems like you just exit, or are not receiving any events.
Is the Linux poll() working properly in your system?

SEND - what the libconfd library sent.
GOT - what the libconfd library got from ConfD.
#Bin - Binary data.