wizbots / labtab

0 stars 0 forks source link

Wizchips addition / substraction not working and videos not being uploaded #137

Open internetmosquito opened 5 years ago

internetmosquito commented 5 years ago

Latest labtab build v1.13.0 seems to have couple issues:

Attaching logs for seeral days when this behavor was found

1562776569583_logs.zip 1562793270488_logs.zip 1562704438118_logs.zip

kapoorutd commented 5 years ago

@internetmosquito

Hope you are doing well...

We have try to reproduce the above issues and found the following things as follows..

  1. Wizchips addition / substraction not working as expected

Yes, It's not working on production server but its working fine on Staging server. We debugged the app on Production server and found that we are getting response code 500 from api in this case, sharing the logs as follows..

07-12 13:14:27.662 1434-2592/org.wizbots.labtab D/org.wizbots.labtab.retrofit.ConnectionUtil: Request Url : https://wizbots.com/api/students/wizchips/add?students=4f68c3bfaea8622775000012&wizchips=1 Request Body : null 07-12 13:14:27.664 1434-2592/org.wizbots.labtab I/System.out: [CDS]rx timeout:1 07-12 13:14:27.664 1434-2592/org.wizbots.labtab I/System.out: [CDS]rx timeout:1 07-12 13:14:27.664 1434-2592/org.wizbots.labtab D/NativeCrypto: ssl=0x62b70898 sslRead buf=0x43a75580 len=8192,timeo=10 07-12 13:14:27.675 1434-2592/org.wizbots.labtab I/System.out: [CDS]rx timeout:240000 07-12 13:14:27.675 1434-2592/org.wizbots.labtab I/System.out: [CDS]rx timeout:240000 07-12 13:14:27.675 1434-2592/org.wizbots.labtab I/System.out: [CDS]rx timeout:240000 07-12 13:14:27.675 1434-2592/org.wizbots.labtab I/System.out: [CDS]rx timeout:240000 07-12 13:14:27.676 1434-2592/org.wizbots.labtab D/NativeCrypto: ssl=0x62b70898 sslWrite buf=0x42346d28 len=273 write_timeout_millis=0 07-12 13:14:27.677 1434-2592/org.wizbots.labtab D/NativeCrypto: ssl=0x62b70898 sslRead buf=0x43a75580 len=8192,timeo=240000 07-12 13:14:27.782 1434-1434/org.wizbots.labtab D/AbsListView: onWindowFocusChanged: hasWindowFocus=true, this=android.widget.ListView{41ee1828 IFED.VC. ......I. -360,0-0,951 #7f0900c0 app:id/left_drawer} 07-12 13:14:27.782 1434-1434/org.wizbots.labtab V/InputMethodManager: onWindowFocus: android.support.v7.widget.RecyclerView{438a0fe8 VFED.V.. .F.....D 5,65-585,295 #7f0900fe app:id/recycler_view_lab_details} softInputMode=34 first=false flags=#1810100 07-12 13:14:28.052 1434-2592/org.wizbots.labtab D/org.wizbots.labtab.retrofit.ConnectionUtil: Response Code : 500

  1. Still getting some videos not properly uploaded

For this issue, we go through the shared log files and found the following..

[ 07-08 15:46:08.764 4463: 7613 W/System.err ] Caused by: android.system.GaiException: android_getaddrinfo failed: EAI_NODATA (No address associated with hostname)

[ 07-08 15:46:08.765 4463: 7845 W/System.err ] java.net.UnknownHostException: Unable to resolve host "wizbots.com": No address associated with hostname

[ 07-10 09:31:30.429 3629: 7284 W/System.err ] java.net.SocketTimeoutException: timeout

[ 07-10 09:31:30.429 3629: 7284 W/System.err ] at okio.Okio$3.newTimeoutException(Okio.java:212)

Here the user trying to upload the large file size video, that cause timeout. This can also be occurred as we are getting "UnknownHostException", we user already start uploading the video.

The retry option is already implemented in the project (through background sync).

Meanwhile I have changed some of the android api related changes which was deprecated earlier.

internetmosquito commented 5 years ago

@kapoorutd about first issue we will check but looking at fist trace seems request body is empty?

About the second one:

What about circuit breaker implementation?

internetmosquito commented 5 years ago

@kapoorutd I got Joshua comment yesterday, videos still not being uploaded...attaching logs, it's because of the same issue you mentioned? If so, why is this happening?

1563223127715_logs.zip

kapoorutd commented 5 years ago

@internetmosquito Hope you are doing well...

For the above issue, we go through the shared log files and found the following..

1. As we mention earlier, we are getting invalid Json Sometimes

[ 06-14 11:40:58.258 12199:12199 E/org.wizbots.labtab.util.LabTabUtil ] Error In Converting JsonToModel com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Unterminated array at line 1 column 14 path $[1] at com.google.gson.Gson.fromJson(Gson.java:902) at com.google.gson.Gson.fromJson(Gson.java:852) at com.google.gson.Gson.fromJson(Gson.java:801)

Solution : We have print the json string log in the code which is responsible for causing the invalid Json Exception, So from next time we are able to detect the invalid Json string.

2. The user is having low memory device as we are getting OOM error from the shared log file.

[ 06-14 11:42:05.608 12199:12567 I/art ] Alloc concurrent mark sweep GC freed 3(72B) AllocSpace objects, 0(0B) LOS objects, 0% free, 254MB/256MB, paused 925us total 79.527ms

