# Confd\_fd\_ready for ctrl socket returns CONFD\_ERR with error number 18

**URL:** <https://dmap-community.ductus.global/t/confd-fd-ready-for-ctrl-socket-returns-confd-err-with-error-number-18/4322>\
**Category:** Core Engine and APIs\
**Created:** [January 20, 2023, 10:41am UTC](https://dmap-community.ductus.global/t/confd-fd-ready-for-ctrl-socket-returns-confd-err-with-error-number-18/4322 "2023-01-20T10:41:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Haripriya](https://avatars.discourse-cdn.com/v4/letter/h/3d9bf3/32.png) [@Haripriya](https://dmap-community.ductus.global/u/Haripriya)\
**Post date:** [January 20, 2023, 10:41am UTC](https://dmap-community.ductus.global/t/confd-fd-ready-for-ctrl-socket-returns-confd-err-with-error-number-18/4322/1 "2023-01-20T10:41:38Z")

</div>

Hi,

For Netconf notification support, we created the ctrl socket and started polling.  
Later we build the worker socket and use the confd\_register\_notification\_stream API to register Netconf stream.

However, we could occasionally see the following error being reported :

```auto
[receive_fd_event] :	
**INTERNAL ERROR: Unknown callback op 12**
[receive_fd_event] : confd_fd_ready returned ret[-1]

[receive_fd_event] **Error on control socket request: (18)**

```

===================Code Snippet ========================

```auto
   if( events & EPOLLIN )
    {
	...
        ret = confd_fd_ready(_daemon_ctx, _socket_fd);
        LOG_INFO("confd_fd_ready returned ret[%d] \n",ret);
        if( (ret == CONFD_ERR) && (confd_errno != CONFD_ERR_EXTERNAL) )
        {
            LOG_INFO("Error on control socket request: (%d)\n", confd_errno );
            return;
        }
	...
    }		

```

Just so you’re aware, from the BT, it looks like its getting stuck at the confd\_register\_done callback.

#0 0x00007f596173075d in read () from /lib64/libpthread.so.0  
#1 0x00007f596480e4a7 in read\_fill (fd=49, buf=0x7f58e1e45790 “\v”, len=4) at confd\_internal.c:858  
#2 0x00007f5964812d3a in term\_read (socket=socket@entry=49, ret=ret@entry=0x7f58e1e4583c, cdbop=cdbop@entry=4294967295) at confd\_internal.c:1126  
#3 0x00007f5964813fc1 in confd\_call (socket=49, term=term@entry=0x7f58a01d2f80, status=status@entry=0x7f58e1e4583c) at confd\_internal.c:1249  
#4 0x00007f59647eb1a8 in confd\_register\_done (dx=0x36bcbd0) at confd\_lib.c:3361  
#5 0x00007f596457ce71 in notif\_mgmt::register\_notification\_stream\_done (this=this@entry=0x36bd150) at src/notif\_mgmt.cpp:135  
…

I’d be grateful if you could point us in the right direction.

Reagrds,  
Haripriya

---

<div class="post-metadata">

**Author:** ![mvf](https://yyz2.discourse-cdn.com/flex010/user_avatar/dmap-community.ductus.global/mvf/32/182_2.png) [@mvf](https://dmap-community.ductus.global/u/mvf)\
**Post date:** [January 24, 2023, 12:19pm UTC](https://dmap-community.ductus.global/t/confd-fd-ready-for-ctrl-socket-returns-confd-err-with-error-number-18/4322/2 "2023-01-24T12:19:30Z")

</div>

The most common reason for errors like this is that there are two or more threads that share one ConfD socket. In your case, it looks like the two threads both use the same control socket, one is registering the notification callbacks, the other is already waiting for callback invocations in `confd_fd_ready`.
