# Configure the example

**URL:** <https://dmap-community.ductus.global/t/configure-the-example/640>\
**Category:** Examples Set\
**Created:** [August 21, 2016, 1:46pm UTC](https://dmap-community.ductus.global/t/configure-the-example/640 "2016-08-21T13:46:34Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![InbalAmram](https://avatars.discourse-cdn.com/v4/letter/i/0ea827/32.png) [@InbalAmram](https://dmap-community.ductus.global/u/InbalAmram)\
**Post date:** [August 21, 2016, 1:46pm UTC](https://dmap-community.ductus.global/t/configure-the-example/640/1 "2016-08-21T13:46:34Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![cohult](https://yyz2.discourse-cdn.com/flex010/user_avatar/dmap-community.ductus.global/cohult/32/221_2.png) [@cohult](https://dmap-community.ductus.global/u/cohult)\
**Post date:** [August 21, 2016, 2:40pm UTC](https://dmap-community.ductus.global/t/configure-the-example/640/2 "2016-08-21T14:40:14Z")

</div>

> [@InbalAmram](#):
>
> Error: failed to create path - application communication failure

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.

---

<div class="post-metadata">

**Author:** ![InbalAmram](https://avatars.discourse-cdn.com/v4/letter/i/0ea827/32.png) [@InbalAmram](https://dmap-community.ductus.global/u/InbalAmram)\
**Post date:** [August 22, 2016, 12:45pm UTC](https://dmap-community.ductus.global/t/configure-the-example/640/3 "2016-08-22T12:45:45Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![waitai](https://yyz2.discourse-cdn.com/flex010/user_avatar/dmap-community.ductus.global/waitai/32/436_2.png) [@waitai](https://dmap-community.ductus.global/u/waitai)\
**Post date:** [August 22, 2016, 3:45pm UTC](https://dmap-community.ductus.global/t/configure-the-example/640/4 "2016-08-22T15:45:48Z")

</div>

> [@InbalAmram](#):
>
> Where can I find these log files? under which directory ?

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>

```

> [@InbalAmram](#):
>
> I found few log files, which of them is relevant?

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

---

<div class="post-metadata">

**Author:** ![InbalAmram](https://avatars.discourse-cdn.com/v4/letter/i/0ea827/32.png) [@InbalAmram](https://dmap-community.ductus.global/u/InbalAmram)\
**Post date:** [August 23, 2016, 8:36am UTC](https://dmap-community.ductus.global/t/configure-the-example/640/5 "2016-08-23T08:36:15Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jjohansson](https://avatars.discourse-cdn.com/v4/letter/j/b782af/32.png) [@jjohansson](https://dmap-community.ductus.global/u/jjohansson)\
**Post date:** [August 23, 2016, 11:47am UTC](https://dmap-community.ductus.global/t/configure-the-example/640/6 "2016-08-23T11:47:42Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![InbalAmram](https://avatars.discourse-cdn.com/v4/letter/i/0ea827/32.png) [@InbalAmram](https://dmap-community.ductus.global/u/InbalAmram)\
**Post date:** [August 24, 2016, 7:46am UTC](https://dmap-community.ductus.global/t/configure-the-example/640/7 "2016-08-24T07:46:15Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jjohansson](https://avatars.discourse-cdn.com/v4/letter/j/b782af/32.png) [@jjohansson](https://dmap-community.ductus.global/u/jjohansson)\
**Post date:** [August 24, 2016, 10:52am UTC](https://dmap-community.ductus.global/t/configure-the-example/640/8 "2016-08-24T10:52:04Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![InbalAmram](https://avatars.discourse-cdn.com/v4/letter/i/0ea827/32.png) [@InbalAmram](https://dmap-community.ductus.global/u/InbalAmram)\
**Post date:** [August 24, 2016, 12:03pm UTC](https://dmap-community.ductus.global/t/configure-the-example/640/9 "2016-08-24T12:03:56Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![InbalAmram](https://avatars.discourse-cdn.com/v4/letter/i/0ea827/32.png) [@InbalAmram](https://dmap-community.ductus.global/u/InbalAmram)\
**Post date:** [August 25, 2016, 5:37am UTC](https://dmap-community.ductus.global/t/configure-the-example/640/10 "2016-08-25T05:37:12Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![jjohansson](https://avatars.discourse-cdn.com/v4/letter/j/b782af/32.png) [@jjohansson](https://dmap-community.ductus.global/u/jjohansson)\
**Post date:** [August 25, 2016, 3:29pm UTC](https://dmap-community.ductus.global/t/configure-the-example/640/11 "2016-08-25T15:29:25Z")

</div>

> [@InbalAmram](#):
>
> 24-Aug-2016::09:56:26.526 isim\_Host1 confd[19200]: devel-c Control socket request timed out daemon confdAdaptor id 0

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.

---

<div class="post-metadata">

**Author:** ![InbalAmram](https://avatars.discourse-cdn.com/v4/letter/i/0ea827/32.png) [@InbalAmram](https://dmap-community.ductus.global/u/InbalAmram)\
**Post date:** [August 28, 2016, 9:26am UTC](https://dmap-community.ductus.global/t/configure-the-example/640/12 "2016-08-28T09:26:58Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![cohult](https://yyz2.discourse-cdn.com/flex010/user_avatar/dmap-community.ductus.global/cohult/32/221_2.png) [@cohult](https://dmap-community.ductus.global/u/cohult)\
**Post date:** [August 28, 2016, 6:16pm UTC](https://dmap-community.ductus.global/t/configure-the-example/640/13 "2016-08-28T18:16:17Z")

</div>

Hi,

> [@InbalAmram](#):
>
> @@@ ConfDAdaptorManager::Init was done \*\*\*

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?

> [@InbalAmram](#):
>
> what does the SEND and GOT means? what does the #BIN mean?

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