No data elements appearing in Android App (while Same User, DEs appearing fine in Browser) for event capture program

Hi All,
At a bit of a loss at the moment. I am supporting a new server build for a new project, and we have pushed over a few programs to get them started. One of them we pushed over is for both Browser (Capture) and Mobile (DHIS2 Android) data capture.

For some reason, although I believe the user has adequate sharing and assignment settings, the user is unable to see any data elements at all in the android mobile side. On the browser (in Capture App), the same user can see data elements and all rules seem to be firing just fine.

I’m using 2.35.10, Android 2.4 & 2.5 (tried both, just to be sure). I’ve checked through User Groups and assignments to the program…but by the very nature of the program/data elements being able to be viewed and also having the event properly sync in capture with the same user…I’m just lacking proper understanding of where to look to try and get this fixed.

Any ideas?

Was able to run the data checker in the backend of the 2.4 training version of the android and this came up:

Build version: 2.4
Build date: 1981-01-01 01:01:02
Current date: 2021-12-30 10:07:09
Device: OnePlus BE2011
OS version: Android 11 (SDK 30)

Stack trace:
java.lang.IllegalArgumentException: Both content and data must not be null
at org.hisp.dhis.rules.models.RuleActionShowError.create(
at org.hisp.dhis.rules.models.RuleActionShowError.create(
at org.dhis2.Bindings.RuleExtensionsKt.toRuleEngineObject(RuleExtensions.kt:189)
at org.dhis2.Bindings.RuleExtensionsKt.toRuleActionList(RuleExtensions.kt:81)
at org.dhis2.usescases.development.DevelopmentActivity.lambda$loadProgramRuleCheck$0$DevelopmentActivity(
at org.dhis2.usescases.development.-$$Lambda$DevelopmentActivity$dTZ866hD-rbqb6N5D5BLesRd2b4.onClick(Unknown Source:2)
at android.view.View.performClick(
at android.view.View.performClickInternal(
at android.view.View.access$3600(
at android.view.View$
at android.os.Handler.handleCallback(
at android.os.Handler.dispatchMessage(
at android.os.Looper.loop(
at java.lang.reflect.Method.invoke(Native Method)

Hello @Matthew_Boddie,

I faced the same kind of issue when pushing the DE via the API (I don’ recall if the error message was the same), see here
Dataset not loading in the Capture app - Support - Assistance technique - DHIS2 Community

those were the reasons in my case

  1. The android app doesn’t support having the same uid for 2 metadata instance EVEN if they are from different entities; it doesn’t create an error message during the import of the metadata and it work well on the data entry web application
  2. I had issues with my categories as some had 2 times the same category option (copy paste error, the data entry application showed the same category option twice)
  3. when the category options are imported via the web API, the default sharing is public read/write for the metadata but NO public rights for the data entry (I never though of this one as I was able to see the catOption on the data entry web application)

Hi @Matthew_Boddie,

I think the error shown in the log means that there is a program rule action that has a null value in both content and data. Either content or data must be defined in programRuleActions of kind Show warning, Show error, Display text or Display key/value pair.

You can quickly inspect the programRuleActions by using the url https://<your_server_url>/api/programRuleActions.json?paging=false&filter=programRuleActionType:in:[SHOWERROR,SHOWWARNING,DISPLAYKEYVALUEPAIR,DISPLAYTEXT]&fields=id,programRuleActionType,content,data

Does it show any program rule action that has no content and no data?

@pmpdelcroix can you speak more on this? Which metadata UID in particular was causing this for you? This feels like it could be a possible culprit for us.

Thanks, yes that was what I was interpreting as well, but can’t find any nulls. That said, will give it another look!

I will try my best,

Imagine you have a category “Gender” with an uid sex0000001 and then a categoryOption “Male” with the same uid (sex0000001),

when loading the metadata on the DHIS server, no error will be showed (which is normal as the is no collision in DB)

But when the Android App fetch the metadata it somehow put all the metadata in the same “table” (I don’t know the real details, I am extrapolating) and then it crashes.

I don’t know if this issue can technically happen with automatically generated uid but I won’t be surprised if it is the case because there is not conflict on the server.


1 Like