ConfD User Community

Transaction fails - communication failure

I’m trying to set some config data from within my application, and I started a maapi write transaction against the candidate DB, and the app hangs at the apply transaction stage. There are some callbacks setup for the leafs I’m setting.

I’m initializing a configuration list of servers from the DHCP offer.

Trace log below. Is it locking up because it’s trying to trigger the callpoints? Is there a way to pause the callpoints, or ignore them for this transaction?

Would it be better to have dhcp client populate an xml file and then use confd_load?

TRACE MAAPI_START_TRANS  --> CONFD_OK
TRACE MAAPI_SET_NAMESPACE  --> CONFD_OK
TRACE MAAPI_SET_VALUES  --> CONFD_OK
TRACE MAAPI_APPLY_TRANS 
DEBUG external error - application communication failure
--> CONFD_ERR
error code 19 application communication failure

as always with “application communication failure”, first suggestion is to enable ConfD’s developer log (see “enabling the developer log” in confd user guide) for details on what is happening, and why specifically the error raises…

I did, that’s where I got the trace log from.

<developerLog>
<enabled>true</enabled>
<file>
<enabled>true</enabled>
<name>/var/log/confd.devel.log</name>
</file>
</developerLog>
<developerLogLevel>trace</developerLogLevel>

I removed the callpoint, but it’s still failing at the same place. Is there any further logs I can turn on to assist that would indicate what the failure was?

I changed the code to do a validate first, and the validate fails with application communication error…

maapi_start_trans(ci.maapi, CONFD_CANDIDATE, CONFD_READ_WRITE);
maapi_set_namespace(ci.maapi, thandle_run, ne__ns);
CONFD_SET_TAG_XMLBEGIN(&tagval[i++], ne_dns, ne__ns);
CONFD_SET_TAG_BOOL(&tagval[i++], ne_enabled, true);
CONFD_SET_TAG_XMLEND(&tagval[i++], ne_dns, ne__ns);
maapi_set_values(ci.maapi, thandle_run, tagval, i, "/ne/network");
maapi_validate_trans(ci.maapi, thandle_run, 1, 0); <--- this results in comms failure

Is your application thread also handling a validation point callback that gets invoked when validating the transaction? That would be a deadlock situation.
If so, you can for example create a new thread for the new transaction so that your original thread can validate that transaction.

I have no validation callpoints, only transaction callpoints, and I made sure that none applied to this particular subtree or even its parent.

I’ve tried briefly changing the model to be operational (keeping the same CONFD_SET_TAG calls), and that works. I can also use confd_load to load the xml, and it works, so there’s nothing format-related I can see.

I removed the validate, and now when it gets to maapi_prepare_trans it replies with says “wrong state”

Failed to prepare transaction: 17 
TRACE MAAPI_PREPARE_TRANS DEBUG operation in wrong state  --> CONFD_ERR

I’ve checked, and I’m in phase 2, so a write should succeed, shouldn’t it?