CDB_TRIGGER_OPER_SUBS failed during retry connection

Hi experts,

Recently i faced one issue ,when we are testing our application.
So basically what we are doing is we are restarting the confd server and our application is retrying to connect back and try to subscribe the operation data again. But while triggering the CDB_TRIGGER_OPER_SUBS again we faced the below issue.

DEBUG Failed to connect to ConfD: Connection refused
DEBUG Failed to connect to ConfD: Connection refused
TRACE Connected (cdb) to ConfD
TRACE CDB_NEW_SESSION → CONFD_OK
TRACE Established new CDB session to ConfD
TRACE CDB_EXISTS /ME/GNBDUFunction[0] → CONFD_OK
TRACE CDB_END_SESSION → CONFD_OK
TRACE Connected (cdb) to ConfD
TRACE CDB_TRIGGER_SUBS DEBUG Bad protocol usage or unexpected retval - One or more invalid subscription ids: [25]
→ CONFD_ERR
TRACE Connected (cdb) to ConfD
TRACE CDB_NEW_SESSION → CONFD_OK
TRACE Established new CDB session to ConfD
TRACE CDB_EXISTS /ME/GNBDUFunction[0]/NRCellDU → CONFD_OK
TRACE CDB_END_SESSION → CONFD_OK
TRACE Connected (cdb) to ConfD
TRACE CDB_TRIGGER_OPER_SUBS DEBUG Bad protocol usage or unexpected retval - One or more invalid subscription ids: [23]
→ CONFD_ERR

What does “Bad protocol usage or unexpected retval -” error means and how we can get rid of this error msg.

Thanks
Nishant Kumar

Does subscription ID 25 exist? It seems to have been passed as an argument to cdb_trigger_oper_subscriptoon() but there is no subscriber application with that ID.
See the confd_lib_cdb(3) man page for details on that function

when the first time application comes up it has subscribed to ID 25 .
But after restart of confd server it again trying to subscribe to same subscription id leads to the failure.

I have checked the man page for the lib

int cdb_trigger_oper_subscriptions( int sock,
int sub_points[],
int len,
int flags);

But not able to get which field has having subscription id in that . Can you please highlight this.

When the application calls cdb_oper_subscribe() it passes a int *spoint parameter to ConfD. ConfD then fill in the spoint parameter and the function return. The spoint integer value is the “subscription id” used to identify the particular subscription.

The subscription id “spoint” parameter may change after the subscription is closed and the application calls cdb_oper_subscribe() to re-subscribe.

See the confd_lib_cdb(3) man page for details on the cdb_oper_subscribe()/cdb_subscribe() functions.

For cdb_trigger_oper_subscriptions(), the sub_points[] parameter is an array of the subscription id spoints that you wish to trigger.

Thanks a lot for highlighting the issue . I will try to call cdb_oper_subscribe again to get the new subscription id.