akvo / akvo-flow

A data collection and monitoring tool that works anywhere.
http://akvo.org/products/akvoflow/
GNU Affero General Public License v3.0
65 stars 31 forks source link

/remoteexception calls failing #1823

Closed stellanl closed 7 years ago

stellanl commented 7 years ago

Logs are full of /remoteexception calls returning 500. Either the backends are rejecting ok calls or (/and?) the apps are making broken calls. Interestingly I found a single successful call in akvoflow-37, which was from an Android 4 phone, all others were from Android 5 phones and failed. It could also be possible that there are a few phones with a corrupt/unacceptable-in-http stacktrace file that keep nagging the servers, since that stacktrace is not deleted until a POST succeeds

muloem commented 7 years ago

@stellanl could you confirm that all the calls to this endpoint have the parameter action=saveTrace

stellanl commented 7 years ago

It cannot be confirmed in the GAE logs, since the parameters are in the body, not the URL.

In the app code, that part of RemoteExceptionService is unchanged since (at least) 2014, and defines: private static final String ACTION_PARAM = "action"; private static final String ACTION_VALUE = "saveTrace"; This pair is added as the first post parameter.

So our code seems solid.

stellanl commented 7 years ago

I have successfully uploaded "stacktrace" files from an Andoid 4.3.3 phone and an A5 emulator to akvoflowsandbox. I see two avenues for further research:

stellanl commented 7 years ago

Got a "failing" stacktrace from Valerias Android 6 tablet. Nothing weird about the file. Only suspicious thing I have found so far is that the SimpleDateFormat objects that create and parse the 'date' parameter both use default locale. But they use the format "yyyy-MM-dd HH:mm:ss" which should result in a string that is (at least syntactically) locale-invariant.

stellanl commented 7 years ago

Have added logging of all parameters and deployed to akvoflow-dev2.

stellanl commented 7 years ago

Ok, this is yet another Android 6 (privacy) and 5.1 consequence like #1741 The phoneNumber parameter is empty, and the backend cannnot handle that.

stellanl commented 7 years ago

Additionally, the device now always sends an androidId parameter, but we do not save that info

stellanl commented 7 years ago

Test plan: On an Android 6 phone or emulator, place a text file in the Android/data/org.akvo.flow/files/stacktrace directory. It should be be deleted after it has been uploaded to the backend.

janagombitova commented 7 years ago

released in hot fix