Help understand and fix "Error loading form. please try again or check with an administrator"

When I create new contacts on this user’s device, I’m seeing the error “Error loading form. please try again or check with an administrator”

  1. The user’s device was fully synced.
  2. If I logged in as this user on a fresh device, I was able to create contacts without error.
  3. There are no feedback documents with any error information for this instance. But I know other users are experiencing the same problem due to manual feedback documents (eg. House registration form can't be loaded it just say error loading form)

I had a laptop but no micro-USB cable. Eventually, I synced this user’s data, reset all data for the app via Android, and logged in as the user fresh. This resolved the issue and the user was very pleased.

I know other users are suffering from this problem. How can I understand this issue and fix it for them also?

Should these details be captured in feedback documents? I don’t see any details there.

This was reported again here:

There is a VHT … that is having challenges registering. They are getting an Error Loading page when they try to register a HH and it is one month now - They need urgent help.

https://github.com/medic/config-ug-vht/issues/345

This is maybe the fifth or sixth user reporting the same challenge. What might be causing this?

Thanks for posting this @kenn. Can you add some details for the users that are having the issue?

Specifically:

  1. CHT version (I think I gather it’s 3.11)
  2. Device model
  3. Android operating system version
  4. CHT Android app version
  5. Chrome version (if Android version is 10+)

update: edited question list above to clarify the Android details we’re seeking

@jonathan Do you have these details for the user you worked with via phone?

If it’s helpful, in the app you can go to the hamburger menu → about has good info!

1 Like

Thanks @mrjones and I also forgot about the version of the Android app. I’ll edit my post above to make sure it’s clear.

@kenn Can you please provide a link to the feedback doc or an excerpt of the log array or share the feedback doc ID?

@diana The only report in feedback docs came as a “manual feedback doc” - so the users went to Hamburger > Report a Bug and typed out a description of the problem that was blocking them. I can still fetch you an ID if you like - but I’m guessing you want to look at an automated feedback doc (?)

AFAIK, there isn’t an automated feedback doc created when a user fails to load a form - or I can’t see any matching the pattern in this 3.11 project.

@kenn even if manual, it lists the errors that were logged in the console. Could you please share?
I’m betting on the feedback doc being submitted soon after the form failed to load, and we get some clues.

Ideally we would look at an assortment of them, in case just one does not have any interesting data.

Cool. Didn’t know that.

feedback-2022-01-08T16:22:11.078Z-c4c1f9be-9f88-432b-a309-6eb73db02c9a
feedback-2021-12-24T15:30:53.974Z-17ef9904-f727-4b27-9147-f146768aae8c

Thanks @kenn

Both feedback docs include the entry for the broken form:

{
   "level": "error",
   "arguments": "[\"Error loading contact form.\",{}]"
},

However the “registered” error is, obviously not helpful. It does help us eliminate at least two sources which would have some information logged besides the “Error loading contact form”.
The reason for the “{}” is caused by an implementation detail, because we use JSON.stringify to store and attach these logs. An Error object, serialized like this, yields "{}".
PouchDb errors are regular Objects, so this eliminates the case of a missing form or a missing attachment, or failing to read it from the database.

For the improvement of how we handle thrown errors in feedback docs, I added this issue:

For registering feedback docs when forms fail to load, I added this issue:

I’ll keep looking into this.

2 Likes

@diana, today we have the same error with one of the user accounts, lab personnel who test under the link facility, they can create clients, but seems we have an issue with pulling contacts so the CIF can be filled as below:

I have just checked the config for health_worker and everything looks fine, confirmed the clients were created and submitted using the suspect_registration form, challenge now is filling the CIF, which brings the error above, following troubleshooting steps above, will appreciate any insights

Hi @oyierphil

To troubleshoot, please check the console logs of the devices / browsers.

@diana, I share the console logs as below:

Hi @oyierphil

Can you please check if the user has an associated contact? You can check via the admin app, open the Users list, click to edit the respective user and check if the contact field has anything selected.

@diana, I have seen for the particular user, there is no associated contact.
Had noted something strange while creating users manually, our format for link facility creation was name: facility_name, associated_ contact: contact_link_facility.

After creating contacts, I noted some link_facilities had names, which meant I couldn’t use the contact_link facility while creating single contacts, I deleted them. This is the culprit, thinking of how to correct this now, currently, the link facility has name: XYZ and associated contact_contact_XYZ, which I cant find under the admin app user list associated contact

Thanks for checking. the missing contact is the cause for forms not loading (as the error text says).
please let us know if the issue is resolved once you add a contact to this user.

@diana, yes, i created the associated contacts in the affected link facilities and we are now good.
Our initial approach was to only register clients through the Households, thus had to revise Health Worker Form to allow creation of users, thank you and your team for always being there