I’m getting this error when trying to cancel the read even though it prints out the string im trying to get why would the iterator not be removed?
The issue is on the second to last line
le_cfg_CancelTxn(iteratorRef);
Anyone know thanks?
Jun 7 01:19:51 fx30 user.emerg Legato: EMR | configTree[1004]/configTree T=main | nodeIterator.c ni_InternalRefFromExternalRef() 364 | Assert Failed: ‘iteratorRef != NULL’
le_result_t FromTree()
{
le_result_t result;
char popped[50];
char nameBuffer[LE_CFG_STR_LEN_BYTES] = { 0 };
int r = snprintf(nameBuffer, sizeof(nameBuffer), "/MQTTBUF");
if (r < 0)
{
return LE_FAULT;
}
else if (r >= sizeof(nameBuffer))
{
return LE_OVERFLOW;
}
le_cfg_IteratorRef_t iteratorRef = le_cfg_CreateReadTxn(nameBuffer);
if (le_cfg_NodeExists(iteratorRef, "") == false)
{
//LE_WARN("Configuration not found.");
le_cfg_CancelTxn(iteratorRef);
return LE_NOT_FOUND;
}
le_cfg_GoToFirstChild(iteratorRef);
le_cfg_GetPath(iteratorRef,"",popped,80);
LE_INFO("Location %s",popped);
result = le_cfg_GetString(iteratorRef,"",popped,80,"");
LE_INFO("popping %s",popped); //<----------- This works
if (result != LE_OK)
{
le_cfg_CancelTxn(iteratorRef);
return result;
}
le_cfg_CancelTxn(iteratorRef); //<---------------- issue is on this line
return LE_OK;
}
EDIT: The app isn’t sandboxed and I’m wondering if that’s causing problems.
EDIT: reading from a root tree causes the above error so now im writing in the apps tree and it gives this error
Assert Failed: ‘le_pack_PackReference( &_msgBufPtr, &_msgBufSize, iteratorRef )’