[ 06-14 11:42:05.608 12199:12567 W/art ] Throwing OutOfMemoryError "Failed to allocate a 4147212 byte allocation with 1696584 free bytes and 1656KB until OOM"

[ 06-14 11:42:05.610 12199:12567 E/PriorityExecutor ] Request threw uncaught throwable java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: Failed to allocate a 4147212 byte allocation with 1696584 free bytes and 1656KB until OOM at java.util.concurrent.FutureTask.report(FutureTask.java:94) at java.util.concurrent.FutureTask.get(FutureTask.java:164) at com.bumptech.glide.load.engine.executor.FifoPriorityThreadPoolExecutor.afterExecute(FifoPriorityThreadPoolExecutor.java:96) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1141) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607) at java.lang.Thread.run(Thread.java:762)

Solution : We have increase the heap size that might increase some limited amount of heap but as per my limited understanding its a system specific issue as per the below reference..

https://stackoverflow.com/questions/11484353/gson-throws-malformedjsonexception


Could we add a manual "retry upload"? -->> Its already implemented in the project in the background as we have tested at our end. Suppose we are uploading a video, Somehow we interrupted that uploading from our end, once we again open the app and switch on the internet connection, the uploading process gets resumed and this can be viewed in the notification tray, Once the uploading is completed we are displaying the video uploaded notification.

What about circuit breaker implementation? -->> For this implementation we are looking for an optimal solution which can be implemented in the project so that we do not need to change lots of code in the project.

However, We have increased the heap size of app and updated the android api level in all the modules which are different from the app modules, as we were getting some incompatible version issues from the shared log files.

internetmosquito commented 5 years ago

@kapoorutd hello again,

  1. As we mention earlier, we are getting invalid Json Sometimes

[ 06-14 11:40:58.258 12199:12199 E/org.wizbots.labtab.util.LabTabUtil ] Error In Converting JsonToModel com.google.gson.JsonSyntaxException: com.google.gson.stream.MalformedJsonException: Unterminated array at line 1 column 14 path $[1] at com.google.gson.Gson.fromJson(Gson.java:902) at com.google.gson.Gson.fromJson(Gson.java:852) at com.google.gson.Gson.fromJson(Gson.java:801)

Solution : We have print the json string log in the code which is responsible for causing the invalid Json Exception, So from next time we are able to detect the invalid Json string.

Alejandro: Not really happy we need again for this to fail to know what's going on...when is this happening exactly? When trying to upload video? request body is malformed?

  1. The user is having low memory device as we are getting OOM error from the shared log file.

[ 06-14 11:42:05.608 12199:12567 I/art ] Alloc concurrent mark sweep GC freed 3(72B) AllocSpace objects, 0(0B) LOS objects, 0% free, 254MB/256MB, paused 925us total 79.527ms

[ 06-14 11:42:05.608 12199:12567 W/art ] Throwing OutOfMemoryError "Failed to allocate a 4147212 byte allocation with 1696584 free bytes and 1656KB until OOM"

[ 06-14 11:42:05.610 12199:12567 E/PriorityExecutor ] Request threw uncaught throwable java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: Failed to allocate a 4147212 byte allocation with 1696584 free bytes and 1656KB until OOM at java.util.concurrent.FutureTask.report(FutureTask.java:94) at java.util.concurrent.FutureTask.get(FutureTask.java:164) at com.bumptech.glide.load.engine.executor.FifoPriorityThreadPoolExecutor.afterExecute(FifoPriorityThreadPoolExecutor.java:96) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1141) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607) at java.lang.Thread.run(Thread.java:762)

Solution : We have increase the heap size that might increase some limited amount of heap but as per my limited understanding its a system specific issue as per the below reference..

https://stackoverflow.com/questions/11484353/gson-throws-malformedjsonexception

Alejandro: Will check brand and model of used tablet to check specs

Could we add a manual "retry upload"? -->> Its already implemented in the project in the background as we have tested at our end. Suppose we are uploading a video, Somehow we interrupted that uploading from our end, once we again open the app and switch on the internet connection, the uploading process gets resumed and this can be viewed in the notification tray, Once the uploading is completed we are displaying the video uploaded notification.

Alejandro: How does that work? I mean, we don't support on the API to resume a partial upload...that's for sure, I'm surprised you can actually resume without hitting the endpoint to upload project file again?

What about circuit breaker implementation? -->> For this implementation we are looking for an optimal solution which can be implemented in the project so that we do not need to change lots of code in the project.

However, We have increased the heap size of app and updated the android api level in all the modules which are different from the app modules, as we were getting some incompatible version issues from the shared log files.

Alejandro: Ok, will make new release with those changes

internetmosquito commented 5 years ago

@kapoorutd waiting for your feedback

kapoorutd commented 5 years ago

@internetmosquito

Hope you are doing well...

Please find my comment for above feedback...

We have cross check the video uploading functionality after selecting around (110 mb size) video file from gallery, and found the connection time out issue , when the is a connection break in between the uploading time. We have added the connection pool to handle these issue in case of uploading videos. We also check for connection interruption issue, Now when there is any connection interruption in between the uploading time, the selected file will automatically starts uploading the video whenever the device get connected.

We have tested our end and found its working fine.

And for the 4XX response code handling issue, we are looking into it now. Once completed from our end, we update you about it.

Did you get the change to get the device specifications for the above user (Joshua) ?

kapoorutd commented 5 years ago

We have handle the 40X response code, by added the checks which was left in the code. So, As of now we won't get any crashes for 40X response code case.

internetmosquito commented 5 years ago

@kapoorutd ok let's see how all this works in production, making a new build