Sync Error in DHIS2 Android Capture When Updating Dependents of a Calculated Value Attribute

DHIS2 Android Capture v30 brings several new features and improvements. However, there are a few critical issues that need to be addressed to ensure a seamless user experience.

One notable problem arises when updating attributes of a tracked entity that have already been synced. Specifically, attributes with calculated values dependent on updated fields trigger sync errors. For instance, if a client’s demographic data includes an attribute like “Age” calculated from the “DOB” attribute, any updates or corrections to the DOB cause sync errors due to the mismatch between the new calculated value and the previously synced value. This issue also extends to other calculated fields, such as “UID”, “Fullname,” derived from a combination of “Firstname,” “Lastname,” and other attributes .

The error message encountered reads: “Generated by Program rule, unable to assign value to attribute. The provided value must be empty or match the calculated value.” This suggests that the app does not handle recalculated values effectively, leading to inconsistencies and sync failures.

It’s important to note that these issues do not occur when using the web API, indicating that the problem is specific to the Android app.

Addressing the sync errors for calculated attributes is crucial for users who rely on accurate and up-to-date data. We hope to see this issue resolved in future updates to enhance the app’s reliability and functionality.

1 Like

Hi @gmajaha I am sorry about the problems you are experiencing, we are currently looking into this issue. We have been able to replicate it and are pinpointing the origin of the problem.

We’ll get back to you as soon as possible.

3 Likes

Hello again @gmajaha

We were able to replicate the issue and it is certainly not the expected behaviour. We found the problem origin to be from an API request that fails initial sync en versions 2.40 or greater. The values are being updated in the app correctly.
I have contacted the API team and confirmed with them that it is a bug. They transmitted that it will be addressed in the next minor patch.

In our replication of the error we found that an immediate sync right after the first unsuccessful one would sync correctly.

Obviously this is not ideal and not the expected behavior but maybe it could be a workaround until the fix comes out.

Let us know if there is anything else we can help you with! :slightly_smiling_face:

1 Like

@Xavi

Thank you for the swift response and for the efforts in replicating and acknowledging the issue. It’s reassuring to know that the problem has been identified and that a fix is anticipated in the next minor patch,

Looking forward to the upcoming update :pray:

I would also like to report a few additional concerns we’ve encountered since upgrading to version 2.40 when we are sync data through Android Capture app :

:x:* Sync Errors with Mandatory Data Elements: We are encountering sync errors related to the enforcement of mandatory data elements through program rules. The error message displayed is: “Generated by Program rule (‘program rule name’) - Mandatory DataElement ‘DataElement name’ is not present.”

Error1

:x:* Issues with Data Elements in Program Stages: There are similar errors concerning data elements that have been set as compulsory in program stages. The typical error reads: “Mandatory DataElement ‘DataElement name’ is not present.”

Error2

These errors occur inconsistently; in some instances, the system functions as expected, while in others, it fails. We have temporarily disabled the rules causing sync errors, but this is not a sustainable solution

:x:Event Reports - Export Issues: Additionally, When downloading CSV files from Event Reports, the columns are not ordered as arranged in the layout; they appear jumbled. This issue forces us to use the Line Listing app as a workaround. However, the workaround is limited, as any changes regarding specific periods or organizational units require adjustments in Events Reports first.

Regards

1 Like

Good morning @gmajaha,

Thanks for the detailed information, these two first issues you mention seem to be due to the same problem and has already been detected by the sdk team, and also pinpointed to an API bug in the new importer. This will also be fixed in the next minor patch in all core versions. You can track the proccess here:

https://dhis2.atlassian.net/browse/DHIS2-17560

The third issue you mention is web related is that correct? Unfortunately I don’t think I can help much with that, would you mind creating a new topic in the community with the details or a Jira issue?

Again we apologize for the problems you are experiencing when updating DHIS2, the new importer improves on the old one a lot for syncing large amounts of data and connectivity issues but as can be seen still needs to be fine-tuned for some specific configurations and usecases. Which, now that it is being used by more implementations, bugs are being detected and fixed :slightly_smiling_face:

You can track the next minor patch release for each DHIS2 core version here:

39.6

Target release date: August 8, 2024

See the list of fixes so far for this patch on Jira

40.5

Target release date: September 12, 2024

See the list of fixes so far for this patch on Jira

41.1

Target release date: August 22, 2024

See the list of fixes so far for this patch on Jira

Let us know if there is anything else we can help you with.

Regards

1 Like