Failed to fetch operational data via provide devel-c get_elem error {proto_usage, "expect data"} for callpoint

Hello,

I tried to fetch operational data for some parent leaf, to test it i’am using confd_cli, the first show command work fine, if i try i second one i get “Error: application protocol error”.
In confd log i found many error “devel-c get_elem error {proto_usage, “expect data”} for callpoint”.
I need to know more about this error ,can i change the log level of confd for debugging ?
What can be the issue ?

Many thanks

Hi,

The issue is likely that you return a null pointer to the data in your get_elem() callback when calling confd_data_reply_value().
See examples.confd/intro/5-c_stats for guidance.
Search for 5-c_stats in this forum for more that can be done with that ConfD example.

Besides checking out the ConfD UG Chapter “General Troubleshooting Strategies”. To debug data provider errors:

1. In your c-application that link with the libconfd library, increase the debug level to CONFD_TRACE when calling confd_init(). Example:
confd_init("arpe_daemon", stderr, CONFD_TRACE);
For more on libconfd debug levels see “confd_init” in man/man3/confd_lib_lib.3 man page.
If you enable the libconfd debug output at trace level, for your issue you will likely see something like (if you were supposed to return data of type string):

TRACE CALL data get_elem(thandle=7,/my/path  --> CONFD_OK
DEBUG confd_value_t val.s is NULL for C_STR
DEBUG Expect call to return data, cannot return CONFD_OK when no data is sent thandle=7

2. In your ConfD configuration file, confd.conf, set developer log level to TRACE. See confd.conf man page. I.e:

<logs>
…
<developerLogLevel>trace</developerLogLevel>
</logs>

Not much more helpful info here in your case. You would then have seen something like:

<DEBUG> 4-Aug-2016::10:50:41.060 CO confd[86422]: devel-c get_elem request for callpoint xyz ...
<ERR> 4-Aug-2016::10:50:41.060 CO confd[86422]: devel-c get_elem error {proto_usage, "expect data"} for callpoint xyz ...

OK, thank you for your reply