Android Capture 3.4.2: sync stuck with E1005 when a HIDEFIELD program rule blanks tracked entity attributes (server 2.41.10)

Hi everyone,

I’m the DHIS2 admin for a small NGO in Panama, and I think I may have found a bug, though I’m not 100% sure, so I’d really appreciate any input.

Setup

  • Server: 2.41.10
  • Android Capture app: 3.4.2
  • Tracker program with a HIDEFIELD program rule that hides guardian attributes (Guardian Name, Guardian Cedula, Guardian Relationship Type) when the patient is 18 or older

What happens
On four of our tablets, one patient each got stuck with the gray sync icon and “API call failed, errorcode E1005.” Syncing them individually didn’t help, and unlike other gray sync errors we’ve seen, their records never actually reached the server. The sync log shows repeated “Summary for job [uid] does not exist” 404s with a new job ID each try. Nothing shows up in the Sync Troubleshooting app. When I tried to reproduce one case through web Capture, I got an HTTP 500 with “persistenceReport is null.”

The one stuck record also seems to make every other new record in the bulk sync go gray, so we’ve had to sync each patient for the week one at a time.

Three of the four stuck patients are adults (ages 22 to about 50) who had guardian information filled in on their profiles. I honestly don’t know how it got there, since they weren’t registered as minors. When their record is opened, the hide rule blanks those fields, and it looks like the tablet then fails to sync that change.

Steps to reproduce (on our dev server)

  1. On the Android app, register a patient as a minor and fill in the guardian attributes. Sync (works fine).
  2. Change the birthdate so the patient is an adult. The rule hides and blanks the guardian fields.
  3. Sync again. The record gets stuck with E1005 and never reaches the server. (Changing the birthdate was just the easiest way to create an adult with guardian data on dev. Our real cases were adults who already had guardian data for reasons I’m not sure of.)

What we ruled out

  • Doing the same blanking through web Capture saves normally (200).
  • A plain attribute edit from the tablet (changing a first name) syncs fine.
  • Upgrading the server from 2.41.9.1 to 2.41.10 didn’t fix it.

Workaround
Clearing the guardian fields on the server through web Capture, then syncing the patient again on the tablet, gets the record unstuck. This worked on our dev test patient and on three of the four real patients in production.

The fourth case (still unexplained)
The fourth stuck patient is a child, so the guardian rule doesn’t seem to explain it. His first name was changed on the tablet (the web still had a nickname), but when I tried the same name change on dev, it synced fine. I ended up entering his records manually on the web and then clearing the app’s local data on that tablet. I’m not sure what caused it, so if anyone has ideas, I’d love to hear them.

Possibly related
After one of the adult patients synced, her tablet showed a new red error (E1326) on a completed event from 2023 in a different program, where that stage blocks editing after completion. As far as I could tell, the tablet’s copy of the event matched the server exactly, so I’m not sure what change it was trying to push. Clearing the app’s local data fixed it. I can’t say for sure it’s connected to the above, but I wanted to mention it in case it helps.

Is this a known issue, or is it fixed in a newer version of the app? I’m happy to share more logs or test anything that would help. Thank you so much!

Hi @researchfd !

Thanks so much for the detailed report.

Based on your comments, it seems to be an issue on the server side rather than in the mobile app. Would it be possible to test this on a 43 (or newer) instance? There have been some changes in that version that could fix it.

Either way, please feel free to also report the bug in Jira so the devs can have a look.
Thank you!!

Hi @researchfd

Any updates on this issue? Were you able to test this in a new newer Android version as Nancy suggested?

Thank you!