Unable to install my application on mobile

I'm unable to install my Commcare application on my mobile device for testing. I suspect it's related to the size of the lookup tables, but not sure. It's a very big set of lookup tables with one tab having 900k rows.

The app install is stopping at this point:

What is the best way to troubleshoot an issue like this?

Thanks in advance!

Hi @erobinson

I think your suspicions about those lookup tables are probably correct.

A good way to diagnose this issue is the OTA Restore API. It will show you what is being transferred to the mobile user's device. See OTA Restore API - CommCare Public - CommCare Public for more details.

You can use a browser, or a command like curl from the command line. I suspect that the data being transferred to the device is very large.

There might be alternatives to using lookup tables. Could you say more about the data in the lookup tables? In particular, do all the mobile users need all the data? Or is there a way we can break the data up so that users get only the data they need?

Thanks,

Norman

Hi @erobinson

A colleague just let me know that lookup tables are only sent to the device when the user logs in, not when the app is installed. If the installation is failing, the problem is more likely to be multimedia.

Could that be possible?

Thanks,

Norman

Hmm... interesting. Thanks for the responses @Norman_Hooper

It's actually right after login that we receive that dialogue. The process is:
Enter app code -> Locating application -> Setting up app (71 steps) -> login screen
Enter credentials -> click 'Log in' -> connecting to server -> contacting server for sync -> server contacted, downloading data -> Processing Data from Server (stuck here at step 5 of 29)

As for the other questions about needing all these options, I believe they may be necessary - many are cascaded options that are filtered as users choose initial options in the decision tree. There are also two languages for each option. I'm not sure if there's a way to test by splitting it into two separate apps, one for each language, if that helps.

Testing using the OTA Restore API, the first time I ran it, I got a response before the browser crashed. I've run it again and see this:

and console output:

Almost 15 minutes later and it's still doing something and consumed around 3Gb RAM

Tried another browser to see if it's consistent and first try broke it:

Clearly that out of memory error above must be an indication that the payload is over size.

Hi @erobinson

Yes, I think you're right. I think the payload is too big.

(It's an XML document, and your browser might be trying to parse it. If you are curious to know how big it is, you could use curl or wget to download it without parsing it.)

Splitting the lookup tables by language might be a good way to drop their size significantly, and worth testing. ("900K rows" still feels like a lot though.)

Thanks,

Norman

1 Like

curl outputs a 471 Mb payload. It comes through fine, so the issue isn't the server, I assume the mobile app isn't able to deal with it, or it's timing out. The app doesn't appear to be crashing.

471M Jun 8 17:19 output.txt

Hi Ed,

One thing to double check - is the lookup table indexed?

I'm not sure whether to expect something that size to work or not, but the indexing should make it much more likely for it to be able to function incrementally rather than fitting in memory all at once.

1 Like

Hi Clayton, it looks like some fields are, some aren't, if I'm understanding the question correctly
I will PM the 'type' tab of the downloaded tables to you showing the various tables, fields and indexing status.

I've removed all data but English and it's still sticking at the same point on mobile sync. I don't suppose there's any way anyone on the Dimagi side would have insight into the app in a mobile dev environment to see what's happening if I share app code and creds